原理:
/subsystem:"console" /entry:"mainCRTStartup" (ANSI)
/subsystem:"console" /entry:"wmainCRTStartuup" (UNICODE)
以上两种是带有dos控制台显示的方式
如果你建立了一个win32 application,编译器得链接开关则会是一下形式
/subsystem:"windows" /entry:"WinMain" (ANSI)
/sbusystem:"windows" /entry:"wWinMain" (UINCODE)
这两种是不带有dos控制台的方式
#include "stdafx.h"
#include "windows.h"
// #pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )
int main(int argc, char* argv[])
{
MessageBox(NULL,"这是一个测试","test",0);
return 0;
}
#include "windows.h"
// #pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )
int main(int argc, char* argv[])
{
MessageBox(NULL,"这是一个测试","test",0);
return 0;
}