请大家看看代码写的有哪些错误。
int CWlyGView::ShowHtml(CString strHtml){ CComPtr<IHTMLDocument2> pDoc; CComPtr<IHTMLElementCollection> sphtmlAll; CComPtr<IHTMLScriptElement> spObject; CComPtr<IDispatch> spDisp; CComVariant varName; CComVariant varIndex; [color=#FF0000]if(FAILED((IHTMLDocument2*)this->GetHtmlDocument(),(&pDoc)) || pDoc==NULL) return 0;[/color] CComQIPtr<IPersistStreamInit> spPersistStream(pDoc); if(spPersistStream==NULL) return 0; LPTSTR lpMem = (LPTSTR)::GlobalAlloc( GPTR,strHtml.GetLength()+1); lstrcpy(lpMem,strHtml.GetBuffer()); CComPtr<IStream>spStream; CreateStreamOnHGlobal( lpMem, TRUE, &spStream ); // 初始化后,装载显示 spPersistStream->InitNew(); spPersistStream->Load(spStream ); return 0;}