Home > Software engineering >  Help to IE binding DWebBrowserEvents2 events need to be continually call: : ObjectFromLresult browse
Help to IE binding DWebBrowserEvents2 events need to be continually call: : ObjectFromLresult browse

Time:10-06

UINT nMsg=: : RegisterWindowMessage (_T (" WM_HTML_GETOBJECT "));
LRESULT lRes.
: : SendMessageTimeout (hWnd, nMsg, 0 l, 0 l, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR) & amp; LRes);
CComPtrRetrieves the hr=: : ObjectFromLresult (lRes IID_IHTMLDocument2, 0, (void * *) & amp; PHTMLDocument2);
//the code must be normal circulation call browser can respond to events or jammed
if (! M_bIsBindEvent)
{
CComPtrHr=pHTMLDocument2 - & gt; (IHTMLWindow2 get_parentWindow (* *) & amp; PHTMLWindow2);
CComPtr SpServiceProv=NULL;
Hr=pHTMLWindow2 - & gt; QueryInterface (IID_IServiceProvider, (void * *) & amp; SpServiceProv);

CComPtrHr=spServiceProv - & gt; QueryService (SID_SWebBrowserApp IID_IWebBrowser2, (void * *) & amp; PWebBrowser2);

CComPtr PCPC;

PWebBrowser2 - & gt; QueryInterface (IID_IConnectionPointContainer, (void * *) & amp; PCPC);

PCPC - & gt; FindConnectionPoint (DIID_DWebBrowserEvents2, & amp; M_pCP);
If (NULL==m_pEventListener)
M_pEventListener=new IEEvent;
Hr=m_pCP - & gt; Advise (IUnknown (*) (void *) m_pEventListener, & amp; M_dwCookie);
M_bIsBindEvent=true;
}
Help to IE binding DWebBrowserEvents2 events need to be continually call: : ObjectFromLresult browser can run normally or browser jammed someone know why

CodePudding user response:

I don't know anyway,
Maybe baidu knows,

CodePudding user response:

reference 1st floor zhao4zhong1 response:
I don't know anyway,
Baidu know,
teacher mo joke I look at the others just binding a line side and I need to call here: : ObjectFromLresult (lRes IID_IHTMLDocument2, 0, (void * *) & amp; PHTMLDocument2); Can only be because is inside the thread

CodePudding user response:

Nine times out of ten,

CodePudding user response:

reference zhao4zhong1 reply: 3/f
is nine times out of ten,
IE binding on later can detect events behavior I suddenly turn off the IE now I am get IE element code will pop up a remote call failure errors like this how to solve ah if I use the WaitForSingleObject waiting thread technology close IE again IE will be stuck for a few seconds and then quit this also too not friendly processing experience in this field, please

CodePudding user response:

reference 4 floor chaoguodong response:
Quote: reference zhao4zhong1 reply: 3/f

Nine times out of ten is that
IE binding on later can detect events behavior I suddenly turn off the IE now I am get IE element code will pop up a remote call failure errors like this how to solve ah if I use the WaitForSingleObject waiting thread technology close IE IE will be jammed again a few seconds and then quit this also too not friendly, please have this aspect of the treatment experience of

In the http://www.codeproject.com search BHO try,

CodePudding user response:

Baidu search relevant keywords,
  • Related