Jump to content
ertank

C#.NET to Delphi code conversion help needed

Recommended Posts

Hi,

 

There is a DLL that has demo project in C#.NET code that I would like to convert into Delphi

 

public struct AcquirerAmount
{
    public uint id;

    public ulong amount;
}


public struct InposEcrPayment
{
    public const ushort MAX_ACQUIRER_COUNT = 8;

    public ulong totalAmount;

    public uint totalCount;

    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
    public AcquirerAmount[] acquires;
}

 

So far I converted above struct as below but data incoming is not correct. I believe that Delphi conversion is not correct.

 

  TInposAcquirerAmount = packed record
    Id: UInt32;
    Amount: UInt64;
  end;

  TInposEcrPayment = packed record
    TotalAmount: UInt64;
    TotalCount: UInt32;
    Acquires: Array[0..7] of TInposAcquirerAmount;
  end;

 

Any help is appreciated.

 

Thanks & Regards,

Ertan

 

Share this post


Link to post

Problem was indeed the packed. Removing it solved the problem.

Thank you.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×