Chapter 12
Since the dawn of COM in 1993, developers have been using incoming interfaces to call in to COM objects. Calling in to a COM object by using an incoming interface is a very natural thing to do—it's much like calling methods on a C++ class. Often, however, you want to have a COM object call back out to the client. Once most folks grasp the basic principle behind COM—interfaces and implementations should be treated separately—and understand how to call methods through a COM interface, the next question they ask is how to set up COM objects and clients so that the clients can get callback notifications. COM's connection points were created to answer this question. Though connection points were originally developed for Microsoft ActiveX controls developers, they are now particularly useful for Microsoft Visual Basic and VBScript programmers. In this chapter, we'll look at how two COM objects can set up this communication scheme in which an object written in ATL calls back to the client. We'll first examine how connections work, and then we'll see how ATL implements them.