The information in this article applies to:
SYMPTOMS
The WebBrowser control hosted in an MFC application does not repaint
properly after the DHTML showModalDialog() function is called by the
displayed page and the dialog box is closed. Other dialog boxes such as
Alerts do not cause this problem.
CAUSEThe WebBrowser control does not handle the WM_ERASEBKGND message correctly in this case. RESOLUTIONHandle the WM_ERASEGKGND message in your CView-derived class. Return from the OnEraseBkgnd() method without calling the base class OnEraseBkgnd(). STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. MORE INFORMATION
To reproduce this behavior, follow these steps:
When MFC hosts a control, it subclasses that control and passes certain messages to the control. This is the case for the WM_ERASEBKGND message. When you close the dialog box that was created with showModalDialog(), MFC calls the windows procedure of the WebBrowser control and passes the WM_ERASEBKGND message. In this case, the WebBrowser control does not repaint itself. In order to stop this problem from happening, you must prevent this message from being sent to the WebBrowser control. To do this, just handle the WM_ERASEBKGND message in your CView-derived class. Then, in your message handler, return without calling the base class version of the handler function. Here is the MFC code that demonstrates how this should be done:
REFERENCES
For more information about the WM_ERASEBKGND message and the OnEraseBkgnd
method, please refer to the Visual C++ 5.0 documentation.
http://msdn.microsoft.com/workshop/default.asp Additional query words: repaint erase WM_ERASEBKGND
Keywords : kbIE400 kbIE401 kbIE500 AXSDKWebBrowser |
Last Reviewed: April 30, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |