In C++, what is the standard way to remove the command prompt, without using WinMain()? This is hopefully a simple question. I am using MSVC.
+5
A:
First you need to set /SUBSYSTEM:WINDOWS (as opposed to /SUBSYSTEM:CONSOLE), you can do this in GUI (right click the project, properties, Linker, System, Subsystem).
Then you have to either
- define
WinMain, or - define
mainand set the entry point tomainCRTStartup(properties, Linker, Advanced, entry point).
avakar
2010-09-25 12:41:38
Good, it worked. Is there a solution that will not require me to change any project settings. Like a preprocessor or macro, ect...
Alexander Rafferty
2010-09-25 13:15:33
using `#pragma comment(linker, "/SUBSYSTEM:WINDOWS")` you could do the same for the other options. Check the `pragma` preprocessor.
st0le
2010-09-25 13:18:54
I'll check it out.
Alexander Rafferty
2010-09-25 13:21:36