# EssGetApplicationInfo

Description

EssGetApplicationInfo() gets an application's information structure, which contains non user-configurable parameters for the application.

Syntax

    ESS_FUNC_M EssGetApplicationInfo (hCtx, AppName, ppAppInfo);

ESS_HCTX_T | hCtx
ESS_STR_T | AppName
ESS_PPAPPINFO_T | ppAppInfo

Parameters

hCtx | Essbase API context handle (logged in)
AppName | Application name
ppAppInfo | Address of pointer to receive allocated application info structure

Return Value

If successful, this function returns a pointer to an allocated application info structure in ppAppInfo.

Notes

- This function can only be called for applications on the server.
- The memory allocated for ppAppInfo 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_GetAppInfo (ESS_HCTX_T       hCtx,
                    ESS_HINST_T      hInst
                   )
    {
       ESS_FUNC_M        sts = ESS_STS_NOERR;
       ESS_PAPPINFO_T   AppInfo;
       ESS_USHORT_T     ind;
       ESS_STR_T        AppName;
       AppName = "Sample";

       sts = EssGetApplicationInfo (hCtx, AppName, &AppInfo);
       if (!sts)
       {
          if (AppInfo)
          {
             printf ("\r\n-------Application Info-------\r\n\r\n");
             printf ("Name            : %s\r\n", AppInfo->Name);
             printf ("Server Name     : %s\r\n", AppInfo->Server);
             printf ("Status          : %d\r\n", AppInfo->Status);
             printf ("Users Connected : %d\r\n", AppInfo->nConnects);
             printf ("Number of DBs   : %d\r\n", AppInfo->nDbs);
             printf ("\r\n--List of Databases--\r\n\r\n");
             for (ind = 0; ind < AppInfo->nDbs; ind++)
                printf ("database(%d)    : %s\r\n", ind,
                         AppInfo->DbNames [ind]);
             EssFree (hInst, AppInfo);
          }
       }

      return (sts);
    }

See Also

EssGetApplicationInfoEx()
EssGetApplicationState()
EssGetDatabaseInfo()