usesgetlasterror

[module-attributes] module module-name
{[entry(entry-id)usesgetlasterror [, other-attributes]] return-typefunction-name(param-list);
};

Example

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

Remarks

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.

See Also

ODL File Syntax, ODL File Example, Generating a Type Library With MIDL, Differences Between MIDL and MKTYPLIB