D2000 VBApi - Interface status detection

The interface D2000 VBApi is represented by a client process of the 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
okReturn value - interface status.
Return value
Value of the parameter ok.

Return valueDescription of the interface status
0Connected to the process D2000 Server and a user is logged on.
It is possible to use all another interface services.
1Not connected to the process D2000 Server.
2Connected to the process D2000 Server, but no user is logged on.
3Reconnection is not possible. It occurs, when the interface detects that the 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