The IEnumConnections Interface

Any individual connection point can support enumeration of its known connections through IConnectionPoint::EnumConnections. The enumerator created by this function implements the interface IEnumConnections which deals with the type CONNECTDATA. Each CONNECTDATA structure contains the IUnknown * of a connected sink and the dwCookie that was returned by IConnectionPoint::Advise when that sink was connected. When enumerating connections through IEnumConnections, the enumerator is responsible for calling IUnknown::AddRef through the pointer in each enumerated structure, and the caller is responsible to later call IUnknown::Release when those pointers are no longer needed.

IDL:


[
uuid(B196B287-BAB4-101A-B69C-00AA00341D07)
    , object, pointer_default(unique)
]
interface IEnumConnections : IUnknown
    {
    typedef struct tagCONNECTDATA
        {
        IUnknown   *pUnk;
        DWORD       dwCookie;
        } CONNECTDATA;

    typedef struct tagCONNECTDATA *PCONNECTDATA;
    typedef struct tagCONNECTDATA *LPCONNECTDATA;

    HRESULT Next([in] ULONG cConnections
        , [out, max_is(cConnections)] CONNECTDATA *rgpcd
        , [out] ULONG *pcFetched);

    HRESULT Skip([in] ULONG cConnections);
    HRESULT Reset(void);
    HRESULT Clone([out] IEnumConnections **ppEnum);
    }