Platform Frequently Asked Questions


How can I choose an appropriate template for my Hydra project?

There are four Hydra-related templates available:

  • Host Application: This application will initialize and load the Hydra plugins. This template is very light-weight; it is pretty straight-forward to turn any existing .exe into a Host and allow it to load plugins, just by dropping a ModuleManager somewhere and adding the appropriate code to load plugins.
  • Hydra Module Controller: This template is used to create a new Hydra Module Project. Each Plugin Module is a dll that can contain one or more plugins.
  • Hydra Module: This template allows to add additional plugins to an existing dll. Depending on your architecture, you might not always want a 1:1 mapping of plugins and dlls, but perhaps group several related plugins in one dll.
  • Hydra Plugin: This template is used automatically when a Hydra Module Project is created. Only one Module Controller per dll is needed. This template is needed only when you create a Hydra Module Project manually, not using the wizard.

How can I convert WinForms application into Hydra plugin?

The following steps will help you to convert your WinFroms application into a Hydra visual plugin:

  • Add a module controller to your solution (Add -> New Item -> Module Controller).
  • Change your form code to:
[Plugin, VisualPlugin]
public partial class Form1 : VisualPlugin
  • Add Hydra namespace:
using RemObjects.Hydra;
  • Remove Program.cs from your project.
  • Add licenses.licx file with following content to your solution:
RemObjects.Hydra.VisualPlugin, RemObjects.Hydra
  • Change output type of your application to Class Library (in Project -> Project Properties -> Output type).
  • Make your application COM visible by changing AssemblyInfo.cs:
[assembly: ComVisible(true)]

This will convert your form to a Hydra visual plugin, however you may still need to do some manual tuning since VisualPlugin inherits from UserControl.


How can I create a Hydra-enabled service?

Hydra functionality is independent of the basic .exe type, so you can use Hydra in any sort of application. We don't currently have a RO/Service/Hydra template, but you can easily hydra-enable an existing service app simply by merging code from two projects (for example moving the basic service plumbing from a RO/Combo project to your Hydra host app, or the other way around, adding a Hydra Module manager to your RO app and then moving the services out into plugins).


How can I create an application similar to the ModuleServer sample?

To do this you need to:

  • Choose a Host Application with the RO Service and Save.
  • Create a Hydra Module Project (called HydraServices) in the sample and save.
  • Create another Hydra Module Project (called HydraServicesSecond) in the sample and save.
  • Put in the code.
  • Build the project.

How can I handle CallBack from .NET to Delphi?

To do this you need to follow these steps:

[Guid("3AC96960-4DB3-4984-8E16-4FC979911AE0")]
public interface IMyHostInterface : IHYCrossPlatformInterface
{
// Interface definition
...
  int TestMethod (int aTestParam);
}
  • Implement this interface in the host .NET application:
public class InterfaceImplementation : IHYCrossPlatformHost, IMyHostInterface
{
...
// IMyHostInterface implementation
...
  public int TestMethod(int aTestParam)
  {
    ...
  }
...
}
  • Assign the Host property during in InterfaceImplementation constructor:
  moduleManager.Host = this;
  • Make the assembly COM-visible. This can be done via the Project Properties pane or by defining in AssemblyInfo.cs:
  [assembly: ComVisible(true)]
  • Import the interface into the Delphi Hydra module project. You'll receive similar code:
IMyHostInterface = interface(IHYCrossPlatformInterface)
['{3AC96960-4DB3-4984-8E16-4FC979911AE0}']
// Interface definition
...
  function TestMethod(aTestParam: integer): integer; safecall;
end;
  • Now you can perform callback using the following code:
 if Supports(Host, IMyHostInterface) then
// Calling callback operation
  lCallbackResult := (Host as IMyHostInterface).TestMethod(42);

How can I load plugin DLL from another Plugin DLL?

You need to have a ModuleManager in the plugin that will load the second plugin. Just put a THYModuleManager on the plugin's "data module" and use it in the code for loading/unloading plugins, creating instrances etc.


How can I provide object pooling in a Hydra server working with RODataModules?

Pooling is handled for each service type independently, and each service type is encapsulated into plugin. Pooling them will not be a problem; it should "just work".


How can I run the Remoting Combo Server as service?

As with all Delphi services, you only need to run the .exe with the /install parameter once, to install it as service. After that, you can control the service, like any other, in the management console.


Which Hydra files I have to deploy on client computers?

Files that you need to deploy are depending on what you have used in your application.

.NET

put that dll's in the folder with your .NET plugin: - RemObjects.Hydra.dll - core - RemObjects.Hydra.WPF.dll - in case if you use WPF

Delphi (if you build with runtime packages):

  • Hydra_Core_D*.bpl - core package
  • Hydra_RO_D*.bpl - in case if you using Remoting SDK (in this case you may also need to deploy RemObjects_Core_D*.bpl and RemObjects_Server_D*.bpl.

Starting from Delphi XE2, Hydra also splits core package into two additional packages to support VCL and FMX, if you are using Delphi XE2 or higher you also need to deploy:

  • Hydra_VCL_D*.bpl - for VCL plugins.
  • Hydra_FMX_D*.bpl - for FireMonkey plugins.

And of course other packages that your app uses as well as delphi core packages (such as rtl*.bpl, vcl*.bpl and so on).