Microsoft DirectX 9.0


The Connect method connects the pin to another pin. This method implements the IPin::Connect method.


HRESULT Connect(
    IPin *pReceivePin,
    const AM_MEDIA_TYPE *pmt



Pointer to the receiving pin's IPin interface.


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

Return Value

Returns an HRESULT value. Possible values include those in the following table.

Value Description
S_OK Success.
VFW_E_ALREADY_CONNECTED The pin is already connected.
VFW_E_NO_ACCEPTABLE_TYPES Could not find an acceptable media type.
VFW_E_NOT_STOPPED The filter is active and the pin does not support dynamic reconnection.
VFW_E_TYPE_NOT_ACCEPTED 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.

In the base class, this method tests whether the pin is already connected and whether the filter is stopped. It delegates the rest of the connection process to the CBasePin::AgreeMediaType method.

See Also