Hi,
habs inzwischen selbst gelöst. Falls es jemanden interessiert:
Allg. Typdeklaration
Code:
TDynArray = array of PChar;
TParameters = array [0..1] of TDynArray;
DLL:
Code:
Parameters: TParameters;
function SetParameters(pParameters: TDynArray): Boolean; cdecl;
var
a: Integer;
begin
for a := 0 to Length(pParameters) - 1 do begin
Parameters[0][a] := StrAlloc(StrLen(pParameters[a]) + 1);
StrCopy(Parameters[0][a], pParameters[a]);
end;
result := True;
end;
Hauptprogramm
Code:
Parameters: TDynArray;
SetLength(Parameters, 1);
Parameters[0] := StrAlloc(Length(EditSetParams.Text) + 1);
StrPCopy(Parameters[0], EditSetParams.Text + #0);
if not SetNeededParameters(Parameters) then
ShowMessage('could not set parameters');
for a := 0 to Length(Parameters) - 1 do begin
StrDispose(Parameters[a]);
end;
(voll das "Selbsthilfe"-Forum hier
)