Search code examples
c#delphihydra

How to update Plugin for Hydra Interface


I'm using Hydra interface for Delphi host and .NET plugin. Here is IPlugin.cs. I want to add some more methods and functions inside both HydraInterface.pas and IPlugin.cs. But when I added new methods and implemented and when I debug, it stopped only at the IPlugin.cs and didn't connect to HydraInterface.pas. How can I update both C# Plugin and Delphi HydraInterface?

 [Guid("B6135CAD-BF01-491B-8BF3-2D5D3059E731")]
public interface IHostInterface : IHYCrossPlatformInterface
{       
    bool WriteByte(string parameterValue, byte value);
    bool WriteString(string parameterValue, string value);
    bool WriteLong(string parameterValue, int value);
}   

Here is HydraInterface.pas from Delphi side.

IHostInterface = interface;
IHostInterface = interface(IHYCrossPlatformInterface)
['{B6135CAD-BF01-491B-8BF3-2D5D3059E731}']
function WriteRegisterByte (const parameterValue:WideString; const value:Byte): boolean; safecall;
function WriteLong(const parameterValue:WideString; const value:integer): boolean;safecall;
function WriteString(const parameterValue:WideString; const value:WideString): boolean;safecall;

Solution

  • The order of declaration of methods in a COM interface is part of the binary interface. The order of method declaration is used to determine the layout of the COM interface vtable. The orders of declaration of the methods in your interfaces do not match, and you should correct that discrepancy.