The first step is to declare object variables for the EPI interfaces to be used, usually in the General Declarations section of a Visual Basic program.
Dim EPI As CclOEPI
Dim Terminal As CclOTerminal
Dim Session As CclOSession
Dim Screen As CclOScreen
Dim Field As CclOField
The required EPI objects are then instantiated using the Visual Basic New function. This can be done in the Form_Load subroutine or at a later stage in response to a user action.
Sub EPIConnect_Click()
'Create Ccl.EPI first to initialize EPI
Set EPI = New CclOEPI
'Create a terminal object and connect to CICS
Set Terminal = New CclOTerminal
Terminal.Connect "CICSNAME","",""
'Create a session object (defaults to synchronous)
Set Session = New CclOSession
End Sub