IEnumConnections (Compact 2013)
3/26/2014
This interface enumerates the current connections for a connectable object. 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
When to Implement
To support connectable objects, you need to provide four related interfaces:
- IConnectionPointContainer
- IEnumConnectionPoints
- IConnectionPoint
- IEnumConnections
The IConnectionPointContainer interface indicates the existence of the outgoing interfaces.
It provides access to an enumerator subobject with the IEnumConnectionPoints interface. It also provides a connection point subobject with the IConnectionPoint interface.
The IConnectionPoint interface provides access to an enumerator subobject with the IEnumConnections interface.
To avoid circular reference counting problems, the connection point is a separate subobject.
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 to later call Release when those pointers are no longer needed.
When to Use
Use the IEnumConnectionPoints interface to enumerate all the supported connection points for each outgoing IID.
Methods in Vtable Order
IUnknown method |
Description |
---|---|
Returns pointers to supported interfaces. |
|
Increments the reference count. |
|
Decrements the reference count. |
Method |
Description |
---|---|
Creates another enumerator that contains the same enumeration state as the current one. |
|
Enumerates the next cConnections elements in the enumerator's list, returning them in rgpcd along with the actual number of enumerated elements in pcFetched. |
|
Instructs the enumerator to position itself at the beginning of the list of elements. |
|
Instructs the enumerator to skip the next cConnections elements in the enumeration so that the next call to IEnumConnections::Next will not return those elements. |
Remarks
To determine whether the platform supports this interface, see Determining Supported COM APIs.
Requirements
Header |
ocidl.h, |
Library |
ole32.lib, |
See Also
Reference
COM Interfaces
IConnectionPoint
IConnectionPointContainer
IEnumConnectionPoints