在内嵌WebBrowser控件中打开网页,然后获取该网页的表单数据。但是一直没成功,问题出在pElementCollection->get_length(&p)时总返回0,想到应该是网页没加载好就执行了该语句,所以失败了。请问大侠,该在什么时候获取呢?  求详细。多谢!WebBrowser表单数据

解决方案 »

  1.   

    DocumentComplete中,不过如果网页里有多个frame的话,要注意的有
    In pages with no frames, this event fires one time after loading is complete.
    In pages where multiple frames are loaded, this event fires for each frame where the DWebBrowserEvents2::DownloadBegin event has fired
    This event pDisp parameter is the same as the IDispatch interface pointer of the frame in which this event fires. 
    In the loading process, the highest level frame, which is not necessarily the top-level frame, fires the final DWebBrowserEvents2::DocumentComplete event. At this time, the pDisp parameter is the same as the IDispatch interface pointer of the highest level frame
      

  2.   

    OnDocumentComplete, OnDownloadComplete