>
>You have to have declared GetLastError()
prior to the event that causes the error, otherwise, the DECLARE...DLL will clear the error pending. IOW, declare GetLastError()
before making the API call, and preferably, don't use the catchall Win32API, use KERNEL32.DLL instead, which is the actual provider (the Win32API catchall actually searches several .DLLs for the DLL function, which can be bad with GetLastError(), since the attempt to find the API function will create and clear an error status.)
Thanks Ed, I will investigate this,