# EssSetApplicationState

Description

EssSetApplicationState() sets user-configurable parameters for the application using the application's state structure.

Syntax

    ESS_FUNC_M  EssSetApplicationState (hCtx, AppName, pAppState);

ESS_HCTX_T | hCtx
ESS_STR_T | AppName
ESS_PAPPSTATE_T | pAppState

Parameters

hCtx | Essbase API context handle.
AppName | Application name.
pAppState | Pointer to application state structure.

Return Value

None.

Notes

- When changing parameter values, it is advisable to call EssGetApplicationState() first to get the correct values of any parameters you do not wish to change.

Access

This function requires the caller to have Application Designer privilege (ESS_PRIV_APPDESIGN) for the specified application.

Example

    ESS_FUNC_M
    ESS_SetAppState (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)
          {
             /*****************************
              * Update AppState structure *
              *****************************/
             sts = EssSetApplicationState (hCtx,
                   AppName, AppState);
             EssFree (hInst, AppState);
       }
       return (sts);
    }

See Also

EssGetApplicationState()
EssSetDatabaseState()