CoCreateInstance
(for in-proc servers) works in two stages. First, it loads the DLL and calls DllGetClassObject
with the CLSID
you pass, asking for IClassFactory
interface. Second, it calls IClassFactory::CreateInstance
on the pointer thus obtained, with the IID
you pass.
The object that DllGetClassObject
knows how to create - the class factory - does not normally itself implement any interfaces other than IClassFactory
and, of course, IUnknown
.