Opening and Closing an Object

Opening and Closing an Object

D2000 VBApi - Opening and closing an object of the D2000 system

Before working 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 be opened.

ok

Return value - call successful.

Return value

Value of the parameter ok.

Return value

Description

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:

D2000 VBApi