Call CreateThread (...) To specify the entry function of the created thread when the thread is created, this entry function can only be a global function or a static member function of a class.
The global function is easy to understand, but if the member function of the class must be a static member function, why,
Because a non-static member function of a class can only be called through the object of the class, but when the thread is created, it can get the object of the class and call the class's member function?
The static member function classes of the class are all, not exclusive to any one object of the class, so objects that do not create classes can also be called.
Global function Format:
DWORD WINAPI procname (lpvoid Lppara) {
}
The static function format of the class:
Static DWORD WINAPI procname (LPVOID Lppara);
Multithreaded programming review the Windows thread function must be a global function or a static function