usesgetlasterror

Description

Tells the caller that, if there is an error when calling that function, the caller can then call GetLastError to retrieve the error code.

Allowed on

Member of a module

Comments

The usesgetlasterror attribute can be set on a module entry point, if that entry point uses the Win32 function SetLastError to return error codes. The attribute tells the caller that, if there is an error when calling that function, the caller can then call GetLastError to retrieve the error code.

Example

[dllname("MyOwn.dll")] module MyModule
    {
    [entry("One"), usesgetlasterror, bindable, requestedit,
   propputref, defaultbind]
        void Func1 ([in]IUnknown * iParam1, [out] long * Param2) ;
    [entry("TwentyOne"), usesgetlasterror, hidden, vararg]
         SAFEARRAY (int) Func2 ([in, out] SAFEARRAY (variant) *varP) ;
. . .};