D2000 VBApi - Interface status detection

The interface D2000 VBApi is represented by a client process of D2000 system and is implemented as a dll library. When it is used by the program MS Excel, a situation, when several sheets (opened simultaneously) use this interface, can occur. As each sheet may be also opened separately, it must implement the interface initialisation. If the interface is, or has been initialized by other sheet, this operation is useless. Each sheet should, therefore, detect the state of the interface before its initialisation.
This is allowed by the procedure VBApiIsConnected that may be called at any moment.


Declaration
Declare Sub VBApiIsConnected Lib "vbapi.dll" Alias "_IsConnected@4" (ByRef ok As Long)

Parameters
ok Return value - interface status.

Return value
Value of the parameter ok.

Return value Description of the interface status
0 Connected to the process D2000 Server and a user is logged on.
It is possible to use all another interface services.
1 Not connected to the process D2000 Server.
2 Connected to the process D2000 Server, but no user is logged on.
3 Reconnection is not possible. It occurs, when the interface detects that D2000 Server is not running, or the connection was interrupted during the work. Restoring the connection is not possible.


Related pages:

Napíšte komentár