EssGGetAPIContext() gets the Essbase API login context handle for the specified grid.
ESSG_FUNC_M EssGGetAPIContext (hGrid, pEssHctx);
| ESSG_HGRID_T | hGrid |
| ESSG_PPVOID_T | pEssHctx |
| hGrid | Handle passed back from EssGNewGrid. |
| pEssHctx | Variable for the return of the Essbase API context handle of the connected grid. |
If successful, returns ESSG_STS_NOERR.
#include <essapin.h>
#include <essgapin.h>
ESSG_FUNC_M sts = ESS_STS_NOERR;
ESSG_INIT_T InitStruct;
ESSG_HANDLE_T Handle;
ESSG_PVOID_T EssHctx;
ESSG_HGRID_T hGrid;
InitStruct.ulVersion = ESSG_VERSION;
InitStruct.ulMaxRows = 1000;
InitStruct.ulMaxColumns = 200;
InitStruct.pfnMessageFunc = ESS_NULL;
InitStruct.pUserdata = ESS_NULL;
/* initializes EGAPI */
sts = EssGInit(&InitStruct, Handle);
if(!sts)
sts = EssGNewGrid(Handle, &hGrid);
/* connect the grid to a database on the server */
if(!sts)
sts = EssGConnect(hGrid, "Rainbow", "Admin",
"Password", "Demo",
"Basic", ESSG_CONNECT_DEFAULT);
/* Get API context handle for the specified grid */
if(!sts)
sts = EssGGetAPIContext(hGrid, &EssHctx);
}