This interface enumerates connection points. Connectable objects support the following features:
To support connectable objects, you need to provide four related interfaces:
The IConnectionPointContainer interface indicates the existence of the outgoing interfaces. It provides access to an enumerator sub-object with the IEnumConnectionPoints interface. It also provides a connection point sub-object with the IConnectionPoint interface. The IConnectionPoint interface provides access to an enumerator sub-object with the IEnumConnections interface.
The connection point is a separate sub-object to avoid circular reference counting problems.
A connectable object can be asked to enumerate its supported connection points through IConnectionPointContainer::EnumConnectionPoints. The resulting enumerator returned from this method implements the interface IEnumConnectionPoints, through which a client can access all the individual connection point sub-objects supported within the connectable object itself, where each connection point implements IConnectionPoint.
When enumerating connections through IEnumConnectionPoints, the enumerator is responsible for calling IUnknown::AddRef, and the caller is responsible for later calling IUnknown::Release when those pointers are no longer needed.
Use the IEnumConnectionPoints interface to enumerate all the supported connection points for each outgoing IID.
The prototypes of the methods are as follows:
HRESULT Next(
ULONG cConnections, //[in]Number of IConnectionPoint values
// returned in rgpcn array
IConnectionPoint **rgpcn,
//[out]Array to receive enumerated connection
// points
ULONG *pcFetched //[out]Pointer to the actual number of
// connection points returned in rgpcn array
);
HRESULT Skip(
ULONG cConnections //[in]Number of elements to skip
);
HRESULT Reset(void);
HRESULT Clone(
IEnumConnectionPoints **ppEnum //[out]Address of output variable
// that receives the
// IEnumConnectionPoints interface
// pointer
);
E_NOTIMPL is not allowed as a return value. If an error value is returned, no entries in the rgpcn array are valid on exit and require no release.
There is no guarantee that the same set of elements will be enumerated on each pass through the list, nor will the elements necessarily be enumerated in the same order. The exact behavior depends on the collection being enumerated. It is too expensive for some collections, such as files in a directory, to maintain a specific state.
The caller must release this new enumerator separately from the first enumerator.
Windows NT: Use version 4.0 or later.
Windows: Use Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in ocidl.h.
IConnectionPoint, IConnectionPointContainer, IEnumConnections, IEnumXxxx