How do I create a thread routine of a static member function
class Blah
{
static void WINAPI Start();
};
// ..
// ...
// ....
hThread = (HANDLE)_beginthre
Following is the compiling version:
class CBlah
{
public:
static unsigned int WINAPI Start(void*)
{
return 0;
}
};
int main()
{
HANDLE hThread = (HANDLE)_beginthreadex(NULL, 0, &CBlah::Start, NULL, NULL, NULL);
return 0;
}
Following are the changes required:
(1). Start() function should return unsigned int
(2). It should take a void* as the parameter.
EDIT
Deleted point (3) as per comment