代码如下:IHTMLElement *pElement = NULL;
m_pHtmlDocument->elementFromPoint(pt.x, pt.y, &pElement);IHTMLElement2 *pElem2 = NULL;
_bstr_t bstrVal;
HRESULT hr = 0;
pElement->QueryInterface(IID_IHTMLElement2, (void**)&pElem2);    //得到IHTMLElement2接口
hr = pElem2->getAdjacentText(_T("beforeBegin"), &bstrVal.GetBSTR());
我用百度首页做的测试,pt为“贴吧”的所在位置,正常情况下bstrVal应该返回“网页”才对,但是现在
hr返回S_OK,而bstrVal返回的是空值。求高人指点,谢谢!