Wizpatent

Platform: VS2005

Programming language: C#

Problem: We are able to create a Toolband but we are unable to use the Toolband to activate Explorer Bar

Detail of what we have done:


We have downloaded the KBbar project (NewKB.exe) from Microsoft.com, URL: http://support.microsoft.com/kb/821793


However, we want to use the Explorer ¡°ShowBrowserBar¡± method of the KBbar to activate Explorer bars in IE. The input parameters for ¡°ShowBrowserBar¡± method of the KBbar are different from the parameters documented for this method on MSDN web site. As a result we are not able to follow the example shown on MSDN web site.


Parameters of ShowBrowserBar method in KBbar is

(Interop::SHDocVw::WebBrowserClass*)


Void ShowBrowserBar(System::Object__gc*__gc*, System::Object__gc*__gc*, System::Object__gc*__gc*)


Paraemters of ShowBrowserBar method as documented MSDN web site is


(SHDocVw::WebBrowserClass)


HRESULT ShowBrowserBar(VARIANT *pvaClsid,VARIANT *pvarShow, VARIANT *pvarSize);

Further note:

Link for ShowBrowserBar method on MSDN: http://msdn.microsoft.com/library/default.asp url=/workshop/browser/webbrowser/reference/ifaces/iwebbrowser2/showbrowserbar.asp

The following is our source code in a button_click event in KBBar (the code is same as the example shown on MSDN web site http://support.microsoft.com/kb/255920)

VARIANT vtBandGUID, vtShow;

vtBandGUID.vt = VT_BSTR;

vtBandGUID.bstrVal = SysAllocString(OLESTR("{30D02401-6A81-11D0-8274-00C04FD5AE38}"));

vtShow.vt = VT_BOOL;

vtShow.boolVal = true;

Explorer->ShowBrowserBar(&vtBandGUID, &vtShow, 0);

However, I got the following error when I tried to compile KBbar,

'Interop::SHDocVw::WebBrowserClass::ShowBrowserBar' : cannot convert parameter 1 from 'VARIANT *' to 'System::Object __gc *__gc * '


Help needed:


1. Appreciate if you can tell how to use the Explorer ShowBrowserBar method in KBbar project to activate an Explorer Bar application.


OR


2. If you can tell us where to find the correct documentation to use the Explorer ShowBrowserBar method in KBbar project.


Thank you.



Re: Internet Explorer Extension Development How to activate Explorer bar in toolband, please

IECUSTOMIZER

Hi,

I am not a C# or C++ developer, but my guess is to remove the OLESTR()operator. eg.

vtBandGUID.bstrVal = SysAllocString("{30D02401-6A81-11D0-8274-00C04FD5AE38}");

Regards.






Re: Internet Explorer Extension Development How to activate Explorer bar in toolband, please

Artie Sluka

Well, off the bat it look's like you are using a .NET-wrapped version of the library, and the MSDN documentation is the COM-version of the library.

I've done something similar by using a BHO to activate a Band Object in the BHO's "SetSite" method:

String guid = "{your toolband guid}";
Boolean vis = true;

object guidObj = (object)guid;
object visObj = (object)vis;
object arg = null;
((IWebBrowser2)pUnkSite).ShowBrowserBar(ref guidObj, ref visObj, ref arg);

Of course, we're attaching to IE and now Windows Explorer, so casting to (IWebBrowser) probably do you much good, but this is a working implementation of what I think you are trying to do.