在C ++ Builder XE5中创建Win32应用程序 [英] Create Win32 application in C++Builder XE5

查看:111
本文介绍了在C ++ Builder XE5中创建Win32应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在旧版的Borland C ++ Builder中,您使用控制台向导启动了Win32程序. XE5现在不存在了!我该如何开始?

In older version of Borland C++Builder you used the Console Wizard to start off a Win32 program. That is now gone from XE5! How do I start??

推荐答案

您要查找的向导位于:

文件>新建>其他...> C ++ Builder项目>控制台应用程序

File > New > Other ... > C++Builder Projects > Console Application

但是,向导对话框自XE2起就被打破,并且仍未在最新版本(在撰写本文时为XE7)中得到修复.

However, the wizard dialog has been broken since XE2 and is still not fixed in the latest version (XE7 at the time of this writing).

  1. 该对话框具有一个下拉列表,用于选择目标框架".如果将此设置为无",则在链接时可能会出现无法解析的外部"错误.因此,您可能必须选择"Visual Component Library"或"FireMonkey".

  1. The dialog has a drop-down list to select a "Target Framework". If you set this to "None", you may get "unresolved external" errors at link-time. So you might have to choose either "Visual Component Library" or "FireMonkey".

该对话框有一个控制台应用程序"复选框,默认情况下已选中该复选框,禁止用户交互.

The dialog has a "Console Application" checkbox that is checked by default and disabled from user interaction.

这样,您只能创建使用main()入口点的控制台应用程序,而不能创建使用WinMain()入口点的Win32应用程序.幸运的是,注册表中有一种解决方法:

As such, you can only create a console app that uses a main() entry point, rather than a Win32 app that uses a WinMain() entry point. Fortunately, there is a workaround in the Registry:

HKEY_CURRENT_USER\Software\Embarcadero\BDS\<version>\Repository\New Console Application

(REG_SZ) "ConsoleApp" = "True" or "False"

"ConsoleApp"设置为"True""False"以指定复选框的默认状态.通过将其设置为"False",您可以创建使用WinMain()入口点的控制台应用程序.

Set "ConsoleApp" to "True" or "False" to specify the checkbox's default state. By setting it to "False", you can create a console app that uses a WinMain() entry point.

或者,使用WinMain()入口点创建Win32应用的另一种方法是创建一个新的VCL Forms应用程序,并从项目中删除默认生成的MainForm,然后从默认值中删除不需要的任何代码.生成WinMain().

Alternatively, another way to create a Win32 app with a WinMain() entry point is to create a new VCL Forms Application and remove the default generated MainForm from the project and remove any code you don't want from the default generated WinMain().

Embarcadero意识到了这些错误(我已经与他们私下讨论过,并且他们确认对话框的代码中存在某些奇怪之处导致了此问题).我没有看到任何QualityCentral票证,所以我现在已经提交了QualityPortal票证.

Embarcadero is aware of the bugs (I have discussed it with them in private, and they have confirmed there are some oddities in the dialog's code that are causing this issue). I don't see any QualityCentral tickets for them, so I have now submitted a QualityPortal ticket.

RSP-10796 C ++控制台应用程序向导已损坏

希望它们最终将得到解决.

Hopefully they will finally get fixed.

这篇关于在C ++ Builder XE5中创建Win32应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆