Microsoft DirectX 9.0


The GetConnected method retrieves the pin connected to this pin.


IPin *GetConnected(void);

Return Value

Returns a pointer to the other pin's IPin interface.


If the pin is not connected, this method returns NULL. Call the CBasePin::IsConnected method to determine whether the pin is connected.

The method does not call AddRef on the IPin interface, so the caller should not release the interface.

Example Code

Because the reference count is not incremented on the returned pointer, you can chain method calls together:

if (m_MyPin->IsConnected())

This coding pattern is very convenient; but as the example shows, you must be careful not to dereference a NULL pointer when the pin is unconnected.

See Also