0

次の doc2 が doc22 と異なるのはなぜですか?

IHTMLDocument2 doc2 = (pDisp as IWebBrowser2).Document as IHTMLDocument2;
IHTMLDocument2 doc22 = doc2.body.document as IHTMLDocument2;
bool isequal = Marshal.GetIUnknownForObject(doc2) == Marshal.GetIUnknownForObject(doc22);
//Here, isequal is false. Why?
4

1 に答える 1

0

私にとって最も可能性の高い説明は、同じものに対して異なるラッパー オブジェクトが作成されるということです。MSHTML がこれを内部的に管理する方法を知っている人はいません。世界が秩序ある限り((pDisp as IWebBrowser2).Document as IHTMLDocument3).documentElement as IUnknown == (((pDisp as IWebBrowser2).Document as IHTMLDocument2).body.document as IHTMLDocument3).documentElement as IUnknown;)

于 2011-10-18T14:44:49.547 に答える