简体   繁体   English

当内部单元使用DesignEditors DesignIntf​​时,如何为WIN64构建delphi项目?

[英]How to build delphi projects for WIN64 when units inside it uses DesignEditors DesignIntf?

I am trying to migrate some code from Delphi 5 to Delphi XE7-WIN64. 我正在尝试将一些代码从Delphi 5迁移到Delphi XE7-WIN64。 The scenario is DesignEditors is 32bit only since the IDE is 32 bit application. 由于IDE是32位应用程序,因此DesignEditors仅为32位。 And the project I am migrating has units which have uses clause containing DesignEditors or DesignIntf or both. 我正在迁移的项目具有包含DesignEditors或DesignIntf​​或两者的uses子句的单元。

Putting -LUDesignIDE in Build Configurations>Edit>Delphi Compiler>Compiling>Additional options to pass to compiler>-LUDesignIDE 在构建配置中放置-LUDesignIDE >编辑> Delphi编译器>编译>传递给编译器的附加选项> -LUDesignIDE

Gives the following as first error on build 提供以下内容作为构建的第一个错误

[dcc64 Fatal Error] E2202 Required package 'DesignIDE' not found

I am using Delphi XE7 trial version. 我使用的是Delphi XE7试用版。

It sounds like you have a package which is both design-time and run-time combined into one. 听起来你有一个既包括设计时也包含运行时的包。 In most scenarios however, you must split your package into two different packages . 但是,在大多数情况下,您必须将包拆分为两个不同的包 One package is run-time (where you implement all of your actual library), and the other is design-time (which exposes your library to the IDE). 一个包是运行时(实现所有实际库),另一个是设计时(将库暴露给IDE)。

That being said, the design-time packages must work directly with the Delphi IDE. 话虽这么说,设计时包必须直接使用Delphi IDE。 The Delphi IDE is 32bit, so the design-time package must also be 32bit. Delphi IDE是32位,因此设计时包也必须是32位。 Whereas, your run-time package will support whatever platforms are needed. 然而,您的运行时包将支持所需的任何平台。 Your design-time package is only responsible for registering your components, property editors, etc. to the IDE. 您的设计时包仅负责向IDE注册组件,属性编辑器等。

Anything which has anything to do with the IDE (such as registering components, registering property editors, etc.) Must be in your design-time package which is only 32bit. 任何与IDE有关的事情(例如注册组件,注册属性编辑器等)都必须在你的设计时包中,只有32位。 Because of legal copyright issues, all design-time implementation must be in a design-time package, separate from your run-time package. 由于合法的版权问题,所有设计时实现必须在设计时包中,与运行时包分开。

Start by creating a new design-time only package, same name but prefixed with DCL . 首先创建一个新的仅限设计时间的包,名称相同,但前缀为DCL Then, change your original package to run-time only. 然后,将原始包更改为仅运行时。 Create a new unit now in your new design-time only package. 现在,在新的仅限设计时的包中创建一个新单元。 This unit will be dedicated to registering all IDE design-time interaction. 该单元将专门用于注册所有IDE设计时交互。 Everything in your run-time package which relies on these design-time units must be converted over to this design-time package. 运行时包中依赖于这些设计时单元的所有内容都必须转换为此设计时包。 These units which you cannot find are only compatible with the 32bit Delphi IDE. 您找不到的这些单元仅与32位Delphi IDE兼容。

The new design-time only package will then have to require your run-time package. 然后,新的仅设计时包将需要您的运行时包。 You'll have to compile the run-time package first before you can compile the design-time package. 在编译设计时包之前,您必须先编译运行时包。 Any time, you make changes to your library, you need to 1) re-compile the run-time package, 2) re-compile the design-time package, and 3) re-install the design-time package. 任何时候,您对库进行更改,您需要1)重新编译运行时包,2)重新编译设计时包,3)重新安装设计时包。

The ToolsAPI units can be included in Win32 designtime packages, and nowhere else. ToolsAPI单元可以包含在Win32设计时包中,而不是其他任何地方。 You are trying to include them in a Win64 executable project. 您正在尝试将它们包含在Win64可执行项目中。 That is not allowed. 这是不允许的。

The solution is that you remove all the ToolsAPI units from your project. 解决方案是从项目中删除所有ToolsAPI单元。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM