Return string array from a delphi dll
up vote
-1
down vote
favorite
I want to return string array from a delphi dll to delphi application. This is what i tried. But it gives Invalid pointer operation error. dll code type TStringArray = array of string; function GetDataArray(): TStringArray; stdcall; var D: TnxQuery; begin form1 := TForm1.Create(nil); result := form1.GetData; end; function TForm1.GetData: TStringArray; begin SetLength(result, 2); result[0] := 'AAA'; result[1] := 'BBB'; end; Delphi application code function GetDataArray(): TStringArray; stdcall; external 'Nx2Con.dll'; procedure TForm1.Button1Click(Sender: TObject); begin GetDataArray; end;
delphi dll delphi-xe2 delphi-2010
share | improve this qu