mistermassacre Posted December 9, 2010 Share Posted December 9, 2010 (edited) The script:#include <IE.au3> _IEErrorHandlerRegister() $oIE = _IEAttach("http://www.google.com", "URL") $oFrame = _IEFrameGetObjByName($oIE, "frame_that_doesnt_exist") MsgBox("","",@error)If I have an explorer window open to the google front page and I run this script then I can see the @error being set to 7 (no frames found) which is just as expected.However if I block google so the page wont load (for example if I setup IE6 to use a nonexistent proxy server), refresh explorer (gettingThe page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings page) and run the script it generates the following:>Running:(3.3.6.1):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\Administrator\Desktop\Dev\DASC\test.au3" --> COM Error Encountered in test.au3 ----> $IEComErrorScriptline = 713 ----> $IEComErrorNumberHex = 80020009 ----> $IEComErrorNumber = -2147352567 ----> $IEComErrorWinDescription = Access is denied. ----> $IEComErrorDescription = Access is denied. ----> $IEComErrorSource = ----> $IEComErrorHelpFile = C:\WINDOWS\system32\Mshtml.hlp ----> $IEComErrorHelpContext = 0 ----> $IEComErrorLastDllError = 0 --> COM Error Encountered in test.au3 ----> $IEComErrorScriptline = 2214 ----> $IEComErrorNumberHex = 80020009 ----> $IEComErrorNumber = -2147352567 ----> $IEComErrorWinDescription = Access is denied. ----> $IEComErrorDescription = Access is denied. ----> $IEComErrorSource = ----> $IEComErrorHelpFile = C:\WINDOWS\system32\Mshtml.hlp ----> $IEComErrorHelpContext = 0 ----> $IEComErrorLastDllError = 0 C:\Program Files\AutoIt3\Include\IE.au3 (2257) : ==> Object referenced outside a "With" statement.: Return SetError($_IEStatus_Success, $oTemp.GetElementsByTagName($s_TagName).length, $oTemp.GetElementsByTagName($s_TagName)) Return SetError($_IEStatus_Success, $oTemp.GetElementsByTagName($s_TagName)^ ERROR ->15:28:33 AutoIT3.exe ended.rc:1 >Exit code: 1 Time: 1.761I am completely mystified as to why this script generates a fatal error when trying to find a frame on a web page if that page is unavailable, am I missing something? Edited December 9, 2010 by mistermassacre Link to comment Share on other sites More sharing options...
mistermassacre Posted December 9, 2010 Author Share Posted December 9, 2010 I've tried the same thing using _IEGetFrameCollection($oIE, 1) instead of _IEFrameGetObjByName($oIE, "frame_that_doesnt_exist") and I get the proper @error code, the problem seems exclusive to _IEFrameGetObjByName. Link to comment Share on other sites More sharing options...
DaleHohm Posted December 9, 2010 Share Posted December 9, 2010 Ah, you caught me making a mistake I correct here in the forum all of the time... Line 800 is currently If $oFrame.name = $s_Name Then Return SetError($_IEStatus_Success, 0, $oTemp.frames($s_Name)) and needs to be If String($oFrame.name) = $s_Name Then Return SetError($_IEStatus_Success, 0, $oTemp.frames($s_Name)) You can update your copy if you like for now and I'll get the fix in the pipeline. 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...
mistermassacre Posted December 9, 2010 Author Share Posted December 9, 2010 I've made the change, thanks! 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