IConnectionPointContainer::FindConnectionPoint

HRESULT FindConnectionPoint([in] REFIID riid , [out] IConnectionPoint **ppCP);

Asks the connectable object if it has a connection point for a particular IID, and if so, returns the IConnectionPoint interface pointer to that connection point. Upon successful return, the caller must call IConnectionPoint::Release when that connection point is no longer needed.

Note that this function is the QueryInterface equivalent for an object's outgoing interfaces, where the outgoing interface is specified with riid and where the interface pointer returned is always that of a connection point.

Argument

Type

Description

riid

REFIID

[in] A reference to the outgoing interface IID whose connection point is being requested.

ppCP

IConnectionPoint **

[out] The address of the caller's variable that is to receive the IConnectionPoint interface pointer to the connection point that manages the outgoing interface identified with riid. This is set to NULL on failure of the call; otherwise the caller must call IConnectionPoint::Release when the connection point is no longer needed.


Return Value

Meaning

S_OK

The call succeeded and *ppCP has a valid interface pointer.

E_POINTER

The address passed in ppCP is not valid (such as NULL).

E_UNEXPECTED

An unknown error occurred.

E_OUTOFMEMORY

There was not enough memory to carry out the operation, such as not being able to create a new connection point object.

CONNECT_E_NOCONNECTION

This connectable object does not support the outgoing interface specified by riid.


Comments E_NOTIMPL is not allowed as a return code for this member. Any implementation of IConnectionPointContainer must implement this method.