开发者

How to program a plugin in Windows/Delphi?

I need to create a plug-in that updates an application.

Look, I have a host application, but probably I will update it with more functions. I am working in Windows with Delphi 7.

Basically, "my plugin" should add 2 or 3 new functions to the host application.

How can I program a plug-in t开发者_如何学编程hat inserts new code (new functions) in the host application without re-compiling it??

Note: I am sorry about my English. My natural language is Spanish.

Thanks.


One method which works quite well is to create COM objects for your plugins. The advantage of this approach is that plugins can be developed in other languages other than Delphi (although com development in Delphi is by far the easiest than any other language). COM plugins will not need to be recompiled to match the current version of your host application unless your plugin interface changes.

I have implemented a successful COM based plugin architecture in a commercial product and have several plugins developed in Delphi 5 which have not needed to be recompiled at all. They still just run, even though my application is now compiled against Delphi 2007/2009.


Here you can find an article that explain how to make an application with plugins. You must use dynamic packages and RTTI.

It include the code of a first prototype.

Regards and excuse for my bad english too. P.D: The article is in spanish.


There are a number of Delphi Plugin Frameworks, commercial as well as open source. There's definitely something there that suits your needs (and budget).


For my plugin-based work, I use the JvPlugin framework in the JVCL. In the JVCL install, in the \examples\JvPlugin folder, you can find several examples showing how to add new features into the app, including adding new menu items into a form's menu bar.


Personally i use Hydra from Remobjects. I allows me to mix native and .NET plugins.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜