RE: Unable to cast COM object of type 'System.__ComObject' to class type 'mshtml.HTMLDocumentClass'
- From: Bhavin Chheda<bmchheda1@xxxxxxxxx>
- Date: Tue, 14 Oct 2008 21:13:21 GMT
Hello,
Below is my existing code...
mshtml.IHTMLDocument3 doc = (mshtml.IHTMLDocument3)axWebBrowser1.Document;
string strHtml = ((mshtml.HTMLDocumentClass) (doc)).documentElement.outerHTML +
Environment.NewLine;
But I am getting error as......
Unable to cast COM object of type 'System.__ComObject' to class type 'mshtml.HTMLDocumentClass'. COM components that enter the CLR and do not support IProvideClassInfo or that do not have any interop assembly registered will be wrapped in the __ComObject type. Instances of this type cannot be cast to any other class; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.
Please Help,
bmchheda1@xxxxxxxxx
From http://www.developmentnow.com/g/21_2007_1_0_0_913194/Unable-to-cast-COM-object-of-type-System--ComObject-to-class-type-mshtml-HTMLDocumentClass.htm
Posted via DevelopmentNow.com Groups
http://www.developmentnow.com/g/
.
- Prev by Date: Re: Passing an array from a VB.NET COM component to ASP
- Next by Date: Declare the structure in c++ component
- Previous by thread: COM Interop application hangs
- Next by thread: Declare the structure in c++ component
- Index(es):
Loading