unclepauly 6 Light Poster

i am using CreateThread to, unsurprisingly, start a thread :p

is it possible to return a value? i need to return either true or false at least. ideally i need to return 0, 1 or 2 to indicate the success of certain things that go on inside the thread.

I am uising WaitForSingleObject to wait for the thread to terminate.

CreateThread returns a handle to the thread, so that doesnt help me. the last argument is the thread Id but this im sure cant help me either.

ThreadProc itself return a DWORD but this is only success or failure of the creation of the thread.

can it be done?

just after i posted i found GetExitCodeThread which looks like it will do what i want. sorry to bother you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.