# EssGetApplicationState

Description

EssGetApplicationState() gets an application's state structure, which contains user-configurable parameters for the application.

Syntax

    ESS_FUNC_M EssGetApplicationState (hCtx, AppName, ppAppState);

ESS_HCTX_T | hCtx
ESS_STR_T | AppName
ESS_PPAPPSTATE_T | ppAppState

Parameters

hCtx | Essbase API context handle.
AppName | Application name.
ppAppState | Address of pointer to receive allocated application state structure.

Return Value

If successful, this function returns a pointer to an allocated application state structure in ppAppState.

Notes

- This function cannot be called for local applications; it can only be called for applications on the server.
- Memory allocated for ppAppState should be freed using EssFree().

Access

This function requires the caller to have at least read access (ESS_PRIV_READ) to the specified application.

Example

    ESS_FUNC_M
    ESS_GetAppState (ESS_HCTX_T      hCtx,
                     ESS_HINST_T     hInst
                    )
    {
       ESS_FUNC_M         sts = ESS_STS_NOERR;
       ESS_PAPPSTATE_T   AppState;
       ESS_STR_T         AppName;
       AppName = "Sample";
       sts = EssGetApplicationState (hCtx, AppName,
             &AppState);
       if (!sts)
       {
          if (AppState)
          {
             EssFree (hInst, AppState);
          }
       }
       return (sts);
    }

See Also

EssGetApplicationInfo()
EssGetDatabaseState()
EssSetApplicationState()