CFactoryTemplate class

Provides a template for creating class factories.

In DirectShow, class factories are specialized using the CFactoryTemplate class, also called the factory template. Each class factory holds a pointer to a factory template. The factory template contains information about a COM object, including the object's class identifier (CLSID) and a pointer to a function that creates the object.

In your DLL, declare a global array of factory templates named g_Templates. Include one factory template for each object in the DLL. When the DllGetClassObject function makes a new class factory, it searches the array for a template with a matching CLSID. Assuming it finds one, it creates a class factory that holds a pointer to the matching template. When the client calls IClassFactory::CreateInstance, the class factory calls the instantiation function defined in the template.

For more information, see How to Create a DirectShow Filter DLL.

Public Member Variables Description
m_Name Name of the filter.
m_ClsID Pointer to the CLSID of the object.
m_lpfnNew Pointer to a function that creates an instance of the object.
m_lpfnInit Pointer to a function that gets called from the DLL entry point.
m_pAMovieSetup_Filter Pointer to an AMOVIESETUP_FILTER structure.
Public MethodsDescription
IsClassID Determines whether a CLSID matches this class template.
CreateInstance Calls the object-creation function for the class.




Combase.h (include Streams.h)



See also

Base Class Reference