<< Back


FVSDK_NewSession

Synopsis

FVSDK_ERROR_CODE FVSDK_NewSession(FVSDK_Session** ppNewSession);

Description

Dynamically allocates an FVSDK_Session on the heap and initializes it. When finished using the FVSDK_Session object, a corresponding call to FVSDK_FreeSession() must be made to release the pointer returned by this function.

Parameters

ppNewSession

A pointer to a pointer that will receive the pointer for the newly allocated session.

Return Value

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

Example

// session structure pointer
FVSDK_Session* pSession;

// allocate a new session in the SDK
if (FVSDK_NewSession(&pSession) == FVSDK_OK) {

    // ... do some work

    // close and release the session
    if (FVSDK_FreeSession(pSession) != FVSDK_OK) {

        // display an error message
        AfxMessageBox("Unable to free the session");

        // release the allocated session; it wasn't released
        delete pSession;
    } // if
} // if
else 
    AfxMessageBox("Unable to create the new session.");