Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Declaring the Factory Template

The next step is to declare the factory template for your filter. A factory template is a C++ class that contains information for the class factory. In your DLL, declare a global array of CFactoryTemplate objects, one for each filter or COM component in your DLL. The array must be named g_Templates. For more information about factory templates, see How to Create a DirectShow Filter DLL.

The m_pAMovieSetup_Filter member of the factory template is a pointer to the AMOVIESETUP_FILTER structure described previously. The following example shows a factory template, using the structure given in the previous example:



CFactoryTemplate g_Templates[] = {
    {
        g_wszName,                      // Name.
        &CLSID_SomeFilter,              // CLSID.
        CSomeFilter::CreateInstance,    // Creation function.
        NULL,
        &sudFilterReg                   // Pointer to filter information.
    }
};
int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);


If you did not declare any filter information, m_pAMoveSetup_Filter can be NULL.

Related topics

How to Register DirectShow Filters

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.