共用方式為


MAPIERROR

Applies to: Office 2010 | Outlook 2010 | Visual Studio

Provides detailed information about an error, typically generated by the operating system, MAPI, or a service provider.

Header file:

Mapidefs.h

typedef struct _MAPIERROR
{
  ULONG ulVersion;
  LPSTR lpszError;
  LPSTR 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 that describes 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 that describes 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 that is used only when the error to be returned is low-level.

  • ulContext
    Value that represents the location in 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

Reference

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

Concepts

MAPI Structures