To talk to COM objects you must use interfaces. The ECI and EPI COM libraries provide two interfaces per COM class.
The first interface is called IDispatch and is provided to support old Visual Basic applications and VBScript. A second interface, a Custom interface, is also provided for use by Visual Basic. This interface is faster than the IDispatch interface and it is recommended that you use this interface with Visual Basic. Each COM class provides an IDispatch interface and a Custom interface.
Visual Basic provides more than one way to create a COM object and select the interface to talk to that object. To create an object there are the CreateObject function and the New function. It is recommended that you use the New function to create objects in Visual Basic.
VBScript is simpler. It provides only one way to create an object, the CreateObject function, and you must use the IDispatch interface.
Set eci = CreateObject("Ccl.ECI")
Set eci = New CcloECI
Set connection = CreateObject("Ccl.Connect")
Set connection = New CcloConn
Note the two ways you can request the object class. When using CreateObject you specify a string called the Programmatic ID or ProgID for short. When using the New function you specify the Class name that is registered in the type library.
When using Visual Basic you have the choice of which interface you want to use. If you DIM your variable as Object, then you select the IDispatch interface. If you DIM your variable as the Class name then you will select the custom interface. To create a terminal object in Visual Basic you would use the code:
Dim Terminal as CclOTerminal
Set Terminal = New CclOTerminal
Dim Terminal as New CclOTerminal
Dim Terminal
Set Terminal = CreateObject("Ccl.Terminal")
No matter which interface you select or how the object is created, you use the objects identically in your program.