Hi,
> In the docs it says: "To gain this control, you need to implement your
> host's IDispatch so it handles DISPID_AMBIENT_DLCONTROL. When the WebBrowser
> Control is instantiated, it will call your IDispatch::Invoke with this ID."
(ms-help://MS.MSDNQTR.2003FEB.1033/ProgIE/workshop/browser/hosting/wbcustomi
> zation.htm).
>
[quoted text clipped - 4 lines]
>
> How is it possible for the webbrowser to call my method ??
How do you host this WebBrowser control and override
DISPID_AMBIENT_DLCONTROL property on site object? As far as I know Tim
Anderson's HTMLEditor http://www.itwriting.com/htmleditor/index.php handles
this situation.
..
Regards,
Vadim
Daniel Weber - 04 Jul 2003 12:12 GMT
Vladim,
> How do you host this WebBrowser control and override
> DISPID_AMBIENT_DLCONTROL property on site object? As far as I know Tim
> Anderson's HTMLEditor http://www.itwriting.com/htmleditor/index.php handles
> this situation.
My class inherits those interfaces: IDocHostUIHandler, IOleClientSite
I make a call like this:
((IOleObject)webBrowser.GetOcx()).SetClientSite(this);
Note that 'this' in this context is not a just another class, not the
control where the WebBrowser is embedded.
But it works for IDocHostUIHandler, ShowContext and other methods are
called.
I now have to handle Invoke calls with DISPID_AMBIENT_DLCONTROL:
I implemented this:
[System.Runtime.InteropServices.DispIdAttribute(-5512)]
public int DispidAmbientDlcontr
{
get{return 0;}
}
and tried that also:
[System.Runtime.InteropServices.DispIdAttribute(-5512)]
public int DispidAmbientDlcontr()
{
return 0;
}
but it never gets called. I implemented these methods also on the control
(the class actually hosting the webbrowser), it doesn't work.
It says during creation of the webbrowser it gets the hosts IDispatch, so
what IS actually the host ??
Is there a way to let webbrowser know the REAL IDispatch ??
thx
daniel
> Hi,
>
[quoted text clipped - 3 lines]
> > Control is instantiated, it will call your IDispatch::Invoke with this
> ID."
(ms-help://MS.MSDNQTR.2003FEB.1033/ProgIE/workshop/browser/hosting/wbcustomi
> > zation.htm).
> >
[quoted text clipped - 15 lines]
> Regards,
> Vadim