次の方法で共有


IFilterGraph::AddFilter (Windows Embedded CE 6.0)

1/6/2010

This method adds a filter to the graph and names it by using the pName parameter.

Syntax

HRESULT AddFilter(
  IBaseFilter* pFilter,
  LPCWSTR pName
);

Parameters

  • pFilter
    [in] Filter to add to the graph.
  • pName
    [in] Name of the filter.

Return Value

Returns an HRESULT value that depends on the implementation. HRESULT can be one of the following standard constants, or other values not listed.

Value Description

E_FAIL

Failure.

E_POINTER

Null pointer argument.

E_INVALIDARG

Invalid argument.

E_NOTIMPL

Method is not supported.

S_OK or NOERROR

Success.

Remarks

The name of the filter can be NULL, in which case the filter graph manager will generate a name. If the name is not NULL and is not unique, this method will modify the name in an attempt to generate a new unique name. If this is successful, this method returns VFW_S_DUPLICATE_NAME. If it cannot generate a unique name, it returns VFW_E_DUPLICATE_NAME.

AddFilter calls the filter's IBaseFilter::JoinFilterGraph method to inform the filter that it has been added. AddFilter must be called before attempting to use the IGraphBuilder::Connect, IFilterGraph::ConnectDirect, or IGraphBuilder::Render method to connect or render pins belonging to the added filter.

Requirements

Windows Embedded CE Windows CE 2.12 and later
Note Microsoft DirectShow applications and DirectShow filters have different include file and Library requirements
For more information, see Setting Up the Build Environment, Version 2.12 requires DXPAK 1.0 or later

See Also

Reference

IFilterGraph Interface