Win32 Console in a Win32 App

Started by
1 comment, last by TGPrankster 17 years ago
Hey again everyone. I've been working on rebuilding my game using some static libraries, and I'm trying to add a console window to the application so that I can easily get data from the application (for various reasons). I went to New Project (in Visual Studio '05) and created an empty Win32 Console Application, which I added to the main solution. I added a cpp file which I know works in it's own, but the console doesn't open with the main program! What do I need to do to get the console to work with the main application?
~ Open your mind ~
Advertisement
You didn't need a new project. You merely needed a call to the Win32 API AllocConsole (and FreeConsole to close it).

If you wish to use C++ stream I/O redirected to that console, you will need to reopen (and/or duplicate) some low level file handles. See here for more information.
Thanks a ton, that was exactly what I needed.
~ Open your mind ~

This topic is closed to new replies.

Advertisement