Platform SDK: MAPI

MAPIERROR

The MAPIERROR structure provides detailed information about an error, typically generated by the operating system, MAPI, or a service provider.

Quick Info

Header file: MAPIDEFS.H

typedef struct _MAPIERROR 
{ 
     ULONG      ulVersion; 
     LPTSTR     lpszError; 
     LPTSTR     lpszComponent; 
     ULONG      ulLowLevelError; 
     ULONG      ulContext; 
 
} MAPIERROR, FAR * LPMAPIERROR; 
 

Members

ulVersion
Version number of the structure. The ulVersion member is used for future expansion and should be set to MAPI_ERROR_VERSION, which is currently defined as zero.
lpszError
Pointer to a string describing the error. This string will be in Unicode format if the ulFlags parameter to the method in which this structure is used is set to MAPI_UNICODE.
lpszComponent
Pointer to a string describing the component that generated the error. This string will be in Unicode format if the ulFlags parameter to the method in which this structure is used is set to MAPI_UNICODE.
ulLowLevelError
Low-level error value used only when the error to be returned is low-level.
ulContext
Value that represents the location within the component pointed to by the lpszComponent member that identifies where the error occurred.

Remarks

The MAPIERROR structure is used to describe error information. Clients and service providers pass a pointer to a MAPIERROR structure in the lppMAPIError parameter of the IMAPIProp::GetLastError method. GetLastError returns information about the previous error that has occurred to an object. Callers of GetLastError free the memory for the MAPIERROR structure by calling MAPIFreeBuffer.

The lpszComponent member can be used to map the component's Help file, if one exists. Service providers should limit the size of the component string to 30 characters so that it can easily be displayed in a dialog box. The ulContext member can also be used to refer to an online Help topic for common errors.

Because service providers are not required to provide detailed error information, clients should not expect any of the members of the MAPIERROR structure that are returned to contain valid data. However, at a minimum MAPI strongly recommends that providers specify information in the lpszComponent and ulContext members.

For more information about error handling in MAPI, see Error Handling.

See Also

IABLogon::GetLastError, IABProvider::Logon, IMAPIControl::GetLastError, IMAPIProp::GetLastError, IMAPISession::GetLastError, IMAPISupport::GetLastError, IMAPISupport::OpenAddressBook, IMAPISession::OpenAddressBook, IMAPITable::GetLastError, IMsgServiceAdmin::GetLastError, IMSLogon::GetLastError, IMSProvider::Logon, IProfAdmin::GetLastError, IProviderAdmin::GetLastError