Question

Continuing with our Delphi 2010 thick client to multi-tier migration (previous question), we are at the point where we need to find a databinding solution. I have come across RemObjects Hydra. The thing is I can't seem to follow their tutorials for the host program and for the plugin I have created a Hydra plugin project in visual studio, implemented the interface as described and that builds fine.

[Guid("8F1B3EE3-CC69-4685-B141-FAF2F4FB57C4")]
public interface IGridPlugin : IHYCrossPlatformInterface
{
    string UserData { get; set; }
    int ID { get; set; }

}

In the plugin:

[Plugin(Name = "GridPlugin", Description = "This is the Grid plugin", UserData = "Data"), VisualPlugin]
public partial class GridPlugin : RemObjects.Hydra.WPF.VisualPlugin, IGridPlugin
{

In Delphi I have created a new Hydra host project, imported the interface, but in the form create/load events they mention:

procedure TMainForm.FormCreate(Sender: TObject);
begin
  ModuleManager.LoadModule('SilverlightPlugin.xap');
  ModuleManager.CreateVisualPlugin('SilverlightPlugin', fInstance, Panel1);
end;

What is fInstance? Also, no files in my WPF plugins project end in .xap, so what am I supposed to pass as a parameter?

Has anyone implemented RemObjects Hydra, how did you achieve this early step? Any help will be appreciated.

Was it helpful?

Solution

This is how I got it working in the end, you need to declare an instance of the plugin:

Private
  fInstance: IHYVisualPlugin;

// Then Call in the FormCreate event
procedure TMainForm.FormCreate(Sender: TObject);
begin
    ModuleManager.LoadModules('C:\Users\user.Name\Documents\Visual Studio 2010\Projects\DynamicEF4\Product.Delphi.WPF\BIN\RELEASE\Product.Delphi.WPF.dll');
   ModuleManager.CreateVisualPlugin('ViewerPlugin', fInstance, pnl1);
end;
// And then in the FormDestroy event
procedure TMainForm.FormDestroy(Sender: TObject);
begin
    ModuleManager.ReleaseInstance(fInstance);
end;

I guess I was looking at the wrong example, the .xap I saw related to silverlight, and not required for wpf or windows forms.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top