// The parameters for this DISPID:
// [0]: Object expression that resolves to the objects in the Applies To list.
// [1]: Object that specifies the top-level or frame WebBrowser object corresponding to the event.
// [2]: String that specifies the URL, Universal Naming Convention (UNC) file name, or pointer to an item identifier list (PIDL) of the loaded document.
case DISPID_DOCUMENTCOMPLETE:
{
IDispatch *pDisp1 = NULL;
// Get the container
HRESULT hr = mWebBrowser2->QueryInterface(IID_IDispatch,(void**)&pDisp1);
_ASSERT(SUCCEEDED(hr));
READYSTATE m_ReadyState;
mWebBrowser2->get_ReadyState(&m_ReadyState);
hehe,自己解决了!!!
// The parameters for this DISPID:
// [0]: URL navigated to - VT_BYREF|VT_VARIANT
// [1]: An object that evaluates to the top-level or frame
// WebBrowser object corresponding to the event
//
case DISPID_NAVIGATECOMPLETE2:
{
IDispatch *pDisp1 = NULL;
// Get the container
HRESULT hr = m_spWebBrowser2->QueryInterface(IID_IDispatch,(void**)&pDisp1);
_ASSERT(SUCCEEDED(hr));
if(pDispParams->rgvarg[1].pdispVal == pDisp1) // if(!glpDisp)
{
glpDisp = pDisp1;
CComVariant varURL(*pDispParams->rgvarg[0].pvarVal);
strEventInfo<<"NavigateComplete2:"<<OLE2T(varURL.bstrVal)<<ends;
}
}
// The parameters for this DISPID:
// [0]: Object expression that resolves to the objects in the Applies To list.
// [1]: Object that specifies the top-level or frame WebBrowser object corresponding to the event.
// [2]: String that specifies the URL, Universal Naming Convention (UNC) file name, or pointer to an item identifier list (PIDL) of the loaded document.
case DISPID_DOCUMENTCOMPLETE:
{
if(glpDisp && glpDisp == pDispParams->rgvarg[1].pdispVal )
{
// if the IDispatch are same, that means
// it is the final DocumentComplete. Reset glpDisp