O'Reilly logo

ATL Internals: Working with ATL 8, Second Edition by Chris Sells, Brent Rector, Kirk Fertitta, Christopher Tavares

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Interface Maps

Chapter 4, “Objects in ATL,” discussed how ATL implements IUnknown, but it covered only AddRef and Release completely. This chapter takes a look first at the requirements that COM makes on an object’s implementation of QueryInterface and then at how ATL supports those requirements while still providing flexibility and extensibility.

Recall: COM Identity

From a client perspective, the rules of AddRef and Release are fairly stringent. Unless the client is careful about their use, objects can go away before expected or can stay around too long. However, the object is allowed to implement AddRef and Release in any number of ways, depending on how it wants to manage its own lifetime—for example, as a heap-based, stack-based, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required