SAFEARRAY*   psa   =   SafeArrayCreateVector(VT_VARIANT,   0,   1);   
  VARIANT   *param;   
  bstr_t   bsData   =   (LPCTSTR)lpszHTMLCode;   
  hr   =     SafeArrayAccessData(psa,   (LPVOID*)&param);   
  param->vt   =   VT_BSTR;   
  param->bstrVal   =   (BSTR)bsData;   
  hr   =   pDoc->write(psa);//   就是在这儿出错   
  hr   =   pDoc->close();   
  SafeArrayDestroy(psa);   

解决方案 »

  1.   

    谢谢楼上的,我对mfc一点也不熟悉,刚接触。 
    spBrowser->ReadyState ;
     error C2039: 'ReadyState' : is not a member of '_NoAddRefReleaseOnCComPtr<struct IWebBrowser2>'
      

  2.   

    pDoc == IHTMLDocument2IHTMLDocument2::get_readyState Method--------------------------------------------------------------------------------Retrieves the current status of an object being downloaded. SyntaxHRESULT get_readyState(
        BSTR *p
    );Parametersp 
    Address of a string variable that receives the download status of the object. It can be one of these strings: complete  The object is completely loaded.  
    interactive  The object can be interacted with even though it is not fully loaded.  
    loading  The object is currently being loaded.  
    unitialized  The object is not created. This value usually means that the object is being downloaded.  Return ValueReturns S_OK if successful, or an error value otherwise. 
      

  3.   

    http://code.google.com/p/iamduyu/downloads/list
    这里有我写的一个例子程序,用到了document.write和safearray