View Single Post
  #2  
Old 04-27-2020, 06:40
chessgod101's Avatar
chessgod101 chessgod101 is offline
Co-Administrator
 
Join Date: Jan 2011
Location: United States
Posts: 515
Rept. Given: 2,128
Rept. Rcvd 674 Times in 212 Posts
Thanks Given: 543
Thanks Rcvd at 795 Times in 162 Posts
chessgod101 Reputation: 500-699 chessgod101 Reputation: 500-699 chessgod101 Reputation: 500-699 chessgod101 Reputation: 500-699 chessgod101 Reputation: 500-699 chessgod101 Reputation: 500-699
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;
__________________
"Real knowledge is to know the extent of one's ignorance." Confucius
Reply With Quote
The Following 2 Users Say Thank You to chessgod101 For This Useful Post:
phroyt (04-28-2020), Rasmus (04-27-2020)