已知IHTMLDocument2的接口,怎么往里面插入一个DIV,然后再往DIV里插入IMG???IHTMLElement *pBodyElement;
hr=pDoc2->get_body( &pBodyElement); //得到Body标记pBodyElement->insertAdjacentHTML(L"beforeBegin",CComBSTR(_T("<div><img src='http://www.baidu.com/img/logo.gif'></img></div>")));这样执行后,src='';变成空的了,为什么???
hr=pDoc2->get_body( &pBodyElement); //得到Body标记pBodyElement->insertAdjacentHTML(L"beforeBegin",CComBSTR(_T("<div><img src='http://www.baidu.com/img/logo.gif'></img></div>")));这样执行后,src='';变成空的了,为什么???
HRESULT insertAdjacentElement( BSTR where,
IHTMLElement *insertedElement,
IHTMLElement **inserted
);
看到了把,传入的接口,返回的是接口指针,
先创建你要插入元素的接口对象