I want to use delphi array function in C#.
My delphi code:
TIntegerArray = array of integer;
function Testarray(): TIntegerArray stdcall; export;
var
res: TIntegerArray2;
begin
SetLength(res, 10);
res[5] := 55;
Result := res;
end;
exports Testarray;
C# code:
[DllImport("GitaTele.dll", CallingConvention = CallingConvention.StdCall)]
public static extern int[] Testarray();
Shows me error:
Cannot marshal 'return value': Invalid managed/unmanaged type combination.
TIntegerArray2
while in C# you try to map this toint[]
. Howe is this supposed to work? – Quality Catalyst