tried a lot of examples and haven't succeeded I have a DLL writen in Delphi which export a function which have return a Array, and then import into C# application. A have success to work with one variable:
Delphi
function GetArrayData(var testArray : integer): WordBool; stdcall; export;
begin
testArray := 1;
Result := True;
end;
C#
[DllImport("some.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
static extern bool GetArrayData([Out] out IntPtr IntegerArrayReceiver);
private void GetButton_Click(object sender, EventArgs e)
{
unsafe
{
IntPtr IntegerArrayReceiver = IntPtr.Zero;
GetArrayData(out IntegerArrayReceiver);
textBoxData.Text = IntegerArrayReceiver.ToString();
}
Please can some one to transform this code to work with a Array. Mean export a array from Delphi and import to C# array. I have source for both Delphi and C# code.