Cisco Cisco Computer Telephony Integration Option 9.0 Developer's Guide

Page of 500
   
4-14
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions
Cisco CTI OS Release 7.2(1)
Chapter 4      Building Your Application
Using the C++ CIL and Static Libraries
This class must implement the method signatures for the events it expects to receive. When an event is 
fired from the event source, the corresponding method in your event sink class will be invoked, and you 
can perform your custom event handling code at that time. 
To subscribe for an event, the client must call the AtlAdvise()  method, specifying a pointer to the 
interface of the event source.
// Add event sink as event listener for the _IallEvents interface
HRESULT hRes 
AtlAdvise(m_pSession, m_EventSink.GetIDispatch(FALSE),                      
__uuidof(_IAllEvents), &m_dwEventSinkAdvise);
When the program run is complete, the client must unsubscribe from the event source, using the 
AtlUnadvise() method:
// Unsubscribe from the Session object for the _IAllEvents interface
HRESULT hRes = 
AtlUnadvise( m_pSession, __uuidof(_IAllEvents), m_dwEventSinkAdvise );
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.
  •
For a complete sample application that uses the CIL COM interface written in C++, see the 
Comphone sample application on the CTI OS CD.
Using the C++ CIL and Static Libraries
Note
All C++ applications using C++ CIL 7.1(1) must be built using Visual Studio .NET. Applications 
using C++ CIL 7.1(1) built with Visual C++ 6.0 are not supported.
The CTI OS Client Interface Library for C++ is the most powerful, object-oriented CTI interface for C++ 
developers.  It provides the same interface methods and events as the COM interface for C++, but will 
be more straightforward for C++ developers who are not experienced COM programmers, and will 
provide faster code execution.
The CIL interface for C++ is a set of C++ header files (.h), and static libraries compiled for the Win32 
platform (Windows NT, Windows 2000). The header files required to access the class definitions are 
located on the CTI OS SDK media in the CTIOSToolkit\Include\ directory, and the static libraries are 
located in the CTIOS Toolkit\Win32 CIL\Libs directory. 
Header Files and Libraries
The header files you will most likely require are all included in the main CIL header file, CIL.h, which 
you would want to include in your application. 
#include <Cil.h>