Microsoft DirectX 9.0


The ReceiveConnection method accepts a connection from another pin. This method implements the IPin::ReceiveConnection method.


HRESULT ReceiveConnection(
    IPin *pConnector,
    AM_MEDIA_TYPE *pmt



Pointer to the connecting pin's IPin interface.


Pointer to an AM_MEDIA_TYPE structure that specifies the media type.

Return Value

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

Value Description
S_OK Success.
E_POINTER Null pointer argument.
VFW_E_ALREADY_CONNECTED The pin is already connected.
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 output pin calls this method on the input pin. If the input pin returns an error code, the connection fails.

In the base class, this method performs the following steps:

If all of these steps succeed, the method calls the CBasePin::CompleteConnect and SetMediaType methods to complete the connection. These methods store the media type and a pointer to the output pin.

If CheckConnect or CheckMediaType fail, the base class calls the CBasePin::BreakConnect method to break the connection and then returns an error code from ReceiveConnection.

See Also