原理:

/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;
}

 

相关文章:

  • 2022-12-23
  • 2021-07-24
  • 2021-08-10
  • 2022-12-23
  • 2021-05-21
  • 2021-12-19
  • 2022-12-23
  • 2021-11-04
猜你喜欢
  • 2022-01-29
  • 2022-12-23
  • 2021-04-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案