Cisco Cisco Computer Telephony Integration Option 9.0 Developer's Guide

Page of 546
 
Chapter 4      Building Your Application
Using the C++ CIL and static libraries
4-24
Cisco ICM Software CTI OS Developer’s Guide Release 6.0(0)
The foregoing are all the Project Settings required for CTI OS. Click OK, and save 
your project settings. 
Subscribing for Events in C++
Events interfaces are provided in C++ using the publisher-subscriber model. To 
subscribe for events, you must create a callback class (event sink), or implement 
the event interface in your main class. The callback class can be derived from the 
Adapter classes defined in CIL.h, such as AllInOneEventsAdapter.h. 
To register for an event, you use the appropriate AddEventListener method on the 
Session object:
// Initialize the event sink
m_pEventSink = new CEventSink(&m_ctiSession, &m_ctiAgent, this);
// Add event sink as an event listener
m_ctiSession.AddAllInOneEventListener((IAllInOne *) m_pEventSink);
To remove an event listener (upon program termination), use the appropriate 
RemoveEventListener on the Session object:
// Tell session object to remove our event sink
m_ctiSession.RemoveSessionEventListener((IAllInOne *) m_pEventSink);
STLport 
The Cisco CTI OS Toolkit uses an independent version of the C++ Standard 
Template Library (STL) known as STLport.  A copy of STLport is provided with 
the Toolkit and is intended to be used by programmers using the toolkit in C++.
STLport is a multiplatform ANSI C++ Standard Library implementation. It is free, 
open-source product, featuring the following: 
Advanced techniques and optimizations for maximum efficiency 
Exception safety and thread safety 
Important extensions - hash tables, singly-linked list, rope 
There are absolutely no restrictions on STLport use in commercial projects, and 
no royalties are involved. There is no licensing fee.