Quote Originally Posted by Codeplug View Post
>> what is the difference
AfxBeginThread is part of the MFC framework/library. If you use threading in an MFC application/dll, and that thread uses any other MFC objects/functions, then you should use AfxBeginThread.

AfxBeginThread uses _beginthreadex. This is the CRT's thread creation API. If your thread uses any of CRT fucntions, then it should use _beginthreadex to avoid certain types of memory leaks.

CreateThread is the OS interface for thread creation in user mode applications. So you have AfxBeginThread -> _beginthreadex -> CreateThread.

For each of the interfaces, you can get the thread handle for use in Win32 API functions. With the MFC interfaces, using the raw handle safely is a little more tricky as there are some rules that need to be followed.

gg

It is quite more complicated than pthreading
I had a look to msdn but docs there are very "disperse" One must read here and there and it's hard to have a good understanding of the subject
Are there some tutorials / example codes you would suggest?