Delphi插件框架

发布于 2024-09-14 20:27:35 字数 306 浏览 7 评论 0 原文

我想设计Delphi插件框架。有以下三个选项:
1.DLL
2.BPL
3.COM接口

每个选项都有一些缺点。

DLL - MDI 应用程序出现问题,插件中的表单无法嵌入到主机 exe - mdi 应用程序中。
BPL - 每个 *.bpl 插件和 *.exe 主机应用程序必须使用相同版本的 Delphi 进行编译。
COM - 接口 {xxx-xx-xxx-xx} 必须在系统中注册,(regsvr) 因此插件框架无法移植!

我上面写的一切都是真的吗?如果不对请指正,或者还有其他的可能吗?
谢谢

I want to design Delphi plugin framework. There are three options:
1. DLL
2. BPL
3. COM interface

Every option has some disadvantage.

DLL - Promblem with MDI apllication, forms from plugin cannot be embeded to the host exe - mdi application.
BPL - Every *.bpl plugin and *.exe host application must be compiled with the same version of Delphi.
COM - Interfaces {xxx-xx-xxx-xx} must be registered in system, (regsvr) So plugin framework cannot be portable!

Is everything true what I wrote above? If not, please correct me, or is there some other possibility?
thanks

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

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

发布评论

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

评论(5

人│生佛魔见 2024-09-21 20:27:35

是的,你写的是正确的。所有这些都有优点和缺点,问题是什么对你来说重要,你没有说出你想做什么,所以我们无法告诉你如何去做。

一般来说,我会默认选择 BPL,如果需要从非 Delphi 应用程序中使用 DLL,则使用 DLL,只有在确实需要时才选择 COM。

另一种选择是不构建自己的框架,因为有多个可用的 Delphi 插件框架。

另外,这个主题之前已经讨论过,请查看:

Yes, what you wrote is correct. All of these have advantages and disadvantages, the question is what is important for you, you didn't say what you want to do, so we can't tell you how to do it.

In general, I would pick BPL by default, use DLL if you need to use it from non Delphi apps, and pick COM only if you really have to.

The alternative is to not build your own, since there are several Delphi plugin frameworks available.

Also, this topic has been discussed here before, check out:

七七 2024-09-21 20:27:35

另一种可能性是拥有脚本接口,例如使用 PythonPascalscript。这种方法有很多优点,其中最重要的是插件源也是可执行文件,使其易于调试和共享。

Another possibility is having a scripting interface, such as with Python or Pascalscript. There are many advantages to this approach, not least of which is that the plugin source is also the executable, making it easy to debug and share.

还给你自由 2024-09-21 20:27:35

我会查看 Remobjects 的 Hydra

另一种候选方案是 PaxCompiler(脚本)和 EControl Form Designer(表单设计器)。

I would look at Hydra from Remobjects.

Another candidate would be a combination of PaxCompiler (scripting) and EControl Form Designer (form designer).

厌味 2024-09-21 20:27:35

我们使用 DLL,即使仅与 Delphi 应用程序一起使用也是如此。
Dll 窗体嵌入在主窗体中,并使用选项卡而不是 MDI。
为了使 DLL 正常工作,我们还使用共享内存管理器并使用运行时包构建:vcl、rtl 和我们自己的包。

We use DLLs, even when using only with a Delphi application.
Dll forms are embedded in the main form and use Tabs instead of MDI.
For DLL to work properly we also use a shared memory manager and built with runtime packages: vcl, rtl and our own package.

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