EvAsion Posted October 9, 2007 Share Posted October 9, 2007 (edited) #include<IE.au3> #include<Process.au3> opt("WinTitleMatchMode",2) _RunDOS("start www.google.com") WinWaitActive("Internet") $newwin = WinGetHandle("","") $oIE2 = _IEAttach($newwin,"HWND") If @error then msgbox(0,"",@error & " "& @extended) msgbox(0,"","SUCCESS?????") $oIE2.visible = 0 Func onautoitexit() _IEQuit($oie2) EndFunc What am i doing wrong to fatally crash with the error: :\Program Files\AutoIt3\Include\IE.au3 (3018) : ==> The requested action with this object has failed.: Return HWnd($o_object.HWnd()) Return HWnd($o_object.HWnd()^ ERROR I can't see any errors on my part, so maybe a bug in IE.au3? Edited October 9, 2007 by EvAsion |-- Periodic Table --||-- Dynamic Class Timetable --||-- Navigation in Counter-Strike --| Link to comment Share on other sites More sharing options...
Blue_Drache Posted October 9, 2007 Share Posted October 9, 2007 #include<IE.au3> #include<Process.au3> opt("WinTitleMatchMode",2) _RunDOS("start www.google.com") WinWaitActive("Internet") $newwin = WinGetHandle("","") $oIE2 = _IEAttach($newwin,"HWND") If @error then msgbox(0,"",@error & " "& @extended) msgbox(0,"","SUCCESS?????") $oIE2.visible = 0 Func onautoitexit() _IEQuit($oie2) EndFunc What am i doing wrong to fatally crash with the error: :\Program Files\AutoIt3\Include\IE.au3 (3018) : ==> The requested action with this object has failed.: Return HWnd($o_object.HWnd()) Return HWnd($o_object.HWnd()^ ERROR I can't see any errors on my part, so maybe a bug in IE.au3?You're using a global variable in your onautoitexit() that hasn't been set with an IE Object. It's not IE.au3...it's PEBKAC. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Bert Posted October 9, 2007 Share Posted October 9, 2007 I haven't seen anyone reference that error in a while...though it is one of the most common errors there is.. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 9, 2007 Share Posted October 9, 2007 Could be a PICNIC issue... All seriousness aside, $newwin is probably being set to the wrong handle.Why not just use _IECreate(www.google.com, 1, 0)? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
DaleHohm Posted October 9, 2007 Share Posted October 9, 2007 The only way I can see to get this error is that there is a window open that appears to be a browser that really isn't. This iis in code that loops through the Shell.Application collection (includes IE and windows Explorer and variants). I currently check to see if window.Type and window.document.title are valid properties -- if they are, I assume we have an IE window and move blindly on, else I skip them. It is possible that you have some sort of exotic application running that is hosted in a shell window, has a type and document.title property but has no .hwnd property. Can you shed any light on this? You should also be able to move past the error by using _IEErrorHandlerRegister() 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...
EvAsion Posted October 10, 2007 Author Share Posted October 10, 2007 (edited) The only way I can see to get this error is that there is a window open that appears to be a browser that really isn't. This iis in code that loops through the Shell.Application collection (includes IE and windows Explorer and variants). I currently check to see if window.Type and window.document.title are valid properties -- if they are, I assume we have an IE window and move blindly on, else I skip them. It is possible that you have some sort of exotic application running that is hosted in a shell window, has a type and document.title property but has no .hwnd property. Can you shed any light on this? You should also be able to move past the error by using _IEErrorHandlerRegister() Dale Well I tested on my old computer just reformatted.. still the same errror. The Hex error number returned by IEErrorHandlerRegister() is 80020009 which is "The object referenced by the application no longer points to a valid object." if i'm not mistaken. So i guess its safe to assume that it is finding another window that has valid window.Type and window.document.title properties that is immediately closing before the function can complete? p.s. does this actually work for anyone? expandcollapse popup#include<IE.au3> #include<Process.au3> _IEErrorHandlerRegister ("MyErrFunc") opt("WinTitleMatchMode",2) _RunDOS("start www.google.com") WinWaitActive("Internet") $newwin = WinGetHandle("","") WinSetTitle($newwin,"","TEST HANDLE") $oIE2 = _IEAttach($newwin,"HWND") If @error then msgbox(0,"",@error & " "& @extended) msgbox(0,"","SUCCESS?????") $oIE2.visible = 0 Func onautoitexit() If IsDeclared("oie2") Then _IEQuit($oie2) EndFunc Func MyErrFunc() ; Important: the error object variable MUST be named $oIEErrorHandler $ErrorScriptline = $oIEErrorHandler.scriptline $ErrorNumber = $oIEErrorHandler.number $ErrorNumberHex = Hex($oIEErrorHandler.number, 8) $ErrorDescription = StringStripWS($oIEErrorHandler.description, 2) $ErrorWinDescription = StringStripWS($oIEErrorHandler.WinDescription, 2) $ErrorSource = $oIEErrorHandler.Source $ErrorHelpFile = $oIEErrorHandler.HelpFile $ErrorHelpContext = $oIEErrorHandler.HelpContext $ErrorLastDllError = $oIEErrorHandler.LastDllError $ErrorOutput = "" $ErrorOutput &= "--> COM Error Encountered in " & @ScriptName & @CR $ErrorOutput &= "----> $ErrorScriptline = " & $ErrorScriptline & @CR $ErrorOutput &= "----> $ErrorNumberHex = " & $ErrorNumberHex & @CR $ErrorOutput &= "----> $ErrorNumber = " & $ErrorNumber & @CR $ErrorOutput &= "----> $ErrorWinDescription = " & $ErrorWinDescription & @CR $ErrorOutput &= "----> $ErrorDescription = " & $ErrorDescription & @CR $ErrorOutput &= "----> $ErrorSource = " & $ErrorSource & @CR $ErrorOutput &= "----> $ErrorHelpFile = " & $ErrorHelpFile & @CR $ErrorOutput &= "----> $ErrorHelpContext = " & $ErrorHelpContext & @CR $ErrorOutput &= "----> $ErrorLastDllError = " & $ErrorLastDllError MsgBox(0,"COM Error", $ErrorOutput) SetError(1) Return EndFunc ;==>MyErrFunc Edit: $newwin returns the correct handle Edited October 10, 2007 by EvAsion |-- Periodic Table --||-- Dynamic Class Timetable --||-- Navigation in Counter-Strike --| Link to comment Share on other sites More sharing options...
DaleHohm Posted October 10, 2007 Share Posted October 10, 2007 Your previous code worked for me... Another explanation is taht it is finding a valid browser window that gets deleted in the milliseconds between lines of code in _IEAttach. Are you running Vista by chance? 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...
EvAsion Posted October 11, 2007 Author Share Posted October 11, 2007 Indeed i am running vista. Do you think thats the source of the problem? |-- Periodic Table --||-- Dynamic Class Timetable --||-- Navigation in Counter-Strike --| Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 11, 2007 Share Posted October 11, 2007 Indeed i am running vista. Do you think thats the source of the problem?Always. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
EvAsion Posted October 11, 2007 Author Share Posted October 11, 2007 Always. ahahahaso any workarounds fixes etc? |-- Periodic Table --||-- Dynamic Class Timetable --||-- Navigation in Counter-Strike --| Link to comment Share on other sites More sharing options...
DaleHohm Posted October 11, 2007 Share Posted October 11, 2007 (edited) There is a discussion here: http://www.autoitscript.com/forum/index.ph...20&hl=vistaNew security in Windows Vista causes a new browser window to be created when a browser is instructed to navigate to a URL in a different security zone. This occurs as well with the initial creation and navigation initiated with _IECreate. The new window is a new browser instance and the previous browser object variable no longer points to it. There are several workarounds: Note: IE8 has fixed this "bug". The old, desired behavior is restored!Upgrade to IE8 -- they finally fixed this issue. For earlier versions...add #RequireAdmin to your code (this is required even if the account is part of the Administrator's Group and will propmt for credentials if necessary),use _IEAttach to connect to the new browser windowadd the target website to the Trusted Sites security zone in IE,turn off "Protected Mode" in IE, ordisable UAC.Care must be taken to understand the implications of disabling IE security features when accessing untrusted sites.Very frustrating issue.DaleEdit: added #RequireAdminNote: issues are documented in the helpfile for 3.2.12.x in the related function documentation Edited April 22, 2009 by DaleHohm 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...
tradertt Posted December 6, 2007 Share Posted December 6, 2007 Thank you. Perhaps I will try the #RequireAdmin in the beginning of the script to see if it works. Hopefully so.. Vista sucks Free Flash Games Online | Car Modifications Articles | Free Arcade Games Online Link to comment Share on other sites More sharing options...
DaleHohm Posted January 14, 2008 Share Posted January 14, 2008 just because you cant work with it, doesnt mean it sucks..for me, i never want back to XP ever.Valid or not, dropping your opinion into a dormant thread is not a good idea. Hopefully everyone ignores this, but the only other possible outcome is starting yet another debate about the merits of Vista/XP and there are plenty of other places you can participate in one of those.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