>>>
MSVC v6 help says _beginthreadex() is not supported / compatible for WIN98 or WIN2000 (only WIN95 and NT).
<<<
I'd never noticed that, so intrigued, I tried a little test...
Code:
#include <windows.h>
#include <stdio.h>
#include <process.h>
unsigned Counter;
unsigned __stdcall SecondThreadFunc( void* pArguments )
{
printf( "i tråd...\n" );
while ( Counter < 1000000 )
Counter++;
_endthreadex( 0 );
return 0;
}
void main()
{
HANDLE hThread;
unsigned threadID;
printf( "lave tråd...\n" );
hThread = (HANDLE)_beginthreadex( NULL, 0, &SecondThreadFunc, NULL, 0,
&threadID );
WaitForSingleObject( hThread, INFINITE );
printf( "tælle skulle være 1000000; er -> %d\n", Counter );
CloseHandle( hThread );
}
... works fine with Win 2000, VC 6.0 Pro.
I bet you haven't changed your project settings to multithreaded...