Island-Windows: what is the best way to consume a .NET class?

I haven’t tried but would like to learn from experienced users on this question. We could consume a .NET class inside Island-Windows in the following way:

  1. COM - wrap up the .NET class as a COM object
  2. DLL - wrap up the .NET class as a DLL

Else? What would be a neat and clean way?

Hydra.

Of course, Hydra would be a (best) option - but I thought Hydra currently doesn’t support Island Windows as Hydra HOST?

Hm, true, yes. then your only option for now would be to essentially do what Hydra would do — host the CLR yourself. sorry.

Understand. Could I get a quick hint - Which part of Hydra framework should I peek, in order to learn the trick of “hosting CLR”?

Eugene, can you help?

Hi,

you can review CLR support in Delphi sources

pls review Calling Managed .NET C# COM Objects from Unmanaged C++ Code article, it seems to be more suitable for you instead of porting Delphi stuff…

@EvgenyK
Thank you for the heads up. So it is COM. En… I don’t like the registration step that we have to register the COM DLL with the system. How does Hyda find a way to access .NET assembly without relying COM?

.NET Runtime Library for Delpih allows loading .NET assembly without registration. Maybe I should take a peek.

Hydra hosts the .NET runtime itself. You can have a look at how the Hydra/Delphi code does that and look at using the same APIs yourself, from Island.

1 Like

review code in THYFMXManagedModule.RegisterPlugins - it shows how to enumerate .NET types

1 Like

pls review Calling Managed .NET C# COM Objects from Unmanaged C++ Code sample.
it seems to be more suitable to you.

1 Like

Yes. This is exactly what I am looking for. Thank you very much!

1 Like