Jump to content

Console application - internal autoit error trap


aiter
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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 by aiter
spelling
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Moderators

aiter,

Stick to just the one thread please.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...