将控制台应用程序转换为Windows应用程序

将控制台应用程序转换为Windows应用程序

问题描述:

(它的一个长的故事),但我有一个大的复杂项目文件包含一个Windows程序。不幸的是,该项目最初构建为控制台应用程序。程序编译和链接确定,但是当运行引起一个控制台,而不是我希望的窗口的集合。我看着命令行,看到/ SUBSYSTEM:CONSOLE,而它应该是/ SUBSYSTEM:WINDOWS。我不知道如何更改命令行。

(its a long story) but I have a large complex project file containing a windows program. Unfortunately the project was originally built as a console app. The program compiles and links ok but when runs brings up a console instead of the collection of windows I was hoping for. I looked at the command line and saw "/SUBSYSTEM:CONSOLE" whereas it should be "/SUBSYSTEM:WINDOWS". I have no idea how to change the command line. Is there some box I can tick in the project setting somewhere to make this change?

右键单击项目,属性,链接器,系统,更改子系统设置。你还必须将main()方法更改为WinMain()。你最好创建一些窗口,或者看不到很多东西。

Right-click the project, Properties, Linker, System, change the SubSystem setting. You'll also have to change your main() method to WinMain(). And you'd better create some windows or there won't be much to look at.