Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
COM interface classes in DirectShow fall into the following groups: object creation and interface implementation. Class factory classes are provided for object creation, and other classes are provided to implement existing COM interfaces.
The COM utility classes include the following:
-
CClassFactory
-
CFactoryTemplate
The following illustration shows the relationship between the COM classes and the interfaces they implement.
CClassFactoryand CFactoryTemplateare implemented by the base classes to handle automatic instantiation of filters, pins, and other DirectShow COM objects. These classes provide a scaffolding for object construction that wraps the actual COM elements required to construct an object.
CClassFactory, located in Dllentry.cpp, inherits from CBaseObjectand implements the COM IClassFactoryinterface. This interface is used by CoCreateInstance, which instantiates a COM object by calling IClassFactory::CreateInstance, which, in turn, calls the static CreateInstancemember function in your derived class.
The base classes use CFactoryTemplateto provide CClassFactorywith a template containing the CLSID of your object and a pointer to the static CreateInstancefunction for your object class.