FIX: IDocHostUIHandler Not Queried for CLSID_WebBrowser_V1
This article was previously published under Q192501 On This PageSYMPTOMS
When hosting the Internet Explorer WebBrowser control, the host application
can control the user interface by implementing the IDocHostUIHandler
interface. This interface is obtained by Internet Explorer from the host's
client site and allows the host to replace menus, toolbars and context
menus.
If the WebBrowser control is instantiated using the CLSID_WebBrowser_V1 class identifier, the host is not queried for the IDocHostUIHandler interface. RESOLUTION
If possible, create the WebBrowser control using the CLSID_WebBrowser class
identifier. The Internet Explorer 3.0x automation and event interfaces are
available from this object, but are not marked as default.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Internet Explorer 5. MORE INFORMATIONCLSID_WebBrowser and CLSID_WebBrowser_V1 DifferencesThe WebBrowser control can be created using either the CLSID_WebBrowser or CLSID_WebBrowser_V1 class identifier and supports both the Internet Explorer 3.0x and 4.0x interfaces. The latter provides a mode compatible with Internet Explorer 3.0x by exposing those interfaces as default:Class ID Default Interface Default Event Interface ----------------- ----------------- ----------------------- CLSID_WebBrowser IWebBrowser2 DWebBrowserEvents2 CLSID_WebBrowser_V1 IWebBrowser DWebBrowserEvents Replacing the Context MenuIf you are implementing the IDocHostUIHandler interface to replace the Internet Explorer context menu, and the host application is using the Microsoft Foundation Classes (MFC), you can override the default CWinApp implementation of PreTranslateMessage as follows.Use this code in your CWinApp-derived class:
Use this code in the MFC view class that hosts the WebBrowser control:
REFERENCESFor more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites: http://msdn.microsoft.com/ie/ (http://msdn.microsoft.com/ie/)
(c) Microsoft Corporation 1998, All Rights Reserved. Contributions by Mark Davis, Microsoft Corporation.http://support.microsoft.com/iep (http://support.microsoft.com/iep) APPLIES TO
| Article Translations
|

Back to the top
