次の方法で共有


Starting a MAPI Session

Applies to: Office 2010 | Outlook 2010 | Visual Studio

Although there is a significant amount of work performed during session start up, the required tasks are minimal. Much of this work is done in the MAPI processing of the MAPIInitialize and MAPILogonEx calls. Both of these functions accept flags as input parameters for controlling aspects of the session such as notification handling and the user interface. It is important to understand the consequences of setting each of these flags when calling MAPIInitialize to initialize the MAPI libraries and MAPILogonEx to log on to the MAPI subsystem.

To start a MAPI session

  1. Call MAPIInitialize to initialize the standard set of MAPI libraries.

  2. If you need to use the OLE libraries, call the OLE function OleInitialize.

  3. If you need to use the MAPI utility library, call ScInitMapiUtil.

  4. Call MAPILogonEx with a valid profile to log on to the MAPI subsystem. MAPILogonEx verifies the configuration of each of the service providers in the message services included in the profile, prompting the user for additional information if necessary and possible. When MAPILogonEx completes, the configured service providers are ready for service.

In This Section