通过IHTMLDocument2 接口只能得到body 源码,有设呢方法可以到的head 的源码? IHTMLDocument2 好像只能得到body源码,IHTMLDocument2能得到head源码吗?或者其他方法得到! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 void xxxxxxxx_html::bianli_all(IHTMLDocument2 *pdd,CString tagetName){ try {CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> pd2=pdd;if(!pd2)return;CComPtr<IHTMLElement> pli=NULL;CString sa;BSTR bs=NULL; //***************************************************CComPtr<IHTMLElementCollection> pecel=NULL; if(pd2->get_all(&pecel)==S_OK&&pecel.p!=NULL){ CComPtr<IDispatch> pDisp=NULL; if(pecel->tags(COleVariant(tagetName),&pDisp)==S_OK&&pDisp!=NULL){ LONG celem; CComQIPtr<IHTMLElementCollection, &IID_IHTMLElementCollection> pecel2(pDisp); if(pecel2!=NULL&&pecel2->get_length(&celem)==S_OK){ //CString kkj;kkj.Format("%ld",celem);//MessageBox(kkj,"提示");//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&for(int i=0;i<celem;i++){ if(pecel2->item(CComVariant(i),CComVariant(i),&pDisp)!=S_OK||pDisp==NULL)continue;if(pDisp->QueryInterface(&pli)!=S_OK||pli==NULL)continue;if(pli->get_innerHTML(&bs)!=S_OK)continue;sa=(CString)bs;//**************//*********//***********}//for} if(pecel2)pecel2.Release();}} if(pecel)pecel.Release(); if(pli)pli.Release(); if(pd2)pd2.Release();if(p)p.Release();if(bs)::SysFreeString(bs); } catch(...){}} vc项目中的窗体创建的问题 如何判断 CFONT 是否已经可以使用 VC ADO 连接ORACLE winpcap获得ip报头的地址有错误 高分求购:串口拦截数据程序源代码 颜色转换后有点模糊,问题在哪? 如何控制一个已经运行的程序 以暂停方式新创建的进程,能根据进程句柄获得其可执行文件路径吗? 如何同时创建多个视图. 帮忙帮忙!!(有劳个位高手) 最近才开始接触WIN32 SDK编程问一个问题 evc 点击按钮A后,开始执行事件中的程序。此时,按钮A和按钮B变灰,不再响应click事件
try
{
CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> pd2=pdd;
if(!pd2)return;
CComPtr<IHTMLElement> pli=NULL;
CString sa;
BSTR bs=NULL;
//***************************************************
CComPtr<IHTMLElementCollection> pecel=NULL;
if(pd2->get_all(&pecel)==S_OK&&pecel.p!=NULL)
{
CComPtr<IDispatch> pDisp=NULL;
if(pecel->tags(COleVariant(tagetName),&pDisp)==S_OK&&pDisp!=NULL)
{
LONG celem;
CComQIPtr<IHTMLElementCollection, &IID_IHTMLElementCollection> pecel2(pDisp);
if(pecel2!=NULL&&pecel2->get_length(&celem)==S_OK)
{
//CString kkj;kkj.Format("%ld",celem);
//MessageBox(kkj,"提示");//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&for(int i=0;i<celem;i++)
{
if(pecel2->item(CComVariant(i),CComVariant(i),&pDisp)!=S_OK||pDisp==NULL)continue;
if(pDisp->QueryInterface(&pli)!=S_OK||pli==NULL)continue;
if(pli->get_innerHTML(&bs)!=S_OK)continue;
sa=(CString)bs;//**************
//*********//***********
}//for
}
if(pecel2)pecel2.Release();
}
}
if(pecel)pecel.Release();
if(pli)pli.Release();
if(pd2)pd2.Release();
if(p)p.Release();
if(bs)::SysFreeString(bs);
}
catch(...){}
}