首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

IHTMLDocument3调用getElementById跟为什么IHTMLElement *pElem得到是空的

2012-12-17 
IHTMLDocument3调用getElementById和为什么IHTMLElement *pElem得到是空的IHTMLDocument3调用getElementBy

IHTMLDocument3调用getElementById和为什么IHTMLElement *pElem得到是空的
IHTMLDocument3调用getElementById和为什么IHTMLElement *pElem得到是空的
如:
         HRESULT hr;
BSTR bname;
         CComBSTR s;
         s=L"DIV";
CComQIPtr<IHTMLDocument2> pIHTMLDocument2;
CComQIPtr<IDispatch> spDispatch1;
IHTMLElement *pElem;
  
        spDispatch1=m_myie.get_Document();
pIHTMLDocument2=spDispatch1;

        CComQIPtr <IHTMLDocument3> pDoc3;  
    hr =pIHTMLDocument2->QueryInterface(IID_IHTMLDocument3,(void**)&pDoc3);  
    hr = pDoc3->getElementById(s,&pElem); 

    if (SUCCEEDED(hr) && pElem != NULL)
    {
 
     } 
pElem都是反回空的不知道为什么
[解决办法]
没人............
[解决办法]
友情帮顶,友情帮顶
[解决办法]
顶................
[解决办法]
gu up.....
[解决办法]
我也是!!!没人回答啊.
[解决办法]
s=L"DIV";
s是id吗?晕

热点排行