# EssInit

Description

EssInit() initializes the Essbase API and message database.

Syntax

    ESS_FUNC_M EssInit (pInitStruct, phInstance);

ESS_PINIT_T | pInitStruct
ESS_PHINST_T | phInstance

Parameters

pInitStruct | Pointer to Essbase API initialization structure
phInstance | Pointer to Essbase API instance handle

Return Value

The ESS_INIT_T structure passed to this function includes a number of initialization parameters, including the name of the message database, the maximum size of client buffer that can be allocated, pointers to the user-defined memory free allocation, error callback functions, the name and location of your help file, and version number.

EssInit() returns the phInstance instance handle that allows multiple applications to access the API independently (for DLLs only). The instance handle should be preserved and passed to EssLogin(), EssTerm() and the memory allocation functions.

Notes

- You must call this function before any other Essbase API functions.
- If any field in the initialization structure is NULL or zero (as appropriate), the API uses a default value for those parameters.

Access

This function requires no special access.

Example

    ESS_VOID_T ESS_Init()
    {
      ESS_HINST_T   hInst;
      ESS_INIT_T InitStruct =        /* Define init */
                            /* structure */
      {
        ESS_API_VERSION,       /* Version of API */
        USER,      /* user-defined message context */
        0,         /* max handles     */
        0L,        /* max buffer size */
        "C:\\ESSBASE", /* local path */
        /* The following parameters use defaults  */
        NULL,      /* message db path */
        NULL,      /* allocation function pointer */
        NULL,      /* reallocation function pointer */
        NULL,      /* free function pointer */
        NULL,   /* error handling function pointer */
        NULL,      /* path name of user-defined */
                   /* Application help file */
        NULL,      /* Reserved for internal use. */
                   /* Set to NULL */
      };
    /* Initialize the API  */
    if ((sts = EssInit (&InitStruct, &hInst)) != ESS_STS_NOERR)
    {
        /* error initializing API */
        exit ((ESS_USHORT_T) sts);
     }

See Also

EssLogin()
EssAutoLogin()
EssTerm()