470,628 Members | 2,344 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,628 developers. It's quick & easy.

Output and input from console window?

I am working on a Win32 program with an additional console window to output
messages. I also want to type commands in the console window. Is there any
common way to achieve that?
For example how do I output messages while the console is listning for
command inputs?

I'm looking forward for your answer with great anticipation


Nov 17 '05 #1
1 1543
Teis Draiby wrote:
I am working on a Win32 program with an additional console window to
output messages. I also want to type commands in the console window.
Is there any common way to achieve that?
Of course - just like you would with a pure console program. See

http://support.microsoft.com/default...b;en-us;105305

for information on how to connect a console to stdin and stdout from within
a GUI program.
For example how do I output messages while the console is listning for
command inputs?


If you want to both wait for input and write output you need to use multiple
threads - one for reading and one for writing. If your GUI is writing to
the console (debug log messages, for example), you probably want to create
another dedicated thread that does the console input and processes the
command that you enter.

-cd
Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Boba | last post: by
2 posts views Thread by Peter Kirk | last post: by
2 posts views Thread by JezB | last post: by
5 posts views Thread by Christophe HELFER | last post: by
4 posts views Thread by Kevin Mansel via .NET 247 | last post: by
4 posts views Thread by djc | last post: by
6 posts views Thread by =?Utf-8?B?R3JlZw==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.