HOWTO VB2008: VB6 ActiveX /WebBrowser
I have a VB6 Windows Application that uses the WebBrowser control to run extended
JavaScript. The WebBrowser document text (html + javascript + local activex <object> tag)
is directly set and invoked by the VB6 application. The invoked javascript calls the
extended class functionality provided by the VB6 ActiveX control and then generates output to
the WebBrowser document. Note, in this older scenario there is no web server required.
How would I do the above using VB2008?
At this point I have created a VB2008 class library (with 'Make assembly COM-Visible', 'Sign the Assembly', and a build followed by a run regasm /codebase). This should be the equivalent of the ActiveX control. Also I have built a VB6 application to see if I can reference the COM Callable Wrapper and the class library. NOTE: the class library does appear in the reference list and I'm able to invoke the class functions from VB6.
After creating a small VB2008 test application with the WebBrowser control on a form, I found that the <object reference> in the html doesn't load the class library. This was also a problem when using a simple html page in MSIE (allowed activex on the page).
The test application sets the WebBrowser's document to an html string (includes the javascript), but it isn't clear to me what html tag is needed to embed the class library so that it can be accessed by the javascript code. Similar examples I've seen left out some of the important details. I have tried:
<object id='mine' name='mine' classid='ActiveXDotNet.dll#ActiveDotNet.MyClassLib rary'></object>
and
<object id='mine' name='mine' classid='clsid:092EC730-6456-3B1C-BD27-C17A09533943'></object>
where the clsid is the one found via regedit search on the class library name.
Is there a better approach?
Detailed examples would be wonderful.
Any ideas are appreciated.
Philibuster
__________________
Philibuster
|