I'm using Visual Studio c++ 2008.
since _beginthreadex() gives a compiling error:
error C2664: '_beginthreadex' : cannot convert parameter 3 from 'void *' to 'unsigned int (__stdcall *)(void *)'
I search this forum and Lance Perkins gave the following tip:
. Replace _beginthreadex with CreateThread, and cast the parameter "func" with "(PTHREAD_START_ROUTINE)func".
So my question is it safe to replace:
Code: Select all
hThread = (HANDLE) _beginthreadex(0, 0, func, args, 0, 0);
Code: Select all
hThread = (HANDLE) CreateThread(0, 0, (PTHREAD_START_ROUTINE)func, args, 0, 0);
BTW I did not try this.
thanks in advance,
Alvaro