Hydra 6: Import of interfaces from .Net assemblies fails


(RemObjects) #22

bugs://81812 got closed with status fixed.

(antonk) #23


I’ve fixed all 3 issues

(Santiago Burbano) #24

thank you very much!
Is there a new beta available or must we contact support?


(marc hoffman) #25

I can send you a new build now; what’s your username on remobhjects.com? We’ll probably have a new official beta, next week.

(Santiago Burbano) #26


a beta early next week works for us.
My user name is santiagoit



(marc hoffman) #27

I’ve set you a new build now, to Personal Downloads.


(Santiago Burbano) #28

I just tried the new build you uploaded for us.
It is much better now. :slight_smile:
However one error is happening:

The imported pas file looks like this:

  IHHCadLayer = interface(IHHCadObject)

  IHHCadObject = interface(IHYCrossPlatformInterface)

This generates a compiler error:

[dcc32 Error] Core_Import.pas(1899): E2086 Type ‘IHHCadObject’ is not yet completely defined

The fix is easy.
IHHCadObject must be defined BEFORE IHHCadLayer.



(RemObjects) #29

Thanks, logged as bugs://81842

(antonk) #30

Hmm, I guess I just need to list all interfaces in the very first lines of the interface section like

  IHHCadLayer = interface;
  IHHCadObject = interface;

This should be a more reliable and easy solution than sorting the interfaces.

EDIT: I see that the forward declarations should be created by the importer. Could you send to support@ your C# code for interface declarations and the resulting Delphi .pas file? All this code will be kept private ofc.

Thanks in advance

(antonk) #31

Also I have to add a very important note:

In case of Delphi <-> .NET communications Hydra actually uses COM.

In COM interfaces can inherit from one another. However the .NET implementation (not Hydra but the framework itself) that exposes the .NET interface to COM does not support inheritance. Therefore you must replicate any interface members of the base interface in the derived interface.

More details at https://social.msdn.microsoft.com/Forums/vstudio/en-US/7313191a-10db-4a16-9cdd-de9fb80b378a/com-interop-base-class-properties-not-exposed-to-com?forum=csharpgeneral

(Santiago Burbano) #32


yes I am aware of the limitation with COM interface inheritance in .NET. Thanks anyway. :slight_smile:

Correct, forward declarations are created by the importer. I tested and placed the forward declaration of IHHCadObject before the forward declaration of IHHCadLayer, but the error remains.

It is necessary that interfaces are completely defined (a forward declaration is not sufficient) before they can be used as a base interface.

Before upgrading to version 6, we had never run into this problem. We have been using Hydra for many years now. So I suspect you might already have some code in place to determine the definition order, which broke with version 6.

Since we do import a lot of .NET interfaces into Delphi using Hydra, I think it is rather unlikely that we have been so ‘lucky’ for all these years and all those interfaces were generated in the correct order.

Let me know if you still need the C# and the generated .pas file.


(antonk) #33

We recreated from scratch the importer for reasons of maintainability. So it seems some features were lost in the process.

It would be good to have them for testing purposes.

(Santiago Burbano) #34

we have sent the file to your support channel.

(RemObjects) #35

bugs://81842 got closed with status fixed.

(Santiago Burbano) #36

Great! :slight_smile:
Lets us know when a new beta containing the fixes is available so we can test.


(Santiago Burbano) #37


when will a new beta with the fixes become available?


(antonk) #38

By the end of this week (Island plugins are being reworked, so if we’d build Beta now they would be broken).

You can drop a mail to support@ with your remobjects.com account name and we’ll provide you a pre-Beta build

(marc hoffman) #39

I’ve uploaded the latest build for you.

(Santiago Burbano) #40


we tested the latest beta: RemObjects Hydra - and importing the .NET interfaces is working fine again. :wink:

Thank you!

When will the next (non-beta) version be released?