D
Don Walker
According to http://msdn2.microsoft.com/en-us/library/system.windows.forms.
webbrowser.createwebbrowsersitebase.aspx I should be able to customize the
behavior of the System.Windows.Forms.WebBrowser control as follows:
"To use this feature, implement classes that inherit from the WebBrowser and
WebBrowser.WebBrowserSite classes. The unmanaged WebBrowser ActiveX control
uses the protected CreateWebBrowserSiteBase method to retrieve extensibility
interfaces implemented by the WebBrowser.WebBrowserSite class. Override the
CreateWebBrowserSiteBase method to return an instance of your own class that
inherits from the WebBrowser.WebBrowserSite class. The WebBrowser.
WebBrowserSite class provides default implementations of the OLE
IDocHostUIHandler. You can provide your own implementation of this interface
or implement any other WebBrowser ActiveX control interface in order to
customize the behavior of the control. If you provide your own
implementation for any IDocHostUIHandler members, you must implement all the
members of that interface."
I've implemented my own classes and confirmed in debug that my version of
CreateWebBrowserSiteBase is being called and creates my class. However, none
of my IDocHostUIHandler methods are being called. I suspect that the problem
may be in my constructor, which calls the WebBrowser.WebBrowserSite
constructor, which creates a competing implementation of IDocHostUIHandler.
The documentation implies that this should work. Am I missing anything? Any
suggestions or workarounds?
Thanks.
webbrowser.createwebbrowsersitebase.aspx I should be able to customize the
behavior of the System.Windows.Forms.WebBrowser control as follows:
"To use this feature, implement classes that inherit from the WebBrowser and
WebBrowser.WebBrowserSite classes. The unmanaged WebBrowser ActiveX control
uses the protected CreateWebBrowserSiteBase method to retrieve extensibility
interfaces implemented by the WebBrowser.WebBrowserSite class. Override the
CreateWebBrowserSiteBase method to return an instance of your own class that
inherits from the WebBrowser.WebBrowserSite class. The WebBrowser.
WebBrowserSite class provides default implementations of the OLE
IDocHostUIHandler. You can provide your own implementation of this interface
or implement any other WebBrowser ActiveX control interface in order to
customize the behavior of the control. If you provide your own
implementation for any IDocHostUIHandler members, you must implement all the
members of that interface."
I've implemented my own classes and confirmed in debug that my version of
CreateWebBrowserSiteBase is being called and creates my class. However, none
of my IDocHostUIHandler methods are being called. I suspect that the problem
may be in my constructor, which calls the WebBrowser.WebBrowserSite
constructor, which creates a competing implementation of IDocHostUIHandler.
The documentation implies that this should work. Am I missing anything? Any
suggestions or workarounds?
Thanks.