使用 Hydra (Remobjects) 在 Delphi Prism 中创建插件
我必须在 Delphi Prism 中为 Delphi 中已有的应用程序创建一个插件。 我已在 www.remobjects.com 上阅读了有关 Hydra 3.0 的所有内容,并有一些疑问。
您能否给我一个示例,说明如何创建用于 Delphi Host 和 .Net Plugin 之间通信的自定义接口。(使用 C# 或 Delphi Prism)
您能否给我ModuleController 在 Hydra 插件中的作用是什么以及它如何在那里工作?
管理器组件的角色?
提前谢谢了。
I have to create a plugin in Delphi Prism for Application that is already in Delphi.
I have read all about Hydra 3.0 in www.remobjects.com and have some queries.
Can you please give me an example how to create custom Interfaces for communication between Delphi Host and .Net Plugin.(either in C# or Delphi Prism)
what is the role of ModuleController in Hydra plugin and how it works there?
Role of Manager Component?
Many Thanks in Advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我自己刚刚开始“九头蛇”之旅,但我会尽力回答你们的问题。
Q1. 如果没有更多有关您情况的信息,这个问题很难回答。 您可以访问 Delphi 代码库吗? 您是否正在向已有插件的现有应用程序添加插件,或者您刚刚开始向您的应用程序添加 Hydra 插件框架? 现在,我猜测您正在向现有主机应用程序添加一个新插件,并且您有 .pas 文件,其中包含将用于主机和插件之间通信的自定义接口。 如果是这种情况,那么以下内容应该适合您。
应该就是这样。 您的主机应用程序现在将能够查询您的插件以查看它实现了哪些接口,然后调用它所需的方法。
这类似于您导入的接口文件应该是什么样子
这类似于您的插件类应该是什么样子
Q2。 据我所知,模块控件负责向主机应用程序注册插件模块中的所有插件。 您还可以从插件中使用它来与主机应用程序进行通信。
Q3。 我假设您指的是 THYModuleManager。 这用于(除其他外)在运行时加载所有插件。
希望有帮助。
I'm just starting out on the "Hydra" journey myself but I'll do my best to answer your questions.
Q1. This one is hard to answer without some more info about your situation. Do you have access to the Delphi code base? Are you adding a plugin to an existing application that already has plugins, or are you just starting to add the Hydra plugin framework to your application? For now I'll guess that you are adding a new plugin to an existing host application and you have the .pas file containing the custom interfaces you are going to use for your communications between the host and your plugin. If that's the case then the following should work for you.
That should be about it. Your Host application will now be able to query your plugin to see which interface(s) it implements and then call the methods it requires.
This is something like what your imported interface file should look like
This is something like what your plugin class should look like
Q2. As far as I know the module control is responsible for registering all the plugins in your plugin module with the host application. You can also use it from your plugin(s) to communicate with the host application.
Q3. I assume you are referring to the THYModuleManager. This is used (among other things) to load all your plugins at runtime.
Hope that helps.