The information in this article applies to:
SYMPTOMSIn a Visual Basic 5.0 application that is accessing the Internet Explorer object model, setting a variable declared as HTMLWindow2 equal to Document.parentWindow, results in a type mismatch. RESOLUTIONDeclare your window variable as IHTMLWindow2. STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Microsoft Internet Explorer 5. MORE INFORMATION
When accessing the document object model in a Visual Basic application, it
is sometimes desirable to access the window object through the parentWindow
property of the Document object. For example, you may be hosting the
WebBrowser control in your application and wish to access a method or
property of the window object associated with the WebBrowser control.
Steps to Reproduce BehaviorThe following Visual Basic code demonstrates this problem:
The resolution is to declare your window variable as IHTMLWindow2. Here is
the Visual Basic code that works in the Internet Explorer 5.0 Developer
Preview:
Please note that you must insert the "Microsoft Internet Controls"
component into your project and set a reference to Mshtml.tlb. The one
disadvantage of this workaround is that you will not be able to sink events
for the window object.
REFERENCESFor more information, please see the MSDN Web Workshop: http://msdn.microsoft.com/workshop/default.aspFor additional information, please see the following article(s) in the Microsoft Knowledge Base: Q188020 BETA-PRB: Type Information not Found in Mshtml.dll Additional query words:
Keywords : kbnokeyword kbIE500fix kbIEdp1bug |
Last Reviewed: April 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |