IHTMLDocument get_script failed ,the result is



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

.