ReactOS  0.4.15-dev-3165-gdf6fff7
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 1192 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 1194 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 1198 of file atlcom.h.

1199  {
1200  IUnknown **x;
1201 
1202  for (x = m_vec.begin(); x < m_vec.end(); x++)
1203  if (*x != NULL)
1204  (*x)->Release();
1205  }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define NULL
Definition: types.h:112

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 1207 of file atlcom.h.

1208  {
1209  IConnectionPointImpl<T, piid, CDV> *pThis;
1210 
1211  pThis = reinterpret_cast<IConnectionPointImpl<T, piid, CDV>*>(this);
1212 
1213  ATLASSERT(ppvObject != NULL);
1214  if (ppvObject == NULL)
1215  return E_POINTER;
1216 
1218  {
1219  *ppvObject = this;
1220  pThis->AddRef();
1221  return S_OK;
1222  }
1223  else
1224  {
1225  *ppvObject = NULL;
1226  return E_NOINTERFACE;
1227  }
1228  }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
REFIID riid
Definition: precomp.h:44
BOOL WINAPI InlineIsEqualUnknown(REFGUID rguid1)
Definition: atlbase.h:324
REFIID LPVOID * ppvObject
Definition: precomp.h:44
const GUID IID_IConnectionPoint
#define S_OK
Definition: intsafe.h:52
#define NULL
Definition: types.h:112
#define E_POINTER
Definition: winerror.h:2365
#define InlineIsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:142

◆ 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 1246 of file atlcom.h.

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

◆ EnumConnections()

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

Definition at line 1291 of file atlcom.h.

1292  {
1293  CComObject<CComEnumConnections> *newEnumerator;
1294  CONNECTDATA *itemBuffer;
1295  CONNECTDATA *itemBufferEnd;
1296  IUnknown **x;
1297  HRESULT hResult;
1298 
1299  ATLASSERT(ppEnum != NULL);
1300  if (ppEnum == NULL)
1301  return E_POINTER;
1302  *ppEnum = NULL;
1303 
1304  ATLTRY(itemBuffer = new CONNECTDATA[m_vec.end() - m_vec.begin()])
1305  if (itemBuffer == NULL)
1306  return E_OUTOFMEMORY;
1307  itemBufferEnd = itemBuffer;
1308  for (x = m_vec.begin(); x < m_vec.end(); x++)
1309  {
1310  if (*x != NULL)
1311  {
1312  (*x)->AddRef();
1313  itemBufferEnd->pUnk = *x;
1314  itemBufferEnd->dwCookie = m_vec.GetCookie(x);
1315  itemBufferEnd++;
1316  }
1317  }
1318  ATLTRY(newEnumerator = new CComObject<CComEnumConnections>)
1319  if (newEnumerator == NULL)
1320  return E_OUTOFMEMORY;
1321  newEnumerator->Init(itemBuffer, itemBufferEnd, NULL, AtlFlagTakeOwnership); // can't fail
1322  hResult = newEnumerator->_InternalQueryInterface(IID_IEnumConnections, (void **)ppEnum);
1323  if (FAILED(hResult))
1324  delete newEnumerator;
1325  return hResult;
1326  }
#define ATLTRY(x)
Definition: atlcomcli.h:44
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
const GUID IID_IEnumConnections
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LONG HRESULT
Definition: typedefs.h:79
#define NULL
Definition: types.h:112
#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 1230 of file atlcom.h.

1231  {
1232  if (piid2 == NULL)
1233  return E_POINTER;
1234  *piid2 = *piid;
1235  return S_OK;
1236  }
#define S_OK
Definition: intsafe.h:52
#define NULL
Definition: types.h:112
#define E_POINTER
Definition: winerror.h:2365

Referenced by ATL::IConnectionPointImpl< CFindFolder, &DIID_DSearchCommandEvents >::Advise().

◆ GetConnectionPointContainer()

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

Definition at line 1238 of file atlcom.h.

1239  {
1240  T *pThis;
1241 
1242  pThis = static_cast<T *>(this);
1243  return pThis->QueryInterface(IID_IConnectionPointContainer, reinterpret_cast<void **>(ppCPC));
1244  }
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 1274 of file atlcom.h.

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

Member Data Documentation

◆ m_vec


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