8

I want to have a new console open whenever I create a new thread so that the output will be organized. My application is fully console based. Would this be possible if so how?

Regards!

Arya
  • 7,765
  • 24
  • 86
  • 160

2 Answers2

16

A process can be associated with only one console

http://msdn.microsoft.com/en-us/library/windows/desktop/ms681944(v=vs.85).aspx

L.B
  • 110,417
  • 19
  • 170
  • 215
0

It's not difficult to work around this limitation.

The code that you want to run as a separate thread with its own console window, simply code that as a separate console application, passing parameters as required on the command line.

Then run separate instances of this code using Start() inside your main application.