Calling C Main API Functions

This section describes calling API functions, using instance and context handles, and handling return code.

Function Declarations

The API uses the ESS_FUNC_M macro to declare C API functions. This declares them to be of type unsigned long for all supported platforms. You must also use this macro to declare any custom functions which you pass to the API, such as custom memory management or message handling functions.

Passing the Instance Handle or Context Handle

You must pass the instance handle returned by the initial call to EssInit() in calls to EssLogin() or EssTerm(). You must pass the context handle returned by EssLogin() in any function calls associated with a specific login.

Handling the Return Code

All Essbase API functions return a status code of type ESS_STS_T. A return code of zero indicates that the function was executed successfully, and a non-zero value indicates an error condition. A full list of error return constants is contained in the header file esserror.h. The corresponding message text is in messages.txt.

Note:

You should always check the return code from any Essbase API function. If the return code is non-zero, any pointers or values returned by the function are undefined.

Internal Message Handling

Essbase uses an internal message handling function for non-custom message hadling. If an error event is incountered under a 32-bit Windows system, a text error message is generated.