Dear colleagues! Please help me understand what I’m doing wrong!
I have a problem when I programmatically activate my IE toolbar from other program. Making it following the instruction given at Microsoft support site (http://support.microsoft.com/kb/q255920/):
SHDocVw::IWebBrowser2Ptr pIE;
HRESULT hr = ::CoCreateInstance(CLSID_InternetExplorer, NULL,
CLSCTX_LOCAL_SERVER, IID_IWebBrowser2, (LPVOID*)&pIE);
if(FAILED(hr)) return;
try {
_variant_t vClsID;
_variant_t vVis;
_variant_t vNotUsed;
vClsID.vt = VT_BSTR;
vClsID.bstrVal = SysAllocString(OLESTR("{MY_TOOLBAR_GUID}"));
vVis.vt = VT_BOOL;
vVis.boolVal = VARIANT_TRUE;
vNotUsed.vt = VT_INT;
vNotUsed.intVal = 1;
hr = pIE->ShowBrowserBar()(&vClsID, &vVis, &vNotUsed);
SysFreeString(vClsID.bstrVal);
if(FAILED(hr)) return;
}catch(...) {return;}
pIE->Navigate2(&Url);
pIE->Visible = TRUE;
This code works correctly in IE7, but doesn't work in IE8. In both cases ShowBrowserBar() returns S_OK, but in IE8 toolbar.dll is not loaded into the browser, i.e. the toolbar is not activated and therefore not displayed. I also tried to launch IE8 with three tabs and check if ShowBrowserBar() attempts to open the toolbar in the tabs, not the manager process.
It is log file:
Handle url 'outlook:'
ShowBrowserBar() FAILED!
Handle url 'http://www.handypassword.com'
ShowBrowserBar() SUCCESSED!
Handle url 'http://www.google.ru/'
ShowBrowserBar() SUCCESSED!
Handle url 'http://vkontakte.ru/'
ShowBrowserBar() SUCCESSED!
Everything works as expected in IE7, but not in IE8, and I can't understand why the ShowBrowserBar() method returns S_OK in both of them.
Has anybody got any clues?
Warm regards, Anna.