ZiggyStardust Posted July 22, 2012 Posted July 22, 2012 I have a script that will (by way of user interaction) generate the Windows standard "autoit has encountered a error and needs to close... send, don't send" and the program terminates. Is there any way around this (other then shooting the user)? Utlimately what I would like to do is re-run the program if it crashes or better still keep this from happening. Thanks!
BrewManNH Posted July 22, 2012 Posted July 22, 2012 without seeing the script, there's no way to answer this. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
ZiggyStardust Posted July 22, 2012 Author Posted July 22, 2012 I can tell you what triggers it. I do I/O to a virtual COMPort (USB). If I pull the USB cable out of the computer while the script is running it generates the Windows crash. "autoit.exe has encountered a problem and needs to close. We are sorry about the inconvenience". Since this is a Windows Error is there any way I can control it?
water Posted July 22, 2012 Posted July 22, 2012 What BrewManNH meant is: We need some AutoIt code to see how you do it and if there is anything we can do about the problem. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Moderators Melba23 Posted July 22, 2012 Moderators Posted July 22, 2012 ZiggyStardust, You are already have a thread open on this subject - why have you started another? And you know what the end result will be if you keep on doing this. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
ZiggyStardust Posted July 22, 2012 Author Posted July 22, 2012 Here is the lowest level I/O I do: Func CommSend($SendStr) $Received = "" _CommSendString($SendStr & @CR, 0) If @error <> 0 Then $CommError = True WriteLog("Error sending " & $Sendstr) Return EndIf $Received = _CommGetLine(">", 100, 2000); Should get back speed If @error <> 0 Then $CommError = True WriteLog("Error receiving " & $Received) Return EndIf $Received = StringStripWS($Received, 8) ; Strip Carriage Returns EndFunc
czardas Posted July 22, 2012 Posted July 22, 2012 I presume the errors are documented in the UDF. Try and catch them and see if you can throw an exception just before it crashes. operator64 ArrayWorkshop
water Posted July 22, 2012 Posted July 22, 2012 Do you compile the script for 32 bit? The UDF states that "the dll is 32 bit so it will not work with a 64 bit app" My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
ZiggyStardust Posted July 23, 2012 Author Posted July 23, 2012 Just thinking out loud. Since this exception can't be handled would anyone see a problem with running yet a second script which would do nothing more than make sure the first script was running. If the second script crashed with the exception the first script would simply re-run the second script. I know from experience that, as a rule, when you get one of these exception errors you might as well reboot because nothing is going to work right. Any other input on how I can handle this?
water Posted July 23, 2012 Posted July 23, 2012 Which version of AutoIt do you use? The latest beta has a changed way of handling COM errors - a crash should never again occur caused by a COM error if you handle @error properly. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
ZiggyStardust Posted July 23, 2012 Author Posted July 23, 2012 (edited) 3.3.8.1? How do you tell for sure? I am a little fuzzy about what is classified as a "COM" error. I tried putting in a COM Error Handler yesterday and unplugging the USB cable. It blew right past the COM Error Handler and crashed. You really think the beta would catch this unhandled exception error and let me recover from it? Google has failed me! What is the definition of a "COM Error". I am especially curious as to what the COM stands for. All I can find is that it is a generic term for a Windows crash..... Edited July 23, 2012 by ZiggyStardust
water Posted July 24, 2012 Posted July 24, 2012 If the COM error handler doesn't catch the error situation then I'm out of ideas My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
ZiggyStardust Posted July 24, 2012 Author Posted July 24, 2012 Thanks Water. Per your suggestion I installed Beta 3.9.4.0 and there was even a COM Error Handler test. The test ran and caught the COM Error. I put the Error Handler in my script and it blew right past it and crashed. I am out of things to try. I left a post on the CommMG UDF thread. Maybe a suggestion will turn up. Your suggestions and input were greatly appreciated!
water Posted July 24, 2012 Posted July 24, 2012 When the script crashes even when using a COM error handler and the latest beta then COM isn't used by the UDF or is used in a way so that AutoIt can't handle the error (I'm no specialist in this area - that's how I understand it). I hope you get some answer on the CommMg thread. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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