I read on stackoverflow that when using the Windows API to start a thread _beginthreadex()
is preferred over CreateThread()
.
I am creating threads like this using CreateThread()
:
DWORD WINAPI ThreadFunc(void* data)
{
// code for the thread functionality.
}
HANDLE Multicast = CreateThread(NULL, 0, ThreadFunc, NULL, 0, NULL);
if (Multicast) { } // thread started successfully.
How do I do this with _beginthreadex()
rather than CreateThread()
?
Can anyone post an example?