Enums between hydra and Delphi7

Hello, I am creating a hydra interface for delphi 7. I am using version 6.2.101.1233 of Hydra.
First, when I import it into Delphi, I have no enumeration, I have to recreate them. I recreate them exactly the same, however, when I call my function, the “numeric” values of my enumeration do not match.

c#
public enum AccessMode
{
///


/// Undetermined value
///

AccessNone = 0,

    /// <summary>
    /// Access through Vidal expert
    /// </summary>
    VidalExpert = 1,

    /// <summary>
    /// Access through Tomcat Web service
    /// </summary>
    WebService = 2
}

Delphi:
AccessMode = (AccessNone = 0, VidalExpert = 1, WebService = 2);

If I pass the value “VidalExpert”, on the C # side I get a random value, often close to 300000 and not 1.
Any idea what I’m doing wrong? Perhaps an attribute ?

Hello

Could you create a testcase for this issue (both host and a simple plugin)?

Thanks in advance

I forced my enum with the byte type, and apparently I have no more worries.

On the low level enums are nothing more than a named constants. So if a wrong type is used on the low level (f.e. plugin sends enum value as a 2-byte value while host tries to read a 4-byte value) numeric values won’t match between host and plugin. That’s why explicitly setting base enum type helps in this case.