Error 6: invalid handle (GetLastError)

Started by
9 comments, last by frob 17 years, 7 months ago
One reason I've seen invalid handle is when you or the system is trying to write debugger messages and a debugger is not attached. Some libraries and tools (such as profiling tools) will call API functions before and after a function is called.


You really should be using it differently. After an API function fails, immediately call GetLastError() and store the result, then only use the stored value. You can pass the stored value to your Identify_Error() function. Alternatively, you might use Identify_Error( GetLastError() );

This topic is closed to new replies.

Advertisement