????? ????? ????? ?? ???? ?? ????? ?? ?????? WebBrowser

?????? ????????? ?????? ?????????
???? ???????: 180366 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

??????

???? ?????? WebBrowser ?????? ?????? ??? ????? DocumentComplete ??? ???????? ????? ???? ???. ????? ????? ???? ????? ??? ?? ??????? ???? ?????. ???? ??? ??????? ??????? ??????? ?? ????? ?? ??? ?? ???????? ?? ???? ?????? WebBrowser ????? ???? ???.

??????? ????

???? ?????? WebBrowser ??? ????? DocumentComplete ??? ???? ??????? ReadyState ?????? ?? ??? READYSTATE_COMPLETE. ???? ??? ??? ?? ???? ?????? WebBrowser ?????? ????? ???? ???. ???? ??? ??? ?????? ?????? ????? ??? ?????:
  • ?? ???? ???? ???? ??? ??? ?????? ??? ????? DocumentComplete ??? ????? ??? ????? ?? ???.
  • ?? ???? ?? ?????? ?????? ???? DocumentComplete ??????? ??? ????. ??? ?? ???? ??? ??? ????? ???? ??? ???? ??? ??? DownloadBegin ??? ??? DocumentComplete ???????.
  • ????? ????? DocumentComplete IDispatch * ????? ? ??? IDispatch ?????? (shdocvw) ??? ????? DocumentComplete.
  • ??? ???? ??????? ?????? DocumentComplete ?? ???????. ????? ?????? ??? ???? ????? ???????? ????? ??? ?????? ??? ???? ??????? IDispatch * ??? IDispatch ???? ?????? WebBrowser.

    Visual Basic ??? ?? ????? ???? ???? ?????? ??? ????????:
    Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object,
                                             URL As Variant)
       If (pDisp Is WebBrowser1.Object) Then
          Debug.Print "Web document is finished downloading"
       End If
    End Sub
    					
?????? ????? DocumentComplete ?? Visual C++ ????? ?? ??? ??? ????? ???? ??? ????? ???? ??????? ???????.

???? ?? ????? ????? ????? ??? ????? ??????? ???? ?????? WebBrowser.
  • ??? ??? ???? ?????? ???? ?????? WebBrowser ?? ???? CWnd/CView ??? ????? ??????? ?? 1 ??? 4.
  • ??? ??? ???? ?????? ???? ?????? WebBrowser ?? ???? CDialog/CFormView ??? ????? ?????? ?????? 4.
  • ??? ??? ?????? ??? CHtmlView ???????? ?? 6.0 Visual C++ ? ????? CHtmlView::DocumentComplete() ?? ???? ?????? 4? ??????? ??? m_pBrowserApp ??? CHtmlView ?????? ??? ???? ?????? WebBrowser.
  1. ????? ????? OnDocumentComplete ?? ??? ????? ???? CWnd/CView-??????:
    afx_msg void OnDocumentComplete(LPDISPATCH lpDisp,
                                    VARIANT FAR* URL);
    					
  2. ???? ?????? ???? ????? ?? ??? ??? ?????:
    DECLARE_EVENTSINK_MAP()
    					
  3. ?? ????? ??? (.cpp) ???? CWnd/CView-?????? ????? ???? ???? ?????:
    BEGIN_EVENTSINK_MAP(CYourView, CView)
       ON_EVENT(CWBTstView, ID_WEB_BROWSE, 259 /* DocumentComplete */,
                OnDocumentComplete, VTS_DISPATCH VTS_PVARIANT)
    END_EVENTSINK_MAP()
    					
  4. ????? ????? OnDocumentComplete:
    void CWBTstView::OnDocumentComplete(LPDISPATCH lpDisp,
                                        VARIANT FAR* URL)
    {
       IUnknown*  pUnk;
       LPDISPATCH lpWBDisp;
       HRESULT    hr;
    
       pUnk = m_webBrowser.GetControlUnknown();
       ASSERT(pUnk);
    
       hr = pUnk->QueryInterface(IID_IDispatch, (void**)&lpWBDisp);
       ASSERT(SUCCEEDED(hr));
    
       if (lpDisp == lpWBDisp )
       {
          // Top-level Window object, so document has been loaded
          TRACE("Web document is finished downloading\n");
       }
    
      lpWBDisp->Release();
    }
    					
???? ??? ??????? ??? ???? ???? ?????? WebBrowser ??? ???? ????? ???? ??????? ??????. ?? ??? ???? ?????? ???? ???? ???? ?? ??? DocumentComplete ??????? ???? ??? ?????? ?? ?????? "?" ?????? ??????? ??????. ??? ???? ??????? ???? ??? ????????? ??????.

???? ?????? WebBrowser ?????? ?????? ??????. ??? ???? ???? ?? ?????? ?????? ???? ???????? ?????? ??? ???????? ???? ???? ???? ????? ?? ?????? ???? ???? ???? ?????? ?????? ??? ??. ???? ????? ?? ????? ??? ?????? ?????? ??? ????. ????? ???? ???? ????? ????? DocumentComplete ?????? (???? ??? ???? ????). ???? ?? ???? DocumentComplete ???????? ?? ?????? ???? ?? ???? ??? ?? ?? ????? ???? ??????? ??????.

??? ??? ???? ?? ????? ?? ??????? ??????? ????? ?? ??? ?????????? ?? ??? ?? ???:
???? ?? ??? ???? ??????? IDispatch DocumentComplete ??? ??????? IDispatch ????? NavigateComplete2 ?????. ???? NavigateComplete2 ????? ???? ??????? ?????? ?? DocumentComplete ?????? ???? ??????? ?????? ????? ????? ?????? ?????? ??? ?????? ?? ??? ???? ?????? ?? ?????.
????? ??? ??? ????????? ???????? ?? C++:
LPDISPATCH glpDisp = NULL; // global LPDISPATCH, can also
                           // be of class scope

// NavigateComplete2 event
void CWebbrDlg::OnNavigateComplete2Explorer1(LPDISPATCH pDisp,
                                             VARIANT FAR* URL)
{
   // Check if glpDisp is NULL. If NULL, that means it is
   // the top level NavigateComplete2. Save the LPDISPATCH
   if (!glpDisp)
      glpDisp = pDisp;
}

void CWebbrDlg::OnDocumentCompleteExplorer1(LPDISPATCH pDisp,
                                            VARIANT FAR* URL)
{
   if (glpDisp && glpDisp == pDisp)
   {
      // if the LPDISPATCH are same, that means
      // it is the final DocumentComplete. Reset glpDisp
      TRACE("Document is done downloading");
      glpDisp = NULL;
   }
}
				

???????

???? ???????: 180366 - ????? ??? ??????: 13/????? ??????/1425 - ??????: 2.1
????? ???
  • Microsoft Internet Explorer 4.0 128-Bit Edition
  • Microsoft Internet Explorer 4.01 Service Pack 2
  • Microsoft Internet Explorer 5.0
  • Microsoft Internet Explorer 5.5
????? ??????: 
kbmt kbhowto KB180366 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????180366
????? ??????? ?? ????? ???? ?? ????? ???????
?? ????? ????? ?????? ???? ???? ???? ??? ??????? ??? ?? ? ?? ??? ??????? Microsoft ??? ????? ??? ??????? ????? ?????? ?????

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com