Jump to content
Excelsior Forums
kuisma

Console if and only if available (windows)

Recommended Posts

I'm writing a windows application possible to run both command line and with GUI. Invoked without parameters, it uses a GUI, else it assumes command line usage.

The problem is that if I choose "Hide console window", I do not get any stdio/stderr in the command window if invoked command line, and if I do not hide the console, it will be opened even i GUI mode.

Can I get Jet to use stdio to the console if available, but never self open a new console window?

Share this post


Link to post
Share on other sites

I'm writing a windows application possible to run both command line and with GUI. Invoked without parameters, it uses a GUI, else it assumes command line usage.

The problem is that if I choose "Hide console window", I do not get any stdio/stderr in the command window if invoked command line, and if I do not hide the console, it will be opened even i GUI mode.

Can I get Jet to use stdio to the console if available, but never self open a new console window?

Sorry but Excelsior JET does not support such a feature. Whether process has the attached console window is specified in properties of executable on MS Windows OS.

Share this post


Link to post
Share on other sites

Sorry but Excelsior JET does not support such a feature. Whether process has the attached console window is specified in properties of executable on MS Windows OS.

Windows never ceases to amaze me, but not in a good way.

Thank you for your reply. It was exactly what I needed to isolate the problem. Seems as Windows (CMD.EXE?) detaches GUI-enabled applications from the console stdio. In unix-speak something like:

$ program 2>&1 1>/dev/null </dev/null &

Fortunately, it still respects redirects, so a JET application with hidden console will still produce output on stdout using a small workaround:

A:\DOS> JET-APPLICATION-WITH-HIDDEN-CONSOLE.EXE | MORE

Ugly, but since in my case the command line usage is intended for scripted usage, it will do.

Thank you.

Share this post


Link to post
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

×