非console程序显示DOS窗口

有时想在非console程序中显示DOS窗口,实现方法如下:

1、在程序中添加如下代码:

#pragma comment( linker, "/subsystem:console /entry:mainCRTStartup" )  非unicode用

#pragma comment( linker, "/subsystem:console /entry:WinMainCRTStartup" ) unicode用

2、对项目属性进行如下设置(其实下面的设置就是上面的代码体现)





原文地址:https://www.cnblogs.com/garfieldx/p/3381477.html