IPin::Connect method (strmif.h)

The Connect method connects the pin to another pin.

Applications should not call this method. Use IGraphBuilder methods instead. This method is called by the Filter Graph Manager to connect pins.


HRESULT Connect(
  [in] IPin                *pReceivePin,
  [in] const AM_MEDIA_TYPE *pmt


[in] pReceivePin

Pointer to the receiving pin's IPin interface.

[in] pmt

Pointer to an AM_MEDIA_TYPE structure that specifies the media type for the connection. Can be NULL.

Return value

Returns an HRESULT value. Possible values include the following.

Return code Description
The pin is already connected.
Cannot find an acceptable media type.
Pins cannot agree on a transport, or there is no allocator for the connection.
The filter is active and the pin does not support dynamic reconnection.
The specified media type is not acceptable.


The pmt parameter can be NULL. It can also specify a partial media type, with a value of GUID_NULL for the major type, subtype, or format.

This method verifies that the connection is possible. If the pin rejects the connection, the method fails. The connecting pin proposes media types by calling IPin::ReceiveConnection on the receiving pin.


Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header strmif.h (include Dshow.h)
Library Strmiids.lib

See also

Data Flow in the Filter Graph

Error and Success Codes

IPin Interface