Please solve a problem about IE Toolbar's appearance.

  • Thread starter Thread starter keandi
  • Start date Start date
K

keandi

Hi. every one~

I wrote a problem IE toolbar's appearance.
And I tested it.

In SetSite I called RunMe.
I could see the messages of MessageBox.
But I couldn't see my IE toolbar.

In case I check my toolbar on menu on IExplorer, I can see my IE
toolbar.
But I can't see it automatically.

In case I check my toolbar on menu on IExplorer, I can see my IE
toolbar always.
(of course, automatically.....)

------------- CODE begin -----------------------------
void CMyBar::SetSite(IUnknown* pUnkSite)
{
MessageBox(NULL, L"1", NULL, NULL);
RunMe(pUnkSite);
}

void CMyBar::RunMe(IUnknown* pUnkSite)
{
MessageBox(NULL, L"2", NULL, NULL);
if (m_bShow) return;
if (pUnkSite == NULL) return;

IWebBrowser2 *pBrowser = NULL;
// Ensure that our site is an browser window
HRESULT hr = pUnkSite->QueryInterface(IID_IWebBrowser2, (void **)
&pBrowser);
if (SUCCEEDED(hr))
{
MessageBox(NULL, L"show me..!", NULL,
NULL);
// Display the Explorer Bar (the Search Bar in this case)
VARIANT vtBandGUID, vtShow;
vtBandGUID.vt = VT_BSTR;
vtBandGUID.bstrVal =
SysAllocString(OLESTR("{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"));
vtShow.vt = VT_BOOL;
vtShow.boolVal = true;
hr = pBrowser->ShowBrowserBar(&vtBandGUID, &vtShow, 0);
if (SUCCEEDED(hr)) {
int a = 1;
}
SysFreeString(vtBandGUID.bstrVal);
pBrowser->Release();
}

}
------------- CODE end -----------------------------
 
Back
Top