Share via


IEnumFilters::Next

 
Microsoft DirectShow 9.0

IEnumFilters::Next

The Next method retrieves the specified number of filters in the enumeration sequence.

Syntax

  HRESULT Next(
  ULONG cFilters,
  IBaseFilter **ppFilter,
  ULONG *pcFetched
);

Parameters

cFilters

[in] Number of filters to retrieve.

ppFilter

[out] Array of size cFilters that is filled with IBaseFilter interface pointers. The caller must release the interfaces.

pcFetched

[out] Receives the number of filters retrieved. Can be NULL if cFilters is 1.

Return Values

Value Description
S_FALSE Did not retrieve as many filters as requested.
S_OK Success.
E_INVALIDARG Invalid argument.
E_POINTER Null pointer argument.
VFW_E_ENUM_OUT_OF_SYNC The graph has changed and is now inconsistent with the enumerator.

Remarks

If the method succeeds, the IBaseFilter pointers all have outstanding reference counts. Be sure to release them when you are done.

If the filter graph changes (for example, the application removes a filter), the enumerator is no longer be consistent with the graph, and the method returns VFW_E_ENUM_OUT_OF_SYNC. Discard any data obtained from previous calls to the enumerator, because it might be invalid. Update the enumerator by calling the IEnumFilters::Reset method. You can then call the Next method safely.

Requirements

Header: Declared in Strmif.h; include Dshow.h.

Library: Use Strmiids.lib.

See Also