Command Line Processing

N

nwsgrp1

I wounder if anyone here can either direct me to the correct group to
answer this question or maybe explain to me how the cmd console
processes attributes. My problem is:

I have a GUI application that can detect if it's executed from a
command line. If it has all messageboxes are outputted as text to the
console. But when I try to redirect to a logfile like this
"c:\myapp_dir>myapp /? > logfile.log" it stops outputing to screen and
I get a ERROR_INVALID_HANDLE when calling WriteConsole() method. Also
"logfile.log" is empty.

Anybody know why? Or know where to look for possible answer?

Regards,
Carl.
 
M

Mike Williams

I wounder if anyone here can either direct me to the correct group to
answer this question or maybe explain to me how the cmd console
processes attributes. My problem is:

I have a GUI application that can detect if it's executed from a
command line. If it has all messageboxes are outputted as text to the
console. But when I try to redirect to a logfile like this
"c:\myapp_dir>myapp /? > logfile.log" it stops outputing to screen and
I get a ERROR_INVALID_HANDLE when calling WriteConsole() method. Also
"logfile.log" is empty.

If you redirect to a text file (>) then console output stops. You
generally have to pipe it to a text file (¦). I don't recall the syntax
or have my huge DOS reference handy, but that might give you a clue.

As to why the file is empty, I'm not sure. It sometimes happens when an
EOF marker is not created.
 
D

David Candy

Did you look up the API (which talks about reasons for failing). Ask in programming groups.
 
N

nwsgrp1

Mike said:
If you redirect to a text file (>) then console output stops. You
generally have to pipe it to a text file (¦). I don't recall the syntax
or have my huge DOS reference handy, but that might give you a clue.

As to why the file is empty, I'm not sure. It sometimes happens when an
EOF marker is not created.

I think it's something to do with the console not being a true command
line interface but a GUI windows acting as one. So when I
programatically connect to the console and send text via stdout this
isn't captured by the redirect for some reason, maybe a different
stdout stream!

Thanks for the suggestion.
 
P

Pegasus \(MVP\)

Mike said:
If you redirect to a text file (>) then console output stops. You
generally have to pipe it to a text file (¦). I don't recall the syntax
or have my huge DOS reference handy, but that might give you a clue.

As to why the file is empty, I'm not sure. It sometimes happens when an
EOF marker is not created.

I think it's something to do with the console not being a true command
line interface but a GUI windows acting as one. So when I
programatically connect to the console and send text via stdout this
isn't captured by the redirect for some reason, maybe a different
stdout stream!

Thanks for the suggestion.

=============

Redirection is understood by the Command Processor cmd.exe only,
not by the GUI.
 
D

David Candy

Keep wastring others time. Question was answered by me. Obviously you are far too stupid.
 
P

Pegasus \(MVP\)

"David Candy" <.> wrote in message
Keep wastring others time. Question was answered by me. Obviously you are
far too stupid.

============

Up to your usual abusive self again?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top