Microsoft Windows CE 3.0  

IFilterGraph::AddFilter

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.

Adds a filter to the graph and names it by using the pNameparameter.

HRESULT AddFilter(
IBaseFilter *
pFilter, 
LPCWSTR
pName
);

Parameters

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

Return Values

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

E_FAIL Failure.
E_POINTER Null pointer argument.
E_INVALIDARG Invalid argument.
E_NOTIMPL Method isn't 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.

AddFiltercalls the filter's IBaseFilter::JoinFilterGraphmethod to inform the filter that it has been added. AddFiltermust be called before attempting to use the IGraphBuilder::Connect, IFilterGraph::ConnectDirect, or IGraphBuilder::Rendermethod to connect or render pins belonging to the added filter.