Adding a terminal to CICS using Visual Basic

Note: These classes do not contain any specific support for 3270 data streams that contain DBCS fields. Data streams with a mixture of DBCS and SBCS fields are not supported.
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.

The CclOEPI object must be created first to initialize the Client daemon EPI. A CclOTerminal object can then be created, and a connection established to a specific CICS® server using the Terminal.Connect method. The first parameter to this method is the CICS server name (as configured in the Gateway initialization file), the other parameters specify additional connection details. See CICS Transaction Gateway: Programming Reference for additional information.
        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