hijolin 0 Posted May 16, 2010 open new windows error. http://support.microsoft.com/kb/184876 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> _IEErrorHandlerRegister (" ie8 ") $oIE = _IECreateEmbedded () $EventObject=ObjEvent($oIE,"IEEvent_","DWebBrowserEvents2") if @error then Msgbox(0,"AutoIt COM Test", _ "ObjEvent: Can't use event interface 'DWebBrowserEvents'. Error code: " & hex(@error,8)) exit endif $GUI = GUICreate("",500,500) $GUIActiveX = GUICtrlCreateObj($oIE,0,0,500,500) _IENavigate ($oIE, "http://www.google.com",0) GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func IEEvent_NewWindow2($ppDisp,$Cancel) ; Error <---- ; http://support.microsoft.com/kb/184876 $Cancel = True EndFunc Share this post Link to post Share on other sites
Juvigy 49 Posted May 17, 2010 This works for me: Func IEEvent_NewWindow2($oIE, $Cancel = False) EndFunc Share this post Link to post Share on other sites
hijolin 0 Posted May 18, 2010 This works for me: Func IEEvent_NewWindow2($oIE, $Cancel = False) EndFunc But still error Share this post Link to post Share on other sites
DaleHohm 65 Posted May 24, 2010 What error? Please describe your issue in words and sentences. That said, you will not be able to use AutoIt COM event handing to cancel an operation such as this. AutoIt does not handle COM errors synchroneously, but rather can be though of as being informed of events instead of placing itself in the event processing flow. By the time you try to act on the event, the flow has already moved past it. Also note that the COM routines do not handle byRef values. You'll need to inject javascript into the page to do what you want in this case. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curlMSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object modelAutomate input type=file (Related)Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better?IE.au3 issues with Vista - WorkaroundsSciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Share this post Link to post Share on other sites