Autoseek Posted November 22, 2014 Share Posted November 22, 2014 Hi, ok, >digging this out. I got this to work for me. Would someone be able to point me into the right direction for understanding the error handling of $oxmlhttp.Open ("GET", $url2, False)? It is my understanding that this is the major part of the retrieval, and if the retrieval does not work, I would like to understand why I have looked here, https://www.autoitscript.com/autoit3/docs/intro/ComRef.htm, under "COM Error Handling", but I am not getting an error when trying to download (for provoking an error) from a non-existing location. Perhaps I am not even doing something meaningful, when trying to catch an error of $oxmlhttp.Open, but I am afraid that I am lacking too many basics here to find out. If anybody can suggest the error handling here, that would make me very happy Cheers Autoseek Link to comment Share on other sites More sharing options...
Jfish Posted November 22, 2014 Share Posted November 22, 2014 (edited) I would first test to make sure you object is creating correctly (that is an old example you are using). I use : dim $winHttpReq = ObjCreate("WinHttp.WinHttpRequest.5.1") ; create an instance of the winhttp object See the help file for how to test if you are creating the object properly (I modified it a bit ... untested): If Not @error Then MsgBox($MB_SYSTEMMODAL, "ObjCreate Test", "ObjCreate() successful !") Else MsgBox($MB_SYSTEMMODAL, "ObjCreate Test", "Failed to create Object. Error code: " & Hex(@error, 8)) EndIf Also, if you are just trying to get a file - you should look at the InetGet function. Edited November 22, 2014 by Jfish Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
Autoseek Posted November 22, 2014 Author Share Posted November 22, 2014 Hi, Thank you for that "pointer on the side" to the InetGet function. I have rewritten everything based on InetGet and the examples provided there. It works smoothly. Great! Cheers Autoseek Link to comment Share on other sites More sharing options...
water Posted November 22, 2014 Share Posted November 22, 2014 Adding this lines of code at the top of your script will grab all COM errors (if any) and display them in a separate window: #include <Debug.au3> _DebugSetup() _DebugCOMError() My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Autoseek Posted November 22, 2014 Author Share Posted November 22, 2014 Hi, Thank you. Very interesting. Didn't know it's so easy to install an error handler Cheers Autoseek Link to comment Share on other sites More sharing options...
water Posted November 22, 2014 Share Posted November 22, 2014 Ease of use was what I had in mind when I wrote this function My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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