if(SUCCEEDED(hr))
{
CComPtr<IDispatch> spDisp;
CComQIPtr<IHTMLWindow2> spWin; spDoc->get_Script(&spDisp);
spWin=spDisp;
spWin->get_document(&spDoc.p);
IHTMLElementCollection* pCollection;
spDoc->get_all(&pCollection); LONG celem;
hr=pCollection->get_length(&celem);
if (SUCCEEDED(hr))
{
for(int i=0;i<celem;i++)
{
VARIANT varIndex, var2;
VariantInit(&varIndex);
VariantInit(&var2); varIndex.vt=VT_I4;
varIndex.lVal=i; CComPtr<IDispatch> pDisp;
pCollection->item(varIndex,var2,&pDisp);
IHTMLElement* pElem;
pDisp->QueryInterface(IID_IHTMLElement,(LPVOID*)&pElem); CComBSTR tagName;
pElem->get_tagName(&tagName);
CString str =(CString)tagName;
str.MakeUpper();
if(str=="TABLE")
{我依葫芦画瓢地做到这一步,下面再怎么做呢。
{
CComPtr<IDispatch> spDisp;
CComQIPtr<IHTMLWindow2> spWin; spDoc->get_Script(&spDisp);
spWin=spDisp;
spWin->get_document(&spDoc.p);
IHTMLElementCollection* pCollection;
spDoc->get_all(&pCollection); LONG celem;
hr=pCollection->get_length(&celem);
if (SUCCEEDED(hr))
{
for(int i=0;i<celem;i++)
{
VARIANT varIndex, var2;
VariantInit(&varIndex);
VariantInit(&var2); varIndex.vt=VT_I4;
varIndex.lVal=i; CComPtr<IDispatch> pDisp;
pCollection->item(varIndex,var2,&pDisp);
IHTMLElement* pElem;
pDisp->QueryInterface(IID_IHTMLElement,(LPVOID*)&pElem); CComBSTR tagName;
pElem->get_tagName(&tagName);
CString str =(CString)tagName;
str.MakeUpper();
if(str=="TABLE")
{我依葫芦画瓢地做到这一步,下面再怎么做呢。
http://topic.csdn.net/t/20050201/11/3767915.html
看看IHtmlTable和IHTMLTableCell接口