Home > Software engineering >  Why didn't the script execution execScript function? Not to
Why didn't the script execution execScript function? Not to

Time:11-07

 

IDispatch * dis=0;
IHTMLDocument2 * doc=0;
Ele IHTMLElement *=0;
IHTMLWindow2 * win=0;
IHTMLEventObj * eve=0;
The VARIANT varRet;

WebBrowser1 - & gt; WebBrowser2 - & gt; The get_Document (& amp; Dis);
Dis - & gt; QueryInterface (IID_IHTMLDocument2, (void * *) & amp; Doc);
Doc - & gt; Get_parentWindow (& amp; Win);
Win - & gt; ExecScript (L "alert (" nihaoma? \ ");" , L "javascript", & amp; VarRet);
//win - & gt; Get_event (& amp; Eve);
//eve - & gt; Get_srcElement (& amp; Ele);


Code execution, but doesn't work, is this why? Win is not zero, right,

CodePudding user response:

This call does not support IE11 mode, have to eval
This window object without exposure method, after GetDispID Invoke yourself,

CodePudding user response:

The child thread is invalid, effective in the main thread
  • Related