IFilterGraph2::AddSourceFilterForMoniker method (strmif.h)
AddSourceFilterForMoniker method creates a source filter from an IMoniker pointer and adds the filter to the graph. For example, you can obtain a moniker for a system device, such as a video capture device, and add a video capture filter for that device. (For more information about system device monikers, see the ICreateDevEnum interface.)
HRESULT AddSourceFilterForMoniker( IMoniker *pMoniker, IBindCtx *pCtx, LPCWSTR lpcwstrFilterName, IBaseFilter **ppFilter );
Pointer to the IMoniker interface.
Pointer to an IBindCtx bind context interface.
Name for the filter.
Receives a pointer to the source filter's IBaseFilter pointer. The caller must release the interface.
Returns and HRESULT value. Possible values include the following.
||Success; but the specified name was a duplicate, so the Filter Graph Manager modified the name.|
||Failed to add a filter with a duplicate name.|
||The source filter for could not be loaded.|
||The media type of this file is not recognized.|
The Filter Graph Manager holds a reference count on the filter until the filter is removed from the graph or the Filter Graph Manager is released.
IBaseFilter *pSource = NULL; IMoniker *pMoniker = NULL;
|Minimum supported client||Windows 2000 Professional [desktop apps only]|
|Minimum supported server||Windows 2000 Server [desktop apps only]|
|Header||strmif.h (include Dshow.h)|