A Windows application launched from the console? AttachConsole(ATTACH_PARENT_PROCESS).
http://msdn.microsoft.com/en-us/library/windows/desktop/ms681952
That article is wrong (no need to AttachConsole after AllocConsole, as AllocConsole attaches it). Unfortunately, it is dealing with a different problem to mine; how to simply create a new console window to run alongside the current.
I'm a little lost here, from what I understood in your original post.. you wished to use the console your program was launched from? if that is the case,
That article is wrong (no need to AttachConsole after AllocConsole, as AllocConsole attaches it). Unfortunately, it is dealing with a different problem to mine; how to simply create a new console window to run alongside the current.
Yes, you either allocate a new console, or attach to an existing one. If you simply want a new console, use AllocConsole(). http://msdn.microsoft.com/en-us/library/windows/desktop/ms681944