IEnumConnections interface
Enumerates the current connections for a connectable object.
When to implement
To support connectable objects, you need to implement four related interfaces:
- IConnectionPointContainer
- IEnumConnectionPoints
- IConnectionPoint
- IEnumConnections
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.
Each connection point is a separate sub-object to avoid circular reference counting problems.
Any individual connection point can support enumeration of its currently known connections through IConnectionPoint::EnumConnections. The enumerator created by this method implements the interface IEnumConnections, which deals with the type CONNECTDATA. Each CONNECTDATA structure contains the IUnknown of a connected sink and the dwConnection that was returned by IConnectionPoint::Advise when that sink was connected. When enumerating connections through IEnumConnections, the enumerator is responsible for calling AddRef through the pointer in each enumerated structure, and the caller is responsible for calling Release when those pointers are no longer needed.
When to use
Use the IEnumConnections interface to enumerate the current connections.
Members
The IEnumConnections interface inherits from the IUnknown interface. IEnumConnections also has these types of members:
Methods
The IEnumConnections interface has these methods.
| Method | Description |
|---|---|
| Clone |
Creates a new enumerator that contains the same enumeration state as the current one. |
| Next |
Retrieves the specified number of items in the enumeration sequence. |
| Reset |
Resets the enumeration sequence to the beginning. |
| Skip |
Skips over the specified number of items in the enumeration sequence. |
Remarks
Connectable objects support the following features:
- Outgoing interfaces, such as event sets
- The ability to enumerate the IIDs of the outgoing interfaces
- The ability to connect and disconnect sinks to the object for those outgoing IIDs
- The ability to enumerate the connections that exist to a particular outgoing interface
Requirements
|
Minimum supported client |
Windows 2000 Professional [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows 2000 Server [desktop apps | Windows Store apps] |
|
Header |
|
|
IDL |
|
|
IID |
IID_IEnumConnections is defined as B196B287-BAB4-101A-B69C-00AA00341D07 |
See also