D2000 VBApi - Opening and closing an object of D2000 system

Before work with any object, it is necessary to open it. Opening the object is provided by the procedure VBApiOpenObject.


Declaration
Declare Sub VBApiOpenObject Lib "vbapi.dll" Alias "_OpenObject@8" (ByRef name As String, ByRef ok As Long)

Parameters
name Name of object to open.
ok Return value - call success.

Return value
Value of the parameter ok.

Return value Description
0 Object opened.
1 Object does not exist.
2 No logged on user.
3 Unexpected internal error.
4 Incorrect parameters.

Description
When the particular object is opened for the first time, the physical communication of the interface with the process Server is processed. During another (duplicate) openings, the internal opening counter is incremented. Other openings, therefore, are processed immediately.


Closing the object is allowed by the procedure VBApiCloseObject. It decrements the internal counter. After the object is closed finally (for duplicate openings), it provides the physical closing the object.


Declaration
Declare Sub VBApiCloseObject Lib "vbapi.dll" Alias "_CloseObject@4" (ByRef name As String)

Parameters
name object name


Related pages:

Napíšte komentár