IEnumPins Interface


The IBaseFilter::EnumPins method returns this interface. It is based on the IEnumX protocol of the Component Object Model (COM).

Note that actions that cause the number of pins to change might cause the enumerator to fail.

When to Implement

This interface must be implemented and made available by the IBaseFilter::EnumPins method. The CBaseFilter::EnumPins member function automatically does this in the DirectShow™ class library and uses the CEnumPins class to create the enumerator object.

When to Use

This interface is normally used by the filter graph manager when connecting filters. It can, however, be used by an application that must find the pins associated with filters in the filter graph—for example, to add another filter to the graph.

Methods in Vtable Order
IUnknown methods Description
QueryInterface Returns pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IEnumPins methods Description
Next Puts pointers to IPin interfaces for the next pins into the specified array.
Skip Skips the specified number of pins.
Reset Resets the position to the beginning so that the next call to the IEnumPins::Next method returns, at a minimum, the first pin of the filter.
Clone Provides another enumerator, which is a duplicate of the current one.


IEnumPins::Clone

IEnumPins Interface

Makes a copy of the enumerator. This allows the calling application to retain two positions in the list of pins.

HRESULT Clone(
  IEnumPins ** ppEnum
  );

Parameters
ppEnum
[out] New enumerator, which is a copy of this enumerator.
Return Values

Returns an HRESULT value.


IEnumPins::Next

IEnumPins Interface

Places pointers to IPin interfaces into the specified array.

HRESULT Next(
  ULONG cPins,
  IPin ** ppPins,
  ULONG * pcFetched
  );

Parameters
cPins
[in] Number of pins to place.
ppPins
[out] Array in which to place the interface pointers.
pcFetched
[out] Actual number of pins placed in the array.
Return Values

Returns an HRESULT value.

Remarks

The interface returned by this method has had its reference count incremented. Be sure to use IUnknown::Release on the interface to decrement the reference count when you have finished using the interface.


IEnumPins::Reset

IEnumPins Interface

Resets the enumerator to the beginning so that the next call to the IEnumPins::Next method returns, at a minimum, the first pin of the filter.

HRESULT Reset(void);

Return Values

Returns an HRESULT value.


IEnumPins::Skip

IEnumPins Interface

Skips the specified number of pins.

HRESULT Skip(
  ULONG cPins
  );

Parameters
cPins
[in] Number of pins to skip.
Return Values

Returns an HRESULT value.

Remarks

This method affects the next call to the IEnumPins::Next method.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.