![Copper Mountain Technologies PLANAR TR1300/1 Programming Manual Download Page 15](http://html1.mh-extra.com/html/copper-mountain-technologies/planar-tr1300-1/planar-tr1300-1_programming-manual_2666189015.webp)
7
Accessing the Application Object
To establish connection with the COM server application, create an object
reference in the client program. In COM programming the object reference needs
to be acquired preliminarily, to be used later to access the object functionality. To
define an object in Visual Basic perform the following:
1)
Declare a variable as an object;
2)
Assign the object to this variable.
To declare a variable, use
Dim
operator or other declaration statement (
Public,
Private
or
Static
). The variables used for references should be of the types
Variant,
Object,
or a type of a specific object. For example, the following three operators
declare
app
variable:
Dim app
Dim app as Object
Dim app as TR1300.Application
Dim app as TRVNA.Application
Use
Set
operator and
CreateObject
(
ObjectName, HostName
) function to assign a
specific object to a variable.
ObjectName
Automation object name is always equal to
“
TR1300.Application
”, “
TRVNA.Application
”
HostName
Network name of the PC hosting the COM server. This parameter
is not specified in case of a local server.
For example, the following operators create
Application
object and assign it to
app
variable:
Set app = CreateObject("TRVNA.Application")
Set app = CreateObject("TRVNA.Application", "Network_Name")
Set app = CreateObject("TRVNA.Application", "192.168.10.10")
Note
The first form of the operator is used to create the reference to the
local COM server, the second one is used to create the reference to
the remote DCOM server.