Thread return value...
-
Hi, I have trouble with variable where used in thread function. I defined thread function such as; UINT Processor(LPVOID lpParameter) { . . . return ulCOMObjReturnValue; } STDMETHODIMP COLAP::GetState(long SystemID) { . . . DWORD ulExitCode; bThreadState = ::GetExitCodeThread(pQueue->hThread, &ulExitCode); return ulExitCode; // Set return value } pQueue->hThread has thread id, but GetExitCodeThread() function can not return right value except debugging. Thank you for your responses.
-
Hi, I have trouble with variable where used in thread function. I defined thread function such as; UINT Processor(LPVOID lpParameter) { . . . return ulCOMObjReturnValue; } STDMETHODIMP COLAP::GetState(long SystemID) { . . . DWORD ulExitCode; bThreadState = ::GetExitCodeThread(pQueue->hThread, &ulExitCode); return ulExitCode; // Set return value } pQueue->hThread has thread id, but GetExitCodeThread() function can not return right value except debugging. Thank you for your responses.
return (DWORD)n; try this