Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 546
 
4-15
Cisco ICM Software CTI OS Developer’s Guide Release 6.0(0)
 
Chapter 4      Building Your Application
Using the COM CIL in Visual Basic
In the Project References menu, select the required COM DLLs by checking the 
appropriate check boxes. The required library names are:
CTIOSClient 1.0 Type Library.
CTIOSArguments 1.0 Type Library.
Click on the OK button to exit the Project Reference screen, and save your project. 
Registering for Events in Visual Basic
To start using the CTI OS Client Interface Library in your application, you will 
need to declare the Session object and register for events.
In your code window, you will also need to declare (Dim) the Session object, and 
register for COM events from it. The following sample code demonstrates the 
syntax required to declare the Session object and register for COM events in 
Visual Basic:
Dim WithEvents session As CTIOSCLIENTLib.session
In addition, you will need to tell Visual Basic to create the Session object when 
your application loads, and to destroy to Session object when your application 
closes: 
Private Sub Form_Load()
    Set session = New session
End Sub
Private Sub Form_Terminate()
    Set session = Nothing
End Sub
Your Visual Basic application now references the CTI OS Client Library and is 
registered to receive COM events. 
Next Steps
For detailed information on the CTI OS client start up and shut down 
sequence, see the section “Disconnecting from CTI OS Server”.
For detailed information on the CTI OS Client Interface Library objects, see 
Chapters 8 through 12.