Clients auslesen Fehler 1 Wrong Input Parameter
Das hab ich wie folgt gelöst. (Geht bestimmt schöner)
Delphi-Quellcode:
type
TClientId = array [0..30] of AnsiChar;
TWormClients = packed record
amount: Integer;
clientIds: array [0..16] of TClientId;
end;
PWormClients = ^TWormClients;
function worm_tse_listRegisteredClients(context: IntPtr; toSkip: Integer; clients: PWormClients): Integer; cdecl; external 'WormAPI.dll';
...
var
res, i: Integer;
clients: PWormClients;
tmp: AnsiString;
begin
res := worm_tse_listRegisteredClients(worm_context, 0, clients);
if (res <> 0) then
raise EWormException.Create(res);
for i := 0 to clients.amount - 1 do
begin
tmp := clients.clientIds[i];
// Mach was mit den ClientID´s
end;
end;