ICustomDoc implementation
I want to implement ICustomDoc (and related interfaces IDocHostUIHandler) from inside my project.
The only working way is to link olelib.tlb (Edanmo) but I prefer to make all work inside my project.
Why MSHTML.tlb doesn't expose ICustomDoc???
In effect it's possible in C++ with QueryInterface of HTMLDocument!!!
*** IS IT POSSIBLE TO USE QueryInterface directly from VB??? ***
Thank You all!!!
Implementing IDocHostUIHandler
Hi,
I hope you want to use a webbrowser control and control its behaviour from within your project , If Yes, then this is what you can do in order to implement IDocHostUIHandler from within your project.. do the following:
1> Inherit a class from IDocHostUHandler... say
CMyIDocHostUHandler.
2> Now IDocHostUIHandler has 15 pure virtual functions . All
these pure virtual function needs to be overriden by us.
3> In order to refer to these pure virtual functions exposed
by IDocHostUIHandler just refer to MSDN.
4> Now if you are using a webBrowser control then in the
navigate complete event of the webbrowser control create
the instance of the inherited class i.e CIDocHostUHandler.
5> Now get the document pointer of the webbrowser control
by calling "get_document" function on IWebBrowser2
interface of the webbrowser.This pointer is basically an
IDispatch pointer.
6> Once this IDispatch pointer is obtained, get ICustomDoc
interface from IDispatch.
7> On obtaining the ICustomDoc interface, call the
SetUIHandler function , and pass the address of
CMyIDocHostUHandler instance as parameter.
8> On doing so the Web Browser will call methods on the
interface and behave according to how the host
implemented the interface.
Hope this suffices your need.
- vibin
ICustomDoc implementation
Hi vibin_nair!!!
OK... this is the C++ like implementation!!!
Is it someway possible to do it directly from VB???
My problem is that ICustomDoc is not exposed by any TypeLib...
I only find a tlb from Edanmo (http://www.mvps.org/emorcillo/downlo...ibs/tl_ole.zip) which make all the work but I would like to make it without linking to that tlb!!!
My BIG problem is that I prefer to understand what I'm using or doing and evntually make it from myself!!!