标签:style blog class c code tar
IHTMLDocument2 *pDoc; IHTMLElementCollection *objAllElement; HRESULT hr; CoInitialize(NULL); hr = CoCreateInstance(CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER, IID_IHTMLDocument2, (void**)&pDoc); SAFEARRAY* psa = SafeArrayCreateVector(VT_VARIANT, 0, 1); VARIANT *param; bstr_t bsData = (LPCTSTR)pBuffer;//wchar_t *pBuffer;页面源码 hr = SafeArrayAccessData(psa, (LPVOID*)¶m); param->vt = VT_BSTR; param->bstrVal = (BSTR)bsData; hr = pDoc->write(psa); hr = pDoc->close(); pDoc->get_all(&objAllElement);
至此html文件已经载入HTMLDocument2,解析代码参考上一篇:《利用WebBrowser控件实现百度自动搜索》
HTML文本载入HTMLDocument2进行解析,布布扣,bubuko.com
标签:style blog class c code tar
原文地址:http://blog.csdn.net/one_in_one/article/details/26375081