If I remember correctly, Windows applications can be compiled as console or GUI applications. One of the main differences is that console applications get a console automatically, while GUI applications do not (although they could get one if they wanted by calling AllocConsole
).
Common wisdom says if you use printf
or std::cout
from a GUI application, that output simply goes nowhere, because there's no console to print it to. But I know it's possible to read it, because when I run some applications from a terminal on Linux using Wine, I can read the output of printf
and similar functions. (Yes, I'm sure it's the application printing that, not Wine.)
How could I do that on Windows? I've tried DebugView and even though it shows a bit of debug text coming from the application, it doesn't show as much as Wine does, probably because DebugView is restricted to calls to OutputDebugString
.
gui_application.exe > output.txt
. Not sure if it works, and I am curious whether it works.