UdoScheuvens
Programmer
I have the problem that GetLastError returns the error code "0" although the return value of the previous function call returned unsuccessful.
Example:
hInst = LoadLibrary("c:\test\xxx.dll"
lErr = GetLastError()
The library doesn't exist and so the function must fail.
If this code is written in VB, the results are:
hInst = 0
lErr = 0
The same code written in VC results in
hInst = 0
lErr = 1157 (ERROR_DLL_NOT_FOUND)
This effect occurs with many other API calls.
Does anybody know how to get the correct error code in VB?
Udo
Example:
hInst = LoadLibrary("c:\test\xxx.dll"
lErr = GetLastError()
The library doesn't exist and so the function must fail.
If this code is written in VB, the results are:
hInst = 0
lErr = 0
The same code written in VC results in
hInst = 0
lErr = 1157 (ERROR_DLL_NOT_FOUND)
This effect occurs with many other API calls.
Does anybody know how to get the correct error code in VB?
Udo