A Visual Studio C++ application, I'd like stdout to go the the console when the application is started from the console, but I'd like the application to not open a console window when started by double-click (and I'm happy to not see the stdout). How can this be done?
Using the Properties/Linker/System/SubSystem option to specify /SUBSYSTEM:CONSOLE gives the desired behaviour when the application is started from the command line; using /SUBSYSTEM:WINDOWS gives the desired behaviour when the application is started with double-click. Neither option gives the desired behaviour for both ways of starting the application.