The first step is to declare object variables for the ECI interfaces to be used.
Dim ECI As CclOECI
Dim Connect As CclOConn
Dim Flow As CclOFlow
Dim Buffer As CclOBuf
Dim UOW As CclOUOW
Sub ECILink_Click()
Set ECI = New CclOECI
Set Connect = New CclOConn
Set Flow = New CclOFlow
Set Buffer = New CclOBuf
Connect.Details "CICSNAME", "sysad", "sysad"
Buffer.SetString "Hello"
Connect.Link Flow, "ECIWTO", Buffer, UOW
Text1.Text = Buffer.String
Set Connect = Nothing
Set Flow = Nothing
Set Buffer = Nothing
End Sub
This example sends and receives a simple text string. In practice, the Buffer object would contain more complex data (for example C data structure). For binary data the Buffer.SetData and Buffer.Data methods are provided to allow the contents to be accessed as a Byte array.
A typical client application could access CICS through one or more Connect.Link calls and construct a 'business object' for use in end-user Basic programs. One approach to this would be to implement the 'business object' as a separate COM automation server containing the logic to process the contents of the CclOBuffer objects.