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.
A version of this page is also available for
4/8/2010

To build a DirectShow filter, you must set up the proper environment and then follow the steps in this topic.

If you build a DirectShow filter, you must first set up your environment as described in Building DirectShow Applicationsin addition to performing the following steps:

  • Use the __stdcallcalling convention.

  • Set the entry-point symbol to DllMainCRTStartup@12.

  • If you implement the filter as a DLL, include a definition (.def) file that exports the DLL functions. The following is an example of a definition file. The filter's output file is assumed to be Filter.dll.

    Copy Code
    LIBRARY FILTER.DLL
    DESCRIPTION 'Description of my filter'
    EXPORTS 
    	DllGetClassObject  
    	DllCanUnloadNow  
    	DllRegisterServer  
    	DllUnregisterServer 
    

In addition, if you are using the DirectShow base classes, do the following:

  • Build the base class library.

  • Include the header file Streams.h.

  • For release builds, add the preprocessor flag RELEASE. For debug builds, add the preprocessor flag DEBUG.

  • Link to the following library files.

    Library File Description

    Strmiids.lib

    Exports class identifiers (CLSIDs) and interface identifiers (IIDs). All DirectShow applications require this library.

    Ole32.lib Ole32auth.lib Uuid.lib

    These are COM libraries that are typically required when building filters. Depending on the needs of you project, you may not need all these libraries.

See Also