在Delphi 2009和Delphi XE下安装相同组件无法正常工作 [英] Installing Same Components Under Delphi 2009 and Delphi XE not working

查看:103
本文介绍了在Delphi 2009和Delphi XE下安装相同组件无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组在D2009中一直在使用的自定义组件。我已经安装了Delphi XE,并且希望在升级项目时能够在两个IDE中使用这些组件。但是当我在XE中安装它们时,它们在D2009中不再真正可用。项目仍然可以编译,但是组件不再显示在工具选项板中,它们也不会出现在表单设计器中。



无论我如何尝试要卸载/重新安装等,我无法在D2009中使用这些组件。我已经验证了两个IDE的库路径中都有该组件的目录。



我需要在这里做什么才能使两个IDE中的组件都能正常工作?



谢谢!

解决方案

不同版本的Delphi会生成不同的软件包集( * .bpl文件)在不同的路径(包输出目录)中。设计包必须在运行时由IDE加载。现在,Windows搜索路径可能已发挥作用。当D2009想要加载软件包x.bpl时,它会解析为XE版本(不兼容),因为XE的软件包输出目录位于D2009之前的系统搜索路径中-如果您首先安装D2009,然后再安装XE,则会发生这种情况。 p>

解决方案是始终对软件包使用库后缀。我建议您遵循Delphi自己的约定,对D2009程序包使用120,对XE程序包使用150。对于D2009,您的x.bpl变为x120.bpl,对于XE,您的x.bpl变为x150.bpl。


I have a set of custom components that I've been using in D2009. I have installed Delphi XE, and I'd like to be able to use these components in both IDE's while I'm upgrading my projects. But when I install them in XE, they are no longer really usable in D2009. A project will still compile, but the components no longer show up in the Tool Palette, and they don't appear in the form designer either.

No matter how I try to uninstall/reinstall, etc., I can't get the components to work in D2009. I've verified that both IDE's have the component's directory in their library path.

What do I need to do here to get the components working in both IDE's?

Thanks!

解决方案

The different versions of Delphi produce different sets of packages (*.bpl files) in different paths ("package output directory"). The design packages have to be loaded at runtime by the IDE. Now the Windows search path probably comes into play; when D2009 wants to load package x.bpl it resolves to the (incompatible) XE version of it because XE's package output directory is in the system search path before D2009's - this happens if you installed D2009 first and XE later (recommended).

The solution is to always use Library Suffix for your packages. I suggest you go by Delphi's own convention and use 120 for D2009 packages and 150 for XE packages. Your x.bpl becomes x120.bpl for D2009 and x150.bpl for XE.

这篇关于在Delphi 2009和Delphi XE下安装相同组件无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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