I’ve a webbrowser control and I’m trying implement IDocHostUIHandler in the container. However since I don’t have a default IOleClientSite I can’t forward all events to a default container.
And I couldn’t find a way to response all of them, giving wrong responses to some of the events or not doing anything causing application to crash.
Fox example:
Public Sub ShowUI(ByVal dwID As UInteger, ByRef pActiveObject As Object, ByRef pCommandTarget As Object, ByRef pFrame As Object, ByRef pDoc As Object) Implements SecureBrowser.IDocHostUIHandler.ShowUI
'DefaultClientSite.ShowUI(dwID, pActiveObject, pCommandTarget, pFrame, pDoc)
End Sub
Since I’m not in IE or something like that I don’t have a default IOleClientSite. MSDN doesn’t help that much when it comes to figure out how to fill those pointers/ByRefs.
I haven’t actually done this for the IDocHostUIHanlder interface, but in general, it’s usually enough to return E_NOTIMPL for any methods that you don’t want to implement.
If you’ve got a version of Visual Studio with the MFC source, you can have a look at their implementation, in CHtmlView: that largely just returns S_FALSE for most methods, without setting any of the output structures.