is it possible to have more than one console window associated with a single console app? i'm working on map drawing algorithms and it'd help if i could see the raw data and an ASCII representation of the map side-by-side
is it possible to have more than one console window associated with a single console app? i'm working on map drawing algorithms and it'd help if i could see the raw data and an ASCII representation of the map side-by-side
astride a storied past, thats everywhere you are
if you are talking windows ( and this is the dos board ) no. You can only have one console per process. Its in the msdn literature under console.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
The only way you can do this is make to seperate .exe's then open them up at the same time. DOS has no control over the windows.
of course you can have multiple console. However each thread/process can only have one console attached to it. Therefore, you create a few threads for each of your drawing, and each of them can do
FreeConsole(); //this invalidates the previous console
AllocConsole(); //this creates new console and set to it and sets
//all the std handles
......
CreateFile("$CONOUT"...) //attach console output stream
CreateFile("$CONIN"....) //attaches the console input stream
......
when you create threads, use CreateThread() and set inherithandle to be false, and set the flag to be CREATE_NEW_CONSOLE, and you can do more fancy stuff with your configuration of the STARTINFO struct, just make sure you call FreeConsole() in your thread's destructor so that console gets collected. If your application needs to start within the service, make sure in your ServiceMain() you call AllocConsole because by default they get invalidated.