FIX: Canceling BeforeNavigate Shows Dialog with 'X' (176116)
The information in this article applies to:
- Microsoft Internet Explorer (Programming) 3.0
- Microsoft Internet Explorer (Programming) 3.01
- Microsoft Internet Explorer (Programming) 3.02
- Microsoft Internet ActiveX Controls 1.0
- Microsoft ActiveX SDK
This article was previously published under Q176116 SYMPTOMS
The Internet Explorer WebBrowser control has an event called
BeforeNavigate(). BeforeNavigate() is called with a BOOLEAN pointer
(Cancel) that you can set to TRUE to prevent the navigation from occurring.
In C++, if you set the Cancel parameter to TRUE, the navigation will be
cancelled as it should, but you will also see a blank dialog box with an
"X." In Visual Basic, you will get a runtime error 287 (Application-defined
or object-defined error).
CAUSE
The WebBrowser control is incorrectly throwing an exception with an error
code of zero.
RESOLUTION
This bug is fixed in Internet Explorer 4.0.
For people using Internet Explorer version 3.02 and earlier, you can work
around this problem by wrapping the call to Navigate() with an exception
handler, and ignore an error if the error code is zero. Visual Basic sets
the error number to 287 (Application-defined or object-defined error) if
the error code was originally zero, so you should check for this instead.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug has been corrected in Internet
Explorer 4.0.
REFERENCES
ActiveX SDK online documentation
Modification Type: | Minor | Last Reviewed: | 8/18/2005 |
---|
Keywords: | kbbug kbfix KB176116 |
---|
|