IFilterMapper2::RegisterFilter

This method registers a filter, pins, and media types under a category.

HRESULT RegisterFilter(
  REFCLSID clsidFilter,
  LPCWSTR Name,
  IMoniker** ppMoniker,
  const CLSID* pclsidCategory,
  const OLECHAR* szInstance,
  const REGFILTER2* prf2
);

Parameters

  • clsidFilter
    [in] GUID of the filter. CoCreateInstance will be called with this GUID when the filter is instantiated.
  • Name
    [in] Descriptive name for the filter.
  • ppMoniker
    [in, out] Address of a pointer to a device moniker that determines where this filter's data will be written. This parameter will be set to NULL upon return.
  • pclsidCategory
    [in] Category of the filter to register.
  • szInstance
    [in] Unique identifier for the filter (can be the friendly name or the filter CLSID).
  • prf2
    [in] Pointer to a REGFILTER2 structure containing merit and pin information.

Return Values

Returns one of the following values.

Value Description
VFW_E_BAD_KEY Could not get registry key.
HRESULT_FROM_WIN32 Failure.
NOERROR Success.

Remarks

Specify the moniker in the ppMoniker parameter if you are registering a filter for a WDM/PnP (Windows Driver Model/Plug and Play) device. If ppMoniker is non-null, the moniker returned can be used to write additional private values in the property bag.

The pclsidCategory parameter defaults to CLSID_ActiveMovieFilters if NULL is passed in.

Set ppMoniker to NULL if you do not want to provide or receive the moniker.

Requirements

DirectShow applications and DirectShow filters have different include file and link library requirements. See Setting Up the Build Environment for more information.

OS Versions: Windows CE 2.12 and later. Version 2.12 requires DXPAK 1.0 or later.

See Also

IFilterMapper2 Interface

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.