MAPILogoff

Syntax

MAPILogoff(Session, UIParam, Flags, Reserved)

Remarks

Ends a session with the messaging system.

Argument

Explanation

Session

An opaque session handle whose value represents a session
with the messaging system. Session handles are returned by MAPILogon and invalidated by MAPILogoff.

UIParam

The parent window handle for the dialog box. A value of 0 (zero) specifies that any dialog box displayed is application modal.

Flags

Reserved for future use. This argument must be 0 (zero).

Reserved

Reserved for future use. This argument must be 0 (zero).


The following table lists the possible return values of the MAPILogoff function and their meanings.

Value

Name

Meaning

–5

MAPI_E_INSUFFICIENT_MEMORY

There was insufficient memory
to proceed. The session was not terminated.

–19

MAPI_E_INVALID_SESSION

An invalid session handle was
used for the Session argument.
The session was not terminated.

0

SUCCESS_SUCCESS

The function returned successfully.


Example

The following example begins and ends a Mail session.


Sub MAIN
MAPI_LOGON_UI = 1
Session = MAPILogon(0, "", "", MAPI_LOGON_UI, 0)
result = MAPILogoff(Session, 0, 0, 0)
End Sub