First Chance Exception
-
Hi, Im getting the following error while closing handle using CloseHandle() function. Can anyone please tell how to resolve this issue? First Chance Exception in test.exe(NTDLL.DLL):0xC0000008: Invalid Handle Thanks,
The error message is pretty clear no ? You are passing an invalid handle to the CloseHandle function. Use your debugger inspect what might be wrong.
Cédric Moonen Software developer
Charting control [v3.0] OpenGL game tutorial in C++ -
The error message is pretty clear no ? You are passing an invalid handle to the CloseHandle function. Use your debugger inspect what might be wrong.
Cédric Moonen Software developer
Charting control [v3.0] OpenGL game tutorial in C++no.In that folder,im having a image file and Using FindFirstFile function i got handle for that image file. After trying to close that handle the application is getting crashed and it is showing this error. wsprintf(szSearchFolder,"%s\\*.jpg","C:\\test"); hSearch = FindFirstFile (szSearchFolder, &Foldername); if (hSearch == INVALID_HANDLE_VALUE) { return ERR_FAILED; } CloseHandle(hSearch);
-
Hi, Im getting the following error while closing handle using CloseHandle() function. Can anyone please tell how to resolve this issue? First Chance Exception in test.exe(NTDLL.DLL):0xC0000008: Invalid Handle Thanks,
As Cedric said, you're passing an invalid handle to the function. Just because the value of the handle isn't INVALID_HANDLE_VALUE it doesn't mean the handle is valid. For example you might... - be using a handle someone else has already closed - you're using something uninitialised that contains some rubbish off the stack - you're overwriting the variable containing the HANDLE value with a wild pointer write - be doing something really perverse like
HANDLE h( reinterpret_cast( std::rand() ) );
So there's loads of ways a HANDLE can be invalid and not have a value of INVALID_HANDLE_VALUE. Cheers, Ash -
Hi, Im getting the following error while closing handle using CloseHandle() function. Can anyone please tell how to resolve this issue? First Chance Exception in test.exe(NTDLL.DLL):0xC0000008: Invalid Handle Thanks,
-
As Cedric said, you're passing an invalid handle to the function. Just because the value of the handle isn't INVALID_HANDLE_VALUE it doesn't mean the handle is valid. For example you might... - be using a handle someone else has already closed - you're using something uninitialised that contains some rubbish off the stack - you're overwriting the variable containing the HANDLE value with a wild pointer write - be doing something really perverse like
HANDLE h( reinterpret_cast( std::rand() ) );
So there's loads of ways a HANDLE can be invalid and not have a value of INVALID_HANDLE_VALUE. Cheers, Ash -
no.In that folder,im having a image file and Using FindFirstFile function i got handle for that image file. After trying to close that handle the application is getting crashed and it is showing this error. wsprintf(szSearchFolder,"%s\\*.jpg","C:\\test"); hSearch = FindFirstFile (szSearchFolder, &Foldername); if (hSearch == INVALID_HANDLE_VALUE) { return ERR_FAILED; } CloseHandle(hSearch);