Clients that need to create only one instance of a particular COM object call CoCreateInstance.
To support calling
combines parameters used in both calls:
LPVOID * ppv);
CoCreateInstance has one limitation when compared to
CoGetClassObject. It does not take an IID to specify which object creation interface to get. Recall that a class factory is a "type of" class object that implements interface
CoCreateInstance assumes the client wants an
IClassFactory interface and the object's class object is a class factory. Although this is OK for the majority of COM objects, occasionally a COM object supports a different object creation interface.
You must use
CoGetClassObject to get an object creation interface for class objects that do not implement
For this course, all our class objects will be class factories, that is they support