EssGGetAPIContext

Description

EssGGetAPIContext() gets the Essbase API login context handle for the specified grid.

Syntax

ESSG_FUNC_M EssGGetAPIContext (hGrid, pEssHctx);

ESSG_HGRID_T hGrid
ESSG_PPVOID_T pEssHctx

Parameters

hGridHandle passed back from EssGNewGrid.
pEssHctxVariable for the return of the Essbase API context handle of the connected grid.

Return Value

If successful, returns ESSG_STS_NOERR.

Notes

Example

#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);
}

See Also

Using the Grid API Functions
Grid API Structures