Jump to content
  • Advertisement
Sign in to follow this  
TGPrankster

Win32 Console in a Win32 App

This topic is 4109 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!