Create Win32 application in C++Builder XE5

好久不见. 提交于 2020-01-06 14:04:30

问题


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


回答1:


The wizard you are looking for is located at:

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

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. 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".

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

    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"
    

    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.

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 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++ Console Application wizard is broken

Hopefully they will finally get fixed.



来源:https://stackoverflow.com/questions/29283438/create-win32-application-in-cbuilder-xe5

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