Chapter 3: Classes

int cGorillas = Gorilla::GetCount();
IApe *pApe = new Gorilla();
pApe->GetYourStinkingPawsOffMeYouDamnDirtyApe();
Charleton Heston, 1968

The previous chapter discussed the fundamentals of COM interfaces in general and the IUnknown interface in particular. The techniques for managing interface pointers from C++ were presented, and the de facto techniques for implementing IUnknown were discussed in detail. What was not mentioned was how clients typically get an initial interface pointer to an object, or how object implementors allow their objects to be discovered by external clients. This chapter illustrates how COM object implementations integrate into the COM runtime environment to allow clients to find or create objects of a given concrete type.

© 1998 by Addison Wesley Longman, Inc. All rights reserved.