0

I am developing WTL GUI application. I want to print something on console.
How to enable console printing in win32/WTL application.

Rushikesh Talokar
  • 1,515
  • 4
  • 16
  • 32

1 Answers1

2

Use AllocConsole to attach to a new console. (This will fail if your program is being run from a console window in the first place, but that's ok.) Also look at this page for a fully worked example.

Eric Brown
  • 13,774
  • 7
  • 30
  • 71
  • I think you should have added the gist from that link. It's crucial to link the new console window to the C runtime handles for `stdout` and `stderr`. – 0xC0000022L Oct 14 '14 at 09:26