views:

10

answers:

2

In MSVC++ you can summon a console window to your app by running:

// Attach a console
AllocConsole() ;
AttachConsole( GetCurrentProcessId() ) ;
freopen( "CON", "w", stdout ) ;

Now printf and cout automatically go to that window.

Is it possible in MSVC++ to have more than one console window?

A: 

Don't think so but there are a few logging libraries that give you a console-like dos box that you can stream messages to. You could have lots of these if you just one a number of separate output consoles.

Martin Beckett
A: 

According to AllocConsole documentation:

A process can be associated with only one console

So I don't think you can use multiple consoles. MSVC++ is not responsible for this, it's a Win32 limitation.

Samuel_xL