<html><DIV id=test>abc</DIV></html>怎样用IHTMLDocument获得test中的string .谢谢.顺便写一下代码.

解决方案 »

  1.   

    IHTMLDivElement Interface
    This interface is used with the IHTMLElement::className property to represent different kinds of containers.
      

  2.   

    but I don't know how to use it?
      

  3.   

    我也一样,不知道怎样得到这个IHTMLDivElement接口
      

  4.   

    去看看MSDN里面的文章Reusing MSHTML
      

  5.   

    MSDN Home >  MSDN Library >  Programming and Reusing the Browser >  Overviews/Tutorials  
    Handling HTML Element Events  
     
      

  6.   

    总算自己搞明白了:这样获得
    LPDISPATCH  lpDispatch;
    lpDispatch = CWebBrowser2.GetDocument();if (lpDispatch)
    {
      HRESULT hr = lpDispatch->QueryInterface(IID_IHTMLDivElement, (LPVOID*)&m_pHTMLDivElement);
    lpDispatch->Release();
    ASSERT(SUCCEEDED(hr));
    }