18,356
社区成员
发帖
与我相关
我的任务
分享
void CDlgSeekDlg::ShowWeb(CString str)
{
str.Replace('\\','/');
// m_IE.Navigate(str, 0, 0, 0, 0); //用这个方法都正常,现在用的是如下方法
m_IE.Navigate(L"about::black", NULL, NULL, NULL, NULL);
CComQIPtr<IHTMLDocument2> spDoc = m_IE.get_Document();
CComSafeArray<VARIANT> arrHtml(1);
// arrHtml[0] = L"<html><a href=\"http://www.yijiku.com\">www.baidu.com</a></html>";
arrHtml[0] = str;
spDoc->write(arrHtml);
spDoc->close();
}
m_IE.Stop();//加这句试试看
m_IE.Navigate(...);
或参考:MFCIE: Demonstrates the MFC CHtmlView and CReBar Classes