ReactOS  0.4.12-dev-51-ge94618b
ATL::IConnectionPointImpl< T, piid, CDV > Class Template Reference

#include <atlcom.h>

Inheritance diagram for ATL::IConnectionPointImpl< T, piid, CDV >:
Collaboration diagram for ATL::IConnectionPointImpl< T, piid, CDV >:

Public Member Functions

 ~IConnectionPointImpl ()
 
STDMETHOD() _LocCPQueryInterface (REFIID riid, void **ppvObject)
 
STDMETHOD() GetConnectionInterface (IID *piid2)
 
STDMETHOD() GetConnectionPointContainer (IConnectionPointContainer **ppCPC)
 
STDMETHOD() Advise (IUnknown *pUnkSink, DWORD *pdwCookie)
 
STDMETHOD() Unadvise (DWORD dwCookie)
 
STDMETHOD() EnumConnections (IEnumConnections **ppEnum)
 
- Public Member Functions inherited from ATL::_ICPLocator< piid >
virtual ULONG STDMETHODCALLTYPE AddRef ()=0
 
virtual ULONG STDMETHODCALLTYPE Release ()=0
 

Public Attributes

CDV m_vec
 

Private Types

typedef CComEnum< IEnumConnections, &IID_IEnumConnections, CONNECTDATA, _Copy< CONNECTDATA > > CComEnumConnections
 

Detailed Description

template<class T, const IID * piid, class CDV = CComDynamicUnkArray>
class ATL::IConnectionPointImpl< T, piid, CDV >

Definition at line 1191 of file atlcom.h.

Member Typedef Documentation

◆ CComEnumConnections

template<class T, const IID * piid, class CDV = CComDynamicUnkArray>
typedef CComEnum<IEnumConnections, &IID_IEnumConnections, CONNECTDATA, _Copy<CONNECTDATA> > ATL::IConnectionPointImpl< T, piid, CDV >::CComEnumConnections
private

Definition at line 1193 of file atlcom.h.

Constructor & Destructor Documentation

◆ ~IConnectionPointImpl()

template<class T, const IID * piid, class CDV = CComDynamicUnkArray>
ATL::IConnectionPointImpl< T, piid, CDV >::~IConnectionPointImpl ( )
inline

Definition at line 1197 of file atlcom.h.

1198  {
1199  IUnknown **x;
1200 
1201  for (x = m_vec.begin(); x < m_vec.end(); x++)
1202  if (*x != NULL)
1203  (*x)->Release();
1204  }
smooth NULL
Definition: ftsmooth.c:416
INT x
Definition: msvc.h:62

Member Function Documentation

◆ _LocCPQueryInterface()

template<class T, const IID * piid, class CDV = CComDynamicUnkArray>
STDMETHOD() ATL::IConnectionPointImpl< T, piid, CDV >::_LocCPQueryInterface ( REFIID  riid,
void **  ppvObject 
)
inlinevirtual

Implements ATL::_ICPLocator< piid >.

Definition at line 1206 of file atlcom.h.

1207  {
1208  IConnectionPointImpl<T, piid, CDV> *pThis;
1209 
1210  pThis = reinterpret_cast<IConnectionPointImpl<T, piid, CDV>*>(this);
1211 
1212  ATLASSERT(ppvObject != NULL);
1213  if (ppvObject == NULL)
1214  return E_POINTER;
1215 
1217  {
1218  *ppvObject = this;
1219  pThis->AddRef();
1220  return S_OK;
1221  }
1222  else
1223  {
1224  *ppvObject = NULL;
1225  return E_NOINTERFACE;
1226  }
1227  }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define ATLASSERT(x)
Definition: CComVariant.cpp:9
REFIID riid
Definition: precomp.h:44
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI InlineIsEqualUnknown(REFGUID rguid1)
Definition: atlbase.h:336
const GUID IID_IConnectionPoint
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365
nsrefcnt AddRef()
#define InlineIsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:137

◆ Advise()

template<class T, const IID * piid, class CDV = CComDynamicUnkArray>
STDMETHOD() ATL::IConnectionPointImpl< T, piid, CDV >::Advise ( IUnknown pUnkSink,
DWORD pdwCookie 
)
inline

Definition at line 1245 of file atlcom.h.

1246  {
1247  IUnknown *adviseTarget;
1248  IID interfaceID;
1249  HRESULT hResult;
1250 
1251  if (pdwCookie != NULL)
1252  *pdwCookie = 0;
1253  if (pUnkSink == NULL || pdwCookie == NULL)
1254  return E_POINTER;
1255  GetConnectionInterface(&interfaceID); // can't fail
1256  hResult = pUnkSink->QueryInterface(interfaceID, reinterpret_cast<void **>(&adviseTarget));
1257  if (SUCCEEDED(hResult))
1258  {
1259  *pdwCookie = m_vec.Add(adviseTarget);
1260  if (*pdwCookie != 0)
1261  hResult = S_OK;
1262  else
1263  {
1264  adviseTarget->Release();
1265  hResult = CONNECT_E_ADVISELIMIT;
1266  }
1267  }
1268  else if (hResult == E_NOINTERFACE)
1269  hResult = CONNECT_E_CANNOTCONNECT;
1270  return hResult;
1271  }
STDMETHOD() GetConnectionInterface(IID *piid2)
Definition: atlcom.h:1229
#define E_NOINTERFACE
Definition: winerror.h:2364
#define CONNECT_E_ADVISELIMIT
Definition: olectl.h:252
#define CONNECT_E_CANNOTCONNECT
Definition: olectl.h:253
ULONG Release()
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define E_POINTER
Definition: winerror.h:2365
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ EnumConnections()

template<class T, const IID * piid, class CDV = CComDynamicUnkArray>
STDMETHOD() ATL::IConnectionPointImpl< T, piid, CDV >::EnumConnections ( IEnumConnections **  ppEnum)
inline

Definition at line 1290 of file atlcom.h.

1291  {
1292  CComObject<CComEnumConnections> *newEnumerator;
1293  CONNECTDATA *itemBuffer;
1294  CONNECTDATA *itemBufferEnd;
1295  IUnknown **x;
1296  HRESULT hResult;
1297 
1298  ATLASSERT(ppEnum != NULL);
1299  if (ppEnum == NULL)
1300  return E_POINTER;
1301  *ppEnum = NULL;
1302 
1303  ATLTRY(itemBuffer = new CONNECTDATA[m_vec.end() - m_vec.begin()])
1304  if (itemBuffer == NULL)
1305  return E_OUTOFMEMORY;
1306  itemBufferEnd = itemBuffer;
1307  for (x = m_vec.begin(); x < m_vec.end(); x++)
1308  {
1309  if (*x != NULL)
1310  {
1311  (*x)->AddRef();
1312  itemBufferEnd->pUnk = *x;
1313  itemBufferEnd->dwCookie = m_vec.GetCookie(x);
1314  itemBufferEnd++;
1315  }
1316  }
1317  ATLTRY(newEnumerator = new CComObject<CComEnumConnections>)
1318  if (newEnumerator == NULL)
1319  return E_OUTOFMEMORY;
1320  newEnumerator->Init(itemBuffer, itemBufferEnd, NULL, AtlFlagTakeOwnership); // can't fail
1321  hResult = newEnumerator->_InternalQueryInterface(IID_IEnumConnections, (void **)ppEnum);
1322  if (FAILED(hResult))
1323  delete newEnumerator;
1324  return hResult;
1325  }
#define ATLTRY(x)
Definition: atlcomcli.h:44
#define ATLASSERT(x)
Definition: CComVariant.cpp:9
const GUID IID_IEnumConnections
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
INT x
Definition: msvc.h:62
#define E_POINTER
Definition: winerror.h:2365

◆ GetConnectionInterface()

template<class T, const IID * piid, class CDV = CComDynamicUnkArray>
STDMETHOD() ATL::IConnectionPointImpl< T, piid, CDV >::GetConnectionInterface ( IID piid2)
inline

Definition at line 1229 of file atlcom.h.

1230  {
1231  if (piid2 == NULL)
1232  return E_POINTER;
1233  *piid2 = *piid;
1234  return S_OK;
1235  }
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ GetConnectionPointContainer()

template<class T, const IID * piid, class CDV = CComDynamicUnkArray>
STDMETHOD() ATL::IConnectionPointImpl< T, piid, CDV >::GetConnectionPointContainer ( IConnectionPointContainer **  ppCPC)
inline

Definition at line 1237 of file atlcom.h.

1238  {
1239  T *pThis;
1240 
1241  pThis = static_cast<T *>(this);
1242  return pThis->QueryInterface(IID_IConnectionPointContainer, reinterpret_cast<void **>(ppCPC));
1243  }
const GUID IID_IConnectionPointContainer
#define T
Definition: mbstring.h:31

◆ Unadvise()

template<class T, const IID * piid, class CDV = CComDynamicUnkArray>
STDMETHOD() ATL::IConnectionPointImpl< T, piid, CDV >::Unadvise ( DWORD  dwCookie)
inline

Definition at line 1273 of file atlcom.h.

1274  {
1275  IUnknown *adviseTarget;
1276  HRESULT hResult;
1277 
1278  adviseTarget = m_vec.GetUnknown(dwCookie);
1279  if (m_vec.Remove(dwCookie))
1280  {
1281  if (adviseTarget != NULL)
1282  adviseTarget->Release();
1283  hResult = S_OK;
1284  }
1285  else
1286  hResult = CONNECT_E_NOCONNECTION;
1287  return hResult;
1288  }
#define CONNECT_E_NOCONNECTION
Definition: olectl.h:251
ULONG Release()
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59

Member Data Documentation

◆ m_vec

template<class T, const IID * piid, class CDV = CComDynamicUnkArray>
CDV ATL::IConnectionPointImpl< T, piid, CDV >::m_vec

Definition at line 1195 of file atlcom.h.


The documentation for this class was generated from the following file: