简体   繁体   English

无法动态链接到自定义bpl中的组件

[英]Cannot dynamically link to components in a custom bpl

While drafting the following post I found a solution, but I thought it might be still worthwhile to post here for reference. 在起草以下帖子时,我找到了一个解决方案,但我认为在这里发布以供参考可能仍然值得。 See solution below. 见下面的解决方案


In RAD studio (C++), I have a project group with multiple dlls and exes that rely on a standard set of custom controls. 在RAD studio(C ++)中,我有一个项目组,其中包含多个dll和exes,它们依赖于一组标准的自定义控件。 I have isolated these controls in a borland package (bpl) so that I can use them in Design view. 我已经在borland包(bpl)中隔离了这些控件,以便我可以在Design视图中使用它们。

Now whenever I drag one of my custom controls from the component palette to a form, it seems the component is actually statically linked into the project containing the form. 现在每当我将一个自定义控件从组件面板拖到一个表单时,该组件实际上静态链接到包含该表单的项目中。 This is not what I want, and it leads to problems since some of my controls rely on additional resources linked into the bpl. 这不是我想要的,它会导致问题,因为我的一些控件依赖于链接到bpl的其他资源。

I already removed the #pragma link line that RAD Studio adds automatically, but the component is still linked into the executable. 我已经删除了RAD Studio自动添加的#pragma链接行,但该组件仍链接到可执行文件中。 I cannot see how this happens. 我看不出这是怎么发生的。

Any ideas? 有任何想法吗?


OK, the solution is rather easy: In project options, go to page "Packages" and under "Build with runtime packages", enter the name of the package (without the bpl extension) that contains the common components. 好的,解决方案非常简单:在项目选项中,转到“Packages”页面,在“Build with runtime packages”下,输入包含公共组件的包的名称(不带bpl扩展名)。 Done. 完成。

From Hendrik: 来自亨德里克:

"OK, the solution is rather easy: In project options, go to page "Packages" and under "Build with runtime packages", enter the name of the package (without the bpl extension) that contains the common components. Done." “好的,解决方案相当简单:在项目选项中,转到页面”包“和”使用运行时包构建“下,输入包含公共组件的包的名称(不包含bpl扩展名)。完成。”

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

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