In a number of places win32 API errors are attempted to be trapped with GetLastError, however this is invalid in VB6. Unless declared in a type library, all API calls are automatically followed by a call to GetLastError by the compiler and the result placed in Err.LastDllError, and a subsequent call no longer represents the error of the intended call, but of the hidden call. Err.LastDllError should be used in its place.
In a number of places win32 API errors are attempted to be trapped with GetLastError, however this is invalid in VB6. Unless declared in a type library, all API calls are automatically followed by a call to GetLastError by the compiler and the result placed in Err.LastDllError, and a subsequent call no longer represents the error of the intended call, but of the hidden call. Err.LastDllError should be used in its place.