It seems to me that this has been addressed before but (as usual) I can't find it when I need it.....
I have an MFC GUI application. I am adding a command line capability. If the app is started from a command line it should:
1) Detect that it's been started this way, if possible. If it's not possible, then I'm OK with just using a command line arg to specify non-GUI.
2) If started from the command line, be able to input/output to the existing console with printf, etc. I know about ::AllocConsole() but this creates a new console. I want to use the existing one.