Sets user-configurable parameters for the application using the application's state structure.
Syntax
EsbSetApplicationState (hCtx, AppName, pAppState) ByVal hCtx As Long ByVal AppName As String ByVal pAppState As ESB_PAPPSTATE_T
Parameter | Description |
---|---|
hCtx | VB API context handle. |
AppName | Application name. |
pAppState | Pointer to application state structure. |
Notes
When changing parameter values, it is advisable to call EsbGetApplicationState() first to get the correct values of any parameters you do not wish to change. For example, here is a way to disable connects:
Function ESB_DisableConnects(AppName As String) As Long Dim sts As Long Dim AppState As ESB_APPSTATE_T sts = EsbGetApplicationState(phCtx, AppName, AppState) If sts = 0 Then AppState.Connects = ESB_FALSE sts = EsbSetApplicationState(phCtx, AppName, AppState) End If ESB_SetApplicationState = sts End Function
The following parameters do not apply to aggregate storage databases: LockTimeout and lroSizeLimit.
Return Value
None.
Access
This function requires the caller to have Application Manager privilege (ESB_PRIV_APPDESIGN) for the specified application.
Example
Declare Function EsbSetApplicationState Lib "ESBAPIN" (ByVal hCtx As Long, ByVal AppName As String, AppState As ESB_APPSTATE_T) As Long Sub ESB_SetApplicationState () Dim sts As long Dim AppName As String Dim AppState As ESB_APPSTATE_T AppName = "Sample" AppState.Description = "This is a test application" AppState.Loadable = ESB_TRUE AppState.Autoload = ESB_TRUE AppState.Access = ESB_PRIV_APPCREATE AppState.Connects = ESB_TRUE AppState.Commands = ESB_TRUE AppState.Updates = ESB_TRUE AppState.Security = ESB_TRUE AppState.LockTimeout = 1000 '******************************** ' Set Application State structure '******************************** sts = EsbSetApplicationState (hCtx, AppName, AppState) End Sub
See Also