Using the C Main API Functions

The Grid API functions are specific to the grid paradigm, and do not replace any of the functionality of the main Essbase API functions. Because of this operational separation, cases can arise where it is necessary to call Main API functions from within a Grid API program.

To call the Main API you need two pieces of information:

If you have not called EssGConnect and EssGNewGrid, but have called EssGInit, you can get the Essbase instance handle by calling EssGGetAPIInstance. This gives you access to the memory calls EssAlloc, EssFree, EssRealloc, and to the login calls EssLogin and EssAutoLogin.

After you have a valid grid handle and have connected, you can call EssGGetAPIContext to get a valid login context. You can then use this login context handle with any Essbase function that takes a login context handle. Be careful NOT to use the login context from the Grid API in any Essbase API functions that would change the login context. The functions that change the login context are EssLogin, EssAutoLogin, EssSetActive, and EssClearActive.

Handles and login contexts acquired through the main Essbase API cannot be used in the Grid API calls. If you want to use both the main Essbase API and the Grid API, you need to initialize and connect through the Grid API and use the handles and login contexts from the Grid API for the other Essbase functions.