Article ID: 231578 - Last Review: November 21, 2006 - Revision: 2.1 FIX: ASSERT in WinOcc.cpp when Hosting a WebBrowser Control in an MFC ContainerThis article was previously published under Q231578 On This PageSYMPTOMS
Take a CHtmlView based application or have a dialog hosting a web browser control. Go to a local folder. Right-click and select either New Folder or one of the file types listed there. It will ASSERT in WinOcc.cpp, Line 331. This does not have any impact on the release build.
CAUSE
This is due to a bug in MFC for UI activation of an ActiveX control.
RESOLUTION
Override the PreTranslateMessage function in the dialog class or the one derived from CHtmlView. If the message is WM_RBUTTONDOWN, return 0. The code should look like this: This eliminates the possibility of having a context menu for the container. STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual C++ 6.0. MORE INFORMATIONSteps to Reproduce Behavior
APPLIES TO
| Article Translations
|

Back to the top
