0

我使用 mfc 主动 x 控件并导航 url。因为 url 是 https:"..." 所以我无法获取页面的内容。

以下是我使用的代码。

m_cstrURL = L"https:\\......" like that

m_webBrowser.Navigate(m_cstrURL.operator LPCWSTR(), NULL, NULL, NULL, NULL);    

IHTMLDocument2 *document = (IHTMLDocument2 *)m_webBrowser.get_Document() ; 

    HRESULT hresult = document->get_body(&iSource);

    if(iSource)
    {
        iSource->get_innerText(&btsrSource); 
        strSource=btsrSource.m_str; 
    }

所以如果 url 包含 https: my get_bodyfailed. 我的意思是 isource 为空..

4

1 回答 1

0

是的,Gabor,写错了。无论如何,谢谢你参加我的问题。我刚刚找到了解决方案。我使用了错误的事件处理程序,因为 NavigateComplete2 而我使用了 DocumentComplete。这是工作....

于 2014-11-21T15:21:17.277 回答