Delphi plugin framework
Asked Answered
B

5

12

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

Bilyeu answered 20/8, 2010 at 7:45 Comment(4)
possible duplicate of Plugins system for Delphi application - bpl vs dll?Place
Also possible duplicate of: How best to add Plugin Capability to a Delphi programDivide
It's not the case that COM interfaces need to be registered. If you know where the implementing DLL is, you can load it and call its COM-related functions directly. There's no need to have the OS do it for you. And that makes it portable in both sense of the word: You can compile the code on other operating systems, and you can put the program on a USB drive and run it wherever you go.Phlebosclerosis
I have read only a few articles about COM interfaces. From them I though, all COM interface must be regisetred in the system. I need portable application and therefore I rejected COM programming. But it seems, it is possible to make it portable. Thanks. I must study COM techniques deeper ;)Bilyeu
W
8

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:

Webber answered 20/8, 2010 at 8:11 Comment(0)
R
1

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.

Reni answered 20/8, 2010 at 9:22 Comment(0)
H
0

I would look at Hydra from Remobjects.

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

Halfpint answered 20/8, 2010 at 10:0 Comment(0)
B
0

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.

Bellow answered 20/8, 2010 at 17:8 Comment(2)
Yes, there are some workarounds how to baypass the error "cannot assign TFont to TFont" and TFrame from *.dll can be placed into host *.exe application, but there are some other problems with tab ordering with embeded TFrame, (after pressing tab key, focus is not moved to the next control in frame...) Or is there some workaround for it too?Bilyeu
Also arrow keys are not intercept by the form which means that TEdit and TMemo controls don't work correctly.Leninism
B
0

Have you taken a look at http://www.tmssoftware.com/site/tpf.asp

Blossom answered 5/11, 2011 at 17:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.