EssGGetAPIContext

Gets the API login context handle for the specified grid.

Syntax

ESSG_FUNC_M EssGGetAPIContext (hGrid, pEssHctx);
ParameterData TypeDescription

hGrid

ESSG_HGRID_T

Handle passed back from EssGNewGrid.

pEssHctx

ESSG_PPVOID_T

Variable for the return of the API context handle of the connected grid.

Notes

Return Value

If successful, returns ESSG_STS_NOERR.

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