You can call AllocConsole first to bring up a console window in your GUI application.
Note that if you do this, add the following lines after the AllocConsole
call.
freopen ("CONOUT$", "w", stdout );
freopen ("CONERR$", "w", stderr );
Also, you can redirect stdout/stderr to a file by doing this:
C:\> myprogram.exe > out.txt 2> err.txt