I have following message while I am in debug mode in Visual studio 2010 Unhandled exception at 0x76c5f9e2 in test.exe: 0xC0000008: An invalid handle was specified.When I run this in regular mode I don’t get this error.
The debugger stops in close.c at this line
CloseHandle( (HANDLE)_get_osfhandle(fh) ) )
Does anyone have any sugestion how such error could be avoided?
Don’t handle this exception, but avoid the situation were you pass an invalid handle!
Edit:
In debug mode, the code gives you a hint that something is wrong. So you should fix that error instead of handle the exception afterwords!