Remobjects structures do not get created in hydra

(marcantheunis) #1

How do you define a structure in a .NET plugin so it can be used by a delphi host?

With .NET code below I get my 2 interfaces but not a delphi definition for TInputRequestPack

public struct TInputRequestPack
public string scanCode;
public bool allowInput;
public string cnk;
public string articleName;
public DateTime expDate;
public interface IWWKS2Communication : IHYCrossPlatformInterface
int add(int a, int b);
bool Connect(string host, int portnr);
int getState();
public interface IWWKS2PluginFeedback : IHYCrossPlatformInterface
int notifyStateChange(int newState);
int askInputRequest(ref TInputRequestPack pack);

result after import interface:

IWWKS2Communication = interface;
IWWKS2PluginFeedback = interface;

// Original Name: OffRobotWWKS2.IWWKS2Communication
IWWKS2Communication = interface(IHYCrossPlatformInterface)
function add(const a: LongInt; const b: LongInt): LongInt; safecall;
function Connect(const host: WideString; const portnr: LongInt): WordBool; safecall;
function getState: LongInt; safecall;

// Original Name: OffRobotWWKS2.IWWKS2PluginFeedback
IWWKS2PluginFeedback = interface(IHYCrossPlatformInterface)
function notifyStateChange(const newState: LongInt): LongInt; safecall;
function askInputRequest(var pack: TInputRequestPack): LongInt; safecall;

(antonk) #2

As expected. The recommended way of cross-platform interacting is via interfaces descended from IHYCrossPlatformInterface. It is possible to use structures but in this case it is up to you to define them Delphi-side. Plugin importer handles only interfaces (at least now).

I’ll log an issue to investigate if it is possible to manage structures as well.

(RemObjects) #3

Thanks, logged as bugs://80579