Platform SDK: Exchange Server

Starting a MAPI Session

Like a server application, a client application uses profiles to log on to MAPI. However, a server application creates its own profile while a client application often uses the user's existing profile on the client computer. In other words, if the user is already logged onto Microsoft Exchange Server, the client application can obtain a MAPI session from a logged-on user. This means that the client application actually connects to an existing session, which makes its startup cleaner and faster.

You can set up your client application to log on and log off using its own MAPI session instead of connecting to an existing session (such as a Microsoft Exchange Client session). For example, the client application would be required to log on explicitly if no sessions are currently active. An application may also deny connection of other clients onto its session.

MAPI provides and displays a profile dialog box that allows a MAPI logon. This interface can be bypassed by using the appropriate MAPI flags, provided the client application knows the name and password of a profile to be used. Settings such as the profile name and user passwords are saved for each provider in the profile that resides in the registry on the user's computer. This occurs in Windows NT Server and in Windows 95. When the client application calls the MAPILogonEx function, MAPI first looks for a list of profiles in the registry on the client computer.