Deklariere die Funktion mal als
stdcall lass die Pointer-Casts weg.
Also so:
Delphi-Quellcode:
for y := 0 to Data.SubStrings - 1 do begin
ThreadHandle := BeginThread(nil, 0, @WorkerThreadFunc, y, 0, ThreadID);
ThreadData[y].ThreadHandle := ThreadHandle;
ThreadData[y].ThreadID := y;
end;
Delphi-Quellcode:
function WorkerThreadFunc(P: Pointer): Integer; stdcall;
var MyID: integer;
i: integer;
test: TStringList;
begin
MyID := Integer(P);
...