CheckConnect method determines whether a pin connection is suitable.
virtual HRESULT CheckConnect( IPin *pPin );
Pointer to the other pin's IPin interface.
Returns one of the HRESULT values shown in the following table.
||Pin directions are not compatible.
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.