views:

952

answers:

2

What I want to do is something like this:

ConsoleWindow1.Print("1");
ConsoleWindow2.Print("2");

When I run the program, two console windows pop up and one gets printed with 1 and the other gets printed with 2. Is there a simple way of doing this?

+1  A: 

For console based application there can be only one console per process. You can start two processes and then do some sort of IPC to coordinate with each other

Umair Ahmed
Thanks for the tip, but inter-process communication and multi-threading in general is beyond my current programming abilities. I think I'll try and convert the current console application into a library of some sort, since the only output is a log.
Daniel T.
A: 

One way I see, to write a console that prints argument given to exe, and write another application that call both with different arguments, I didn't try but may be you can open two by WIN32 functions, see How to Open Console Window in a Win32 Application

ArsenMkrt
but daniel has asked for a console application not Win32 application.
Umair Ahmed
Ok, than I see only the first way I offer
ArsenMkrt
Yeah, what I'm trying to do is modify another console application. Right now the log is printed to the only console window, and there's a lot of messages so you can imagine it's pretty messy. Rather than comment out the lines I don't need, some of which are useful in certain situations, I want to open a new console window to display the log info I DO need all the time.
Daniel T.
not the answer to your question, but you can write log to text file and open that file in the end ...
ArsenMkrt
Thanks for the advice, but I need to see the data in real-time :).
Daniel T.