hijolin Posted May 16, 2010 Share 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 Link to comment Share on other sites More sharing options...
Juvigy Posted May 17, 2010 Share Posted May 17, 2010 This works for me: Func IEEvent_NewWindow2($oIE, $Cancel = False) EndFunc Link to comment Share on other sites More sharing options...
hijolin Posted May 18, 2010 Author Share Posted May 18, 2010 This works for me: Func IEEvent_NewWindow2($oIE, $Cancel = False) EndFunc But still error Link to comment Share on other sites More sharing options...
hijolin Posted May 24, 2010 Author Share Posted May 24, 2010 Help! Link to comment Share on other sites More sharing options...
DaleHohm Posted May 24, 2010 Share 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, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now