Hydra 6: Import of interfaces from .Net assemblies fails

delphi

(Bernd Maier) #1

Hello,

we have a problem with the import of interfaces from .net assemblies. Interface types are translated into << Unsupported Type >> (see below).
Are we doing something wrong?

Thanks,
Bernd

Source:

using RemObjects.Hydra.CrossPlatform;
using System;
using System.Runtime.InteropServices;

namespace Vehicles
{
    [Guid("9CA09E61-2F4E-4B0D-B231-AC61AB38DBFB"), ComVisible(true)]
    public interface ICar : IHYCrossPlatformInterface
    {
    }

    [Guid("6396FC41-BFEE-43E9-800A-D3B666A3EA6D"), ComVisible(true)]
    public interface IWheel : IHYCrossPlatformInterface
    {
        ICar Car { get; }
        double Diameter { get; set; }
    }
}

Result:

unit Hydra_Import;

{ This unit has been automatically created by Hydra. Any changes in this unit might be lost in automatic updates}

interface

uses
  uHYCrossPlatformInterfaces;

type
  ICar = interface;
  IWheel = interface;

  // Original name: Vehicles.ICar
  ICar = interface(IHYCrossPlatformInterface)
  ['{9CA09E61-2F4E-4B0D-B231-AC61AB38DBFB}']
  end;

  // Original name: Vehicles.IWheel
  IWheel = interface(IHYCrossPlatformInterface)
  ['{6396FC41-BFEE-43E9-800A-D3B666A3EA6D}']
    function get_Car: << Unsupported Type >>; safecall;
    function get_Diameter: Double; safecall;
    procedure set_Diameter(const value: Double); safecall;
    property Car: << Unsupported Type >> read get_Car;
    property Diameter: Double read get_Diameter write set_Diameter;
  end;

implementation
end.

Vehicles.zip (4.0 KB)


(DonaldShimoda) #3

I suggest you provide with is the type of car. Cant see in the code. Share the original dot net code.


(Bernd Maier) #4

Attached please find our test project: Vehicle.zip

Another problem is that the importer locks the assembly. So I have to close Delphi before I can recompile the solution.


(antonk) #5
  1. Missed types are clearly a bug. Working on it atm. As a workaround modify the imported .pas file

  2. Assembly files shouldn’t be locked. This can be probably caused by (1). I’ll investigate this and fix as well.

Sorry for the inconvenience.


(RemObjects) #6

Thanks, logged as bugs://81543


(RemObjects) #7

Thanks, logged as bugs://81544


(RemObjects) #8

bugs://81544 got closed with status fixed.


(RemObjects) #9

bugs://81543 got closed with status fixed.


(antonk) #10

Fixes will be available in the next Beta biuld