Created
July 15, 2016 04:17
-
-
Save cdacamar/e0afb184ea68404c8b3437406464e033 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DWORD WINAPI DoThing( LPVOID ); | |
DWORD ThreadID; // why? | |
auto threadHandle = CreateThread( | |
NULL, // default security attributes | |
0, // default stack size | |
(LPTHREAD_START_ROUTINE) DoThing, | |
NULL, // no thread function arguments | |
0, // default creation flags | |
&ThreadID); // receive thread identifier | |
if( threadHandle == NULL ) // NULL is advisable here since HANDLE _could_ be just an int | |
{ | |
auto err = GetLastError(); | |
std::cout<<"CreateThread error: "<<err<<'\n'; | |
// quit here, presumabily | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment