convert a console app to a windows app

两盒软妹~` 提交于 2019-12-18 07:41:09

问题


(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?


回答1:


Right-click the project icon in the Solution Explorer, then Properties > Linker > System > SubSystem, and set that to Windows. 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.




回答2:


Complementing Hans' answer: While under Properties, also remember to expand the C/C++ node and select Preprocessor. Then edit the Preprocessor Definitions - replace _CONSOLE with _WINDOWS.



来源:https://stackoverflow.com/questions/3884124/convert-a-console-app-to-a-windows-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!