Partager via


CBasePin::CheckConnect

 
Microsoft DirectShow 9.0

CBasePin::CheckConnect

The CheckConnect method determines whether a pin connection is suitable.

Syntax

  virtual HRESULT CheckConnect(
    IPin *pPin
);

Parameters

pPin

Pointer to the other pin's IPin interface.

Return Value

Returns one of the HRESULT values shown in the following table.

Value Description
S_OK Success.
VFW_E_INVALID_DIRECTION Pin directions are not compatible.

Remarks

This method is called on both pins at the start of the connection process. The connecting pin calls it from within the CBasePin::Connect method, and the receiving pin calls it from within the CBasePin::ReceiveConnection method.

Use this method to determine whether the pin specified by the pPin parameter is suitable for a connection. The base class returns an error if both pins have the same direction (both input, or both output). Derived classes can override this method to verify other features in the pin. For example, the CBaseOutputPin class queries the input pin for its IMemInputPin interface.

If this method fails, the connection fails and the pin calls the CBasePin::BreakConnect method. Use BreakConnect to free any resources obtained in CheckConnect. For example, if CheckConnect calls the QueryInterface method, BreakConnect must release the interface.

Requirements

**  Header:** Declared in Amfilter.h; include Streams.h.

**  Library:** Use Strmbase.lib (retail builds) or Strmbasd.lib (debug builds).

See Also