aiter Posted September 19, 2016 Posted September 19, 2016 I am running my compiled application as a console application and need to prevent any internal errors from being displayed as a gui message, but rather display it as a console message only. An example of such an error would be a bad array reference (out of bounds). Does anyone know how to do this or point me in the right direction?
AutoBert Posted September 19, 2016 Posted September 19, 2016 (edited) Have a look at: i never used it and i suggest avoid errors by good coding practice: https://www.autoitscript.com/wiki/Best_coding_practices Edited September 19, 2016 by AutoBert
aiter Posted September 19, 2016 Author Posted September 19, 2016 (edited) Thanks AutoBert. Having looked at it briefly, it still returns the error as a dialog though and not console output. Anything that returns an input response from my console application will cause it to hang because it is called within a framework that requires no input eg from framework Execute myapp capturing output myapp is the compiled autoit script. As soon as myapp contains an input response, myapp hangs within the framework. Thus the reason for no dialogs required, just a console output message saying something like 'An error occurred'. Edited September 19, 2016 by aiter spelling
aiter Posted September 19, 2016 Author Posted September 19, 2016 I need to create a real console application. That means no gui windows opening on internal errors. I compile with the CUI checkbox checked, but when I run the program from CMD and there is a internal error like array out of bounds, I get a gui window detailing the error. This is not a true console application then. How do I create a real console application which shows errors written to STDOUT? Any help appreciated. This problem could kill all my work on my project.
Moderators Melba23 Posted September 19, 2016 Moderators Posted September 19, 2016 aiter, Stick to just the one thread please. 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
aiter Posted September 20, 2016 Author Posted September 20, 2016 Can this be added as a enhancement or bug for autoit please. Compiled as CUI (console) means console output so output information to console and not as GUI output. Alternatively have another checkbox for the information 'Error output to console only?' Thank you amazing AutoIt developers in advance.
aiter Posted September 22, 2016 Author Posted September 22, 2016 How about wrapping the call to the program in c++ code ( or autoit code) which looks for that error window in a timer then if found, closes it and terminates the executable? Before it closes the window maybe it can get the text from the window to output as a console message after it closes that error window and closes the exe. Does this sound feasible and can anyone help with example code?
aiter Posted September 23, 2016 Author Posted September 23, 2016 Approach above worked. Thanks for all the help Much appreciated.
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