Make sure you are using the correct calling convention for your thread function. If you are using BeginThread, you cannot define the function as a STDCALL. BeginThread is basically a workaround for your thread function to use the delphi calling convention. My personal suggestion and preference for x86 is to use the standard WinAPI CreateThread and define your thread function as follows.
Function MyThreadFunction(p:Pointer):Cardinal; STDCALL;
Begin
//dostuff
Result:=0;
End;
__________________
"As the island of our knowledge grows, so does the shore of our ignorance." John Wheeler
|