IHTMLDocument get_script failed ,the result is
- From: victorzou <victor.zou@xxxxxxxxxxx>
- Date: Thu, 16 Aug 2007 19:41:52 -0700
hi,all
My execute javascript function failed to get_script, please tell me
where is the bug in the following code fragment.
///////////////pIHTMLDocument2 is IHTMLDocument2 pointer
CComPtr<IDispatch> spScript;
CComPtr<IHTMLDocument> spDoc;
CComQIPtr<IHTMLWindow2> spWin;
hresult = pIHTMLDocument2->QueryInterface( IID_IHTMLDocument, (void
**) &spDoc);
if (FAILED(hresult)) return hresult;
hresult = spDoc->get_Script(&spScript);
//spScript is 0, hresult is -2147467262 not supported interface,
if (FAILED(hresult)) return hresult;
spWin = spScript;
VARIANT pvarRet = {0};
hresult = spWin->execScript((_bstr_t)strSrc, L"JavaScript",
&pvarRet );
//the function get_parentWindow failed too. what is the matter ,
pIHTMLDocument2->get_parentWindow( &spWin );
//spWin is 0.
thanks
victor.zou
.
- Follow-Ups:
- Re: IHTMLDocument get_script failed ,the result is
- From: Sheng Jiang[MVP]
- Re: IHTMLDocument get_script failed ,the result is
- Prev by Date: Re: sinkFileDownload event in a class derived from CHtmlView
- Next by Date: Re: Get WebBrowser from IDownloadManager.Download
- Previous by thread: Re: sinkFileDownload event in a class derived from CHtmlView
- Next by thread: Re: IHTMLDocument get_script failed ,the result is
- Index(es):