Chapter 12: Callback Interfaces and Connectable Objects

 < Free Open Study > 



Objectives:

  • Understand the distinction between inbound and outbound interfaces.

  • Learn how to implement callback interfaces.

  • Build VB and C++ event sinks.

  • Understand the architecture of connectable objects.

  • Understand ATL's support for connectable objects.

  • Get to know the IProvideClassInfo2 interface.

COM objects can be viewed as the worker grunts of an application. Clients create them and bombard them with requests, until they have deemed they are no longer necessary. In this chapter we investigate a number of ways in which a COM object can be given a voice of its own, allowing it to communicate with the client(s) making use of it. In other words, this chapter is about enabling bidirectional communications.

We begin by examining a simple (but non-standard) approach of establishing bidirectional communication using callback interfaces. Along the way, we will see how Visual Basic and C++ clients may create "sink" objects to listen to what a coclass has to say. From here, we move into the standard COM protocol for bidirectional communications: connectable objects. After seeing what happens under the hood using straight C++, we then make use of the various tools offered by ATL.



 < Free Open Study > 



Developer's Workshop to COM and ATL 3.0
Developers Workshop to COM and ATL 3.0
ISBN: 1556227043
EAN: 2147483647
Year: 2000
Pages: 171

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net