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 应用程序
				
        
 
            
        基础教程推荐
- 在 C++ 中计算滚动/移动平均值 2021-01-01
 - 常量变量在标题中不起作用 2021-01-01
 - 这个宏可以转换成函数吗? 2022-01-01
 - 如何通过C程序打开命令提示符Cmd 2022-12-09
 - C++结构和函数声明。为什么它不能编译? 2022-11-07
 - 如何检查GTK+3.0中的小部件类型? 2022-11-30
 - 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
 - 如何在 C++ 中初始化静态常量成员? 2022-01-01
 - 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
 - 我有静态或动态 boost 库吗? 2021-01-01
 
    	
    	
    	
    	
    	
    	
    	
    	
						
						
						
						
						
				
				
				
				