The IFilterGraph2 interface adds new functionality to the IGraphBuilder and IFilterGraph interfaces. It inherits from both interfaces and exposes all their methods. This interface also includes a method to add a source for a moniker, and an improved version of the IFilterGraph::Reconnect method. For this reason, you should usually use IFilterGraph2 instead of the other two.
When to Implement
The filter graph implements this interface so it isn't intended that you implement it.
When to Use
Use this interface in applications that previously called IFilterGraph::Reconnect and in applications that need a source filter for a moniker.
Methods in Vtable Order
| IUnknown methods | Description |
| QueryInterface | Retrieves pointers to supported interfaces. |
| AddRef | Increments the reference count. |
| Release | Decrements the reference count. |
| IFilterGraph methods | Description |
| AddSourceFilterForMoniker | Adds a source for a moniker. |
| ReconnectEx | Specifies a pin and a media type to reconnect with. |
Adds a source for a moniker.
HRESULT AddSourceFilterForMoniker(
IMoniker *pMoniker,
IBindCtx *pCtx,
LPCWSTR lpcwstrFilterName,
IBaseFilter **ppFilter );
Returns an HRESULT value that depends on the implementation of the interface.
When adding a source filter for the given moniker to the graph, the COM IMoniker::BindToStorage member function will query for an IStream interface. If this fails, IMoniker::BindToObject will try to retrieve an IBaseFilter interface.
Specifies a pin and a media type to reconnect with.
HRESULT ReconnectEx(
IPin * ppin,
const AM_MEDIA_TYPE *pmt );
Returns an HRESULT value that depends on the implementation of the interface.
Like the IFilterGraph::Reconnect method, the ReconnectEx method schedules a reconnection of the pin with the pin it is currently connected to. By specifying a media type when this method is called, the pins don't have to check what type they were originally connected with or enumerate possible new types. This makes the reconnection more likely to succeed.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.