From: Kuba O. <ku...@ma...> - 2004-03-31 15:00:29
|
On Wednesday 31 March 2004 04:06 am, kevin lyda wrote: > GetLastError is returning 2 or 183 (FILE_NOT_FOUND and > ERROR_ALREADY_EXISTS respectively). it does this from the moment the > program starts running. Sure! Because you use it not the way it's supposed to be used. Call it *only* if an API has returned an error code (usually as the function return value). In your code, there's no API that would return an error code (you didn't call any APIs, that is) and as such your use of GetLastError() makes no sense whatsoever. You're getting the error that was probably triggered somewhere in the C library when it was looking for things. This has nothing to do with mingw, you should see same/similar behaviour whatever compiler you use. Just don't use GetLastError() when it doesn't make sense. Kuba |