Is it possible to pass an array of record to dll (delphi)?
I have a record that I put in a shared (used in dll and main apps) delphi unit
TmyRecord = record
tgl : Double;
notes: shortstring;
end
TarrOfMyRecord = array[1..1000] of TmyRecord
In the dll, I have a function:
function getNotes(var someRecord: TArrOfMyRecord):boolean; stdcall;
begin
someRecord[1].tgl:= now;
someRecord[1].notes:= 'percobaan';
someRecord[2].tgl:= now + 1;
someRecord[2].notes:= 'percobaan1';
return:= true;
end;
I can't get the right values of someRecord returned by dll.
Thanks
UPDATE: This is my code in main apps:
interface
function getNotes(var someRecord: TArrOfMyRecord):boolean; stdcall; external 'some.dll'
implementation
procedure somefunction;
var myRecord: TarrOfMyRecord;
i: integer;
begin
if getNotes(myRecord) then
for i:= 1 to 1000 do memo1.lines.add(myRecord[i].notes);
end;