masg
July 20th, 2005, 02:40 AM
Hi,
GetLastError() returns ERROR_INVALID_HANDLE.
I create a thread, join the thread using waitforsingleobject.
Then, i have used GetExitCodeThread call to get the value.
GetExitCodeThread returns 0, which indicates this call is failed.
So, i used GetLastError call and this returns ERROR_INVALID_HANDLE.
I am not able to find what's causing this. Can anybody help in finding solution to this.
code:
h1 = CreateThread( NULL, l_dwStackSize, l_lpStAddr, l_lpParam, l_dwCreFlags, NULL ) ;
l_ret = WaitForSingleObject( h1, INFINITE);
nreturn += GetExitCodeThread(h1,lpExit);
nreturn = GetLastError();
Thanks in advance.
masg
GetLastError() returns ERROR_INVALID_HANDLE.
I create a thread, join the thread using waitforsingleobject.
Then, i have used GetExitCodeThread call to get the value.
GetExitCodeThread returns 0, which indicates this call is failed.
So, i used GetLastError call and this returns ERROR_INVALID_HANDLE.
I am not able to find what's causing this. Can anybody help in finding solution to this.
code:
h1 = CreateThread( NULL, l_dwStackSize, l_lpStAddr, l_lpParam, l_dwCreFlags, NULL ) ;
l_ret = WaitForSingleObject( h1, INFINITE);
nreturn += GetExitCodeThread(h1,lpExit);
nreturn = GetLastError();
Thanks in advance.
masg