PRB: WebBrowser Problems When Refreshing in TitleChange Handler

Last reviewed: January 19, 1998
Article ID: Q179229
The information in this article applies to:
  • Microsoft Internet Explorer (Programming), versions 3.02, 4.0, 4.01
  • Microsoft ActiveX SDK, version 1.0
  • Internet Client SDK, versions 4.0, 4.01

SYMPTOMS

When an application using the WebBrowser control makes a call to the Refresh method of the WebBrowser control in an event handler for the TitleChange event, various problems occur.

Internet Explorer 3.02 crashes with an access violation. In Internet Explorer 4.0 and 4.01, an infinite loop occurs and the browser hangs.

CAUSE

In Internet Explorer 4.x this behavior is by design. Calling Refresh from within a TitleChange event handler causes the WebBrowser control to fire a TitleChange event. This infinite loop occurs if you call Refresh in handlers for many of the WebBrowser events.

RESOLUTION

Do not call Refresh within a handler for a WebBrowser event.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

  1. In Visual Basic, drop a WebBrowser control on a form.

  2. Add a button.

  3. Add the following code to the click event handler for the button:

          WebBrowser1.Navigate "http://www.microsoft.com"
    

  4. Add the following code to the WebBrowser's TitleChange event handler:

          Webbrowser1.Refresh
    

  5. Run the project, and click the button.

  6. In Internet Explorer 3.02 the application will crash. In Internet Explorer 4.0 and 4.01, an infinite loop occurs.

Technology        : kbInetDev internet
Version           : WINDOWS:1.0,3.02,4.0,4.01
Platform          : WINDOWS
Issue type        : kbprb


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 19, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.