EsbInit

Initializes the VB API and message database. The ESB_INIT_T structure passed to this function includes a number of initialization parameters, including the name of the message database, the flag indicating whether to use a customized error handler, the maximum message stack size to be used by this error handler, the name and location of your help file, and version number.

Syntax

EsbInit (pInit, phInst)
pInit  As ESB_INIT_T
phInst As Long
ParameterDescription

pInit

Pointer to VB API initialization structure.

phInst

Pointer to VB API instance handle.

Notes

Return Value

The ESB_INIT_T structure passed to this function includes a number of initialization parameters, including the name of the message database, error handler, the name and location of your help file, and version number.

EsbInit() returns an instance handle in phInst. The returned instance handle allows multiple applications to independently access the VB API (for DLLs only). The instance handle should be preserved and passed to the EsbLogin() and EsbTerm() functions.

Access

This function requires no special access.

Example

Declare Function EsbInit Lib "ESBAPIN.DLL" (Init As ESB_INIT_T, hInst As Long) As Long

Sub ESB_Init ()
   Dim hInst As Long
   Dim Init As ESB_INIT_T
   Dim sts As Long   ESB_FALSE = 0
   ESB_TRUE  = 1   '**********************
   ' Define init structure
   '********************** 
   Init.Version = ESB_API_VERSION
   Init.MaxHandles = 10
   Init.LocalPath = "C:\ESSBASE" 
   ' Use default message file 
   Init.MessageFile =""
   ' Use EsbGetMessage to retrieve 
   ' messages 
   Init.ClientError = ESB_TRUE
   Init.ErrorStack = 100    '******************* 
   ' Initialize the API
   '******************* 
   sts = EsbInit (Init, hInst)
End Sub

See Also