Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

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:

The IConnectionPointContainerinterface indicates the existence of the outgoing interfaces.

It provides access to an enumerator subobject with the IEnumConnectionPointsinterface. It also provides a connection point subobject with the IConnectionPointinterface.

The IConnectionPointinterface provides access to an enumerator subobject with the IEnumConnectionsinterface.

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 CONNECTDATAstructure contains the IUnknownof a connected sink and the dwConnectionthat was returned by IConnectionPoint::Advisewhen that sink was connected.

When enumerating connections through IEnumConnections, the enumerator is responsible for calling AddRefthrough the pointer in each enumerated structure, and the caller is responsible to later call Releasewhen those pointers are no longer needed.

When to Use

Use the IEnumConnectionPointsinterface to enumerate all the supported connection points for each outgoing IID.

Methods in Vtable Order

IUnknown method Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments the reference count.

Release

Decrements the reference count.

Method Description

Clone

Creates another enumerator that contains the same enumeration state as the current one.

Next

Enumerates the next cConnectionselements in the enumerator's list, returning them in rgpcdalong with the actual number of enumerated elements in pcFetched.

Reset

Instructs the enumerator to position itself at the beginning of the list of elements.

Skip

Instructs the enumerator to skip the next cConnectionselements in the enumeration so that the next call to IEnumConnections::Nextwill not return those elements.

Remarks

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Requirements

Header ocidl.h, ocidl.idl
Library ole32.lib, uuid.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also