<< Back


FVSDK_CloseSession

Synopsis

FVSDK_ERROR_CODE FVSDK_CloseSession(FVSDK_Session* pSession);

Description

Close a session that was initialized with FVSDK_InitSession(). This function should only be called only when FVSDK_InitSession() is used to initialize a session. If FVSDK_NewSession() was used to create the session, use FVSDK_FreeSession() instead. FVSDK_CloseSession() releases all internal data for the session being passed in.

Parameters

pSession

A pointer to the FVSDK_Session to close.

Return Value

FVSDK_OK if the session was successfully closed; error codes can be found in FVSDK_ErrorCodes.h.

Example

// create the session structure
FVSDK_Session Session;

// initialize the structure
Session.nVersion = FVSDK_SESSION_CURRENT_VERSION;
Session.nSize    = sizeof(Session);

// initialize the session in the SDK
if (FVSDK_InitSession(&Session, FALSE) == FVSDK_OK) {

    // ... do some work

    // close the session
    if (FVSDK_CloseSession(&Session) != FVSDK_OK)
        AfxMessageBox("Unable to close the session");
} // if
else
    AfxMessageBox("Unable to initialize the session.");