bpl delphi专家和dll delphi专家有哪些区别

发布于 2024-11-08 16:08:14 字数 379 浏览 5 评论 0原文

我正在一名delphi IDE专家工作,现在为了避免依赖性问题,我正在考虑将这位专家重建为dll专家,正如其中之一所建议的答案,现在我的专家(编译为 bpl)访问 ScreenApplication 全局变量(实例Delphi IDE 的),所以我想知道如果我将 Expert 编译为 DLL,我仍然可以访问这些变量,而且我想知道 BPL Delphi Expert 和 DLL Delphi Expert 之间的主要区别是什么?< /代码>

I am working in a delphi IDE expert , now to avoid dependencies problems, i was thinking in rebuild this expert as a dll expert as was suggested in one of these answers, now my expert (compiled as bpl) access the Screen and Application global variables (instances of the Delphi IDE), so i was wondering if i compile my expert as a dll i can still accesing these variables and also i want to know which are the main differences between a bpl delphi expert and a dll delphi expert?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

生活了然无味 2024-11-15 16:08:14

我应该将向导编译为 DLL 还是包?包更容易
加载和卸载,无需重新启动
IDE(因此更容易调试),但是
他们可能会造成单位命名冲突
在 IDE 中。冲突发生时,
巫师单位的名称与名称相匹配
一个单元在另一个加载的
设计时包。在这种情况下,
两个包都无法加载
同一时间。推荐的解决方法
是为所有单位名称添加前缀
带有“唯一”前缀。 G专家,对于
例如,使用“GX_”作为名称前缀
为其单位。

来自这个关于 OTA 的非常好的来源:GExperts

Should I compile my wizard as a DLL or a Package? Packages are easier to
load and unload without restarting the
IDE (and hence easier to debug), but
they can create unit naming conflicts
in the IDE. Conflicts happen when the
name a wizard's unit matches the name
of a unit in another loaded
design-time package. In this case,
both packages can not be loaded at the
same time. The recommended workaround
is to prefix all of your unit names
with a "unique" prefix. GExperts, for
example, uses "GX_" as the name prefix
for its units.

From this very good source about OTA: GExperts

豆芽 2024-11-15 16:08:14

当您访问全局变量时,这些全局变量对于 DLL 来说是全局的,而不是主 BDS.exe 的全局变量。我不确定,但我认为如果您在 Forms 中链接,您的 DLL 将拥有自己的 Screen 和 Application 全局变量以及 VCL 的核心。

那些属于 IDE 本身的东西可以通过 Open Tools Api (OTA) 访问。我相信您通常不会在专家的 IDE 之间共享任何对象,如果您尝试这样做,将会出现问题。您所做的任何绕过 OTA 的操作都将很容易以奇怪的方式受到破坏,尤其是在 IDE 的未来版本中。

依赖性问题当然是不使用基于 BPL 的包的一个重要原因,但我认为更大的原因是保持工具内部结构与 IDE 内部结构之间的完全分离。

请记住,DLL 目标与可执行目标一样,是静态链接的。这就是差异的核心。如果您的专家提供的功能仅使用合法的公开记录的 OTA 接口,那么迁移到 DLL 应该不会出现问题。如果您使用 BPL 可能的一些后门黑客攻击,那么我无法为您提供进一步的建议。

When you access a global variable those would be global variables that are global to your DLL, not global to the main BDS.exe. I am not sure but I think your DLL would have its own Screen and Application global variable, if you linked in Forms, and the core of the VCL.

Those things which belong to the IDE itself are accessed through the Open Tools Api (OTA). I believe that you do not normally share any objects between the IDE your expert anyways, and if you were to try to do so, it would be problematic. Anything at all that you do that bypasses the OTA is going to be vulnerable to breaking in strange ways, especially in future versions of the IDE.

Dependency problems are of course a big reason to not use BPL based packages, but I think an even bigger reason is to maintain a complete separation between your tool's internals, and the internals of the IDE.

Remember that a DLL target, like an executable target, is statically linked. That is the core of the difference. If your expert provides functionality that uses the legal public documented OTA interfaces only, then moving to a DLL should be problem free. If you use some back door hacks that are possible with BPLs, then I can't advise you further.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文