DllLastError

Returns the most recent error returned by a DllCall to a Win32 API.

Syntax:

DllLastError()

Parameters:

none

Returns:

(i) most recent error returned by a DllCall.

 

If you call this function after using DllCall to call a Win32 API function which set a "last-error code" value (or another function which used the "SetLastError" API to set a last-error code), this function will return that value.

 

Example:


a0="Hello Dolly"
dllhandle=DllLoad(StrCat(DirWindows(1),"USER32.DLL"))
a1=DllCall(dllhandle, lpstr:"CharUpperA", lpstr:a0)
Message("Most recent DllCall error",DllLastError())
DllFree(dllhandle)
Message(a0, a1)
See Also:

DllCall, DllCallbackCreate, DllCallbackDestroy