3,245
社区成员
发帖
与我相关
我的任务
分享
CoInitialize(NULL);
CComPtr<IPersistFile> pFile;
HRESULT hr;
hr=pFile.CoCreateInstance(CLSID_HTMLDocument);
if (!SUCCEEDED(hr))
{
}
if(!pFile)
{
}
hr=pFile->Load(L"E:\\2.htm", STGM_READ);
if (!SUCCEEDED(hr))
{
}
CComQIPtr<IHTMLDocument2> pDoc(pFile);
CComQIPtr<IHTMLElementCollection> pColl;
hr=pDoc->get_all(&pColl);
if (!SUCCEEDED(hr))
{
}
long count=-1;
hr=pColl->get_length(&count);
if (!SUCCEEDED(hr))
{
}
long elementCount=count;