レコードの配列をdll(delphi)に渡すことはできますか? 「私ができるレコードの配列をdelphi dllに渡す
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;
:
は私が入れたレコードを持っている共有DLL内でDelphiのユニット
TmyRecord = record
tgl : Double;
notes: shortstring;
end
TarrOfMyRecord = array[1..1000] of TmyRecord
(DLLとメインのアプリケーションで使用される)、私は機能を持っていますdllによって返されたsomeRecordの正しい値を得る。
おかげ
UPDATE: これは、メインアプリケーションでは私のコードです:
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;
は、DLLを呼び出すコードを表示します。また、現在のアプローチでは、DLLのすべてのユーザーがDelphiで作成されることを約束していますか?あなたはそれに満足していますか? –
@DavidHeffernan:はい..私はそれを認識しており、大丈夫です。 – abanas
関数はgetNotes(var someRecord:TArrOfMyRecord)として定義しますが、変数myRecord:TmyRecordを渡しますか?これはTypoですか? – Justmade