convert a console app to a windows app(将控制台应用程序转换为 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 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.
这篇关于将控制台应用程序转换为 Windows 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将控制台应用程序转换为 Windows 应用程序
				
        
 
            
        - STL 中有 dereference_iterator 吗? 2022-01-01
 - 近似搜索的工作原理 2021-01-01
 - 从python回调到c++的选项 2022-11-16
 - 使用/clr 时出现 LNK2022 错误 2022-01-01
 - C++ 协变模板 2021-01-01
 - 与 int by int 相比,为什么执行 float by float 矩阵乘法更快? 2021-01-01
 - 如何对自定义类的向量使用std::find()? 2022-11-07
 - 一起使用 MPI 和 OpenCV 时出现分段错误 2022-01-01
 - Stroustrup 的 Simple_window.h 2022-01-01
 - 静态初始化顺序失败 2022-01-01
 
						
						
						
						
						
				
				
				
				