Specifying a Profile During Simple MAPI Logon

A call to the MAPILogon function produces different results depending on whether you specify a profile name. Normally a profile name is required. If you specify NULL for the lpszProfileName parameter of the MAPILogon function, MAPI first checks for an existing shared session. If possible, the shared session is used. If there is no shared session or if it cannot be used, the call to MAPILogon will fail.

You can use this behavior to test for the presence of an existing shared session before creating one of your own.