다음을 통해 공유


IConnectionPointImpl Class

 

The latest version of this topic can be found at IConnectionPointImpl Class.

This class implements a connection point.

Syntax

template<class T, const IID* piid, class CDV = CComDynamicUnkArray>  
class ATL_NO_VTABLE IConnectionPointImpl : public _ICPLocator<piid>

Parameters

T
Your class, derived from IConnectionPointImpl.

piid
A pointer to the IID of the interface represented by the connection point object.

CDV
A class that manages the connections. The default value is CComDynamicUnkArray, which allows unlimited connections. You can also use CComUnkArray, which specifies a fixed number of connections.

Members

Public Methods

Name Description
IConnectionPointImpl::Advise Establishes a connection between the connection point and a sink.
IConnectionPointImpl::EnumConnections Creates an enumerator to iterate through the connections for the connection point.
IConnectionPointImpl::GetConnectionInterface Retrieves the IID of the interface represented by the connection point.
IConnectionPointImpl::GetConnectionPointContainer Retrieves an interface pointer to the connectable object.
IConnectionPointImpl::Unadvise Terminates a connection previously established through Advise.

Public Data Members

Name Description
IConnectionPointImpl::m_vec Manages the connections for the connection point.

Remarks

IConnectionPointImpl implements a connection point, which allows an object to expose an outgoing interface to the client. The client implements this interface on an object called a sink.

ATL uses IConnectionPointContainerImpl to implement the connectable object. Each connection point within the connectable object represents an outgoing interface, identified by piid. Class CDV manages the connections between the connection point and a sink. Each connection is uniquely identified by a "cookie."

For more information about using connection points in ATL, see the article Connection Points.

Inheritance Hierarchy

_ICPLocator

IConnectionPointImpl

Requirements

Header: atlcom.h

IConnectionPointImpl::Advise

Establishes a connection between the connection point and a sink.

STDMETHOD(Advise)(
    IUnknown* pUnkSink,
    DWORD* pdwCookie);

Remarks

Use Unadvise to terminate the connection call.

See IConnectionPoint::Advise in the Windows SDK.

IConnectionPointImpl::EnumConnections

Creates an enumerator to iterate through the connections for the connection point.

STDMETHOD(EnumConnections)(IEnumConnections** ppEnum);

Remarks

See IConnectionPoint::EnumConnections in the Windows SDK.

IConnectionPointImpl::GetConnectionInterface

Retrieves the IID of the interface represented by the connection point.

STDMETHOD(GetConnectionInterface)(IID* piid2);

Remarks

See IConnectionPoint::GetConnectionInterface in the Windows SDK.

IConnectionPointImpl::GetConnectionPointContainer

Retrieves an interface pointer to the connectable object.

STDMETHOD(GetConnectionPointContainer)(IConnectionPointContainer** ppCPC);

Remarks

See IConnectionPoint::GetConnectionPointContainer in the Windows SDK.

IConnectionPointImpl::m_vec

Manages the connections between the connection point object and a sink.

CDV m_vec;

Remarks

By default, m_vec is of type CComDynamicUnkArray.

IConnectionPointImpl::Unadvise

Terminates a connection previously established through Advise.

STDMETHOD(Unadvise)(DWORD dwCookie);

Remarks

See IConnectionPoint::Unadvise in the Windows SDK.

See Also

IConnectionPoint
Class Overview