ReactOS  0.4.12-dev-51-ge94618b
ATL::CComPolyObject< contained > Class Template Reference

#include <atlcom.h>

Inheritance diagram for ATL::CComPolyObject< contained >:
Collaboration diagram for ATL::CComPolyObject< contained >:

Public Member Functions

 CComPolyObject (void *pv=NULL)
 
virtual ~CComPolyObject ()
 
HRESULT FinalConstruct ()
 
void FinalRelease ()
 
 STDMETHOD_ (ULONG, AddRef)()
 
 STDMETHOD_ (ULONG, Release)()
 
STDMETHOD() QueryInterface (REFIID iid, void **ppvObject)
 

Static Public Member Functions

static HRESULT WINAPI CreateInstance (IUnknown *punkOuter, CComPolyObject< contained > **pp)
 

Public Attributes

CComContainedObject< contained > m_contained
 

Detailed Description

template<class contained>
class ATL::CComPolyObject< contained >

Definition at line 315 of file atlcom.h.

Constructor & Destructor Documentation

◆ CComPolyObject()

template<class contained>
ATL::CComPolyObject< contained >::CComPolyObject ( void pv = NULL)
inline

Definition at line 320 of file atlcom.h.

321  : m_contained(pv ? static_cast<contained*>(pv) : this)
322  {
323  _pAtlModule->Lock();
324  }
CComContainedObject< contained > m_contained
Definition: atlcom.h:318

◆ ~CComPolyObject()

template<class contained>
virtual ATL::CComPolyObject< contained >::~CComPolyObject ( )
inlinevirtual

Definition at line 326 of file atlcom.h.

327  {
328  this->FinalRelease();
329  _pAtlModule->Unlock();
330  }
void FinalRelease()
Definition: atlcom.h:336

Member Function Documentation

◆ CreateInstance()

template<class contained>
static HRESULT WINAPI ATL::CComPolyObject< contained >::CreateInstance ( IUnknown punkOuter,
CComPolyObject< contained > **  pp 
)
inlinestatic

Definition at line 366 of file atlcom.h.

367  {
368  CComPolyObject<contained> *newInstance;
369  HRESULT hResult;
370 
371  ATLASSERT(pp != NULL);
372  if (pp == NULL)
373  return E_POINTER;
374 
375  hResult = E_OUTOFMEMORY;
376  newInstance = NULL;
377  ATLTRY(newInstance = new CComPolyObject<contained>(punkOuter))
378  if (newInstance != NULL)
379  {
380  newInstance->SetVoid(NULL);
381  newInstance->InternalFinalConstructAddRef();
382  hResult = newInstance->_AtlInitialConstruct();
383  if (SUCCEEDED(hResult))
384  hResult = newInstance->FinalConstruct();
385  if (SUCCEEDED(hResult))
386  hResult = newInstance->_AtlFinalConstruct();
387  newInstance->InternalFinalConstructRelease();
388  if (hResult != S_OK)
389  {
390  delete newInstance;
391  newInstance = NULL;
392  }
393  }
394  *pp = newInstance;
395  return hResult;
396  }
#define ATLTRY(x)
Definition: atlcomcli.h:44
#define ATLASSERT(x)
Definition: CComVariant.cpp:9
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define pp
Definition: hlsl.yy.c:978
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ FinalConstruct()

template<class contained>
HRESULT ATL::CComPolyObject< contained >::FinalConstruct ( )
inline

Definition at line 332 of file atlcom.h.

Referenced by ATL::CComPolyObject< contained >::CreateInstance().

333  {
334  return m_contained.FinalConstruct();
335  }
CComContainedObject< contained > m_contained
Definition: atlcom.h:318

◆ FinalRelease()

template<class contained>
void ATL::CComPolyObject< contained >::FinalRelease ( )
inline

Definition at line 336 of file atlcom.h.

337  {
338  m_contained.FinalRelease();
339  }
CComContainedObject< contained > m_contained
Definition: atlcom.h:318

◆ QueryInterface()

template<class contained>
STDMETHOD() ATL::CComPolyObject< contained >::QueryInterface ( REFIID  iid,
void **  ppvObject 
)
inline

Definition at line 355 of file atlcom.h.

356  {
357  if (ppvObject == NULL)
358  return E_POINTER;
359  if (iid == IID_IUnknown)
360  *ppvObject = reinterpret_cast<void*>(this);
361  else
362  return m_contained._InternalQueryInterface(iid, ppvObject);
363  return S_OK;
364  }
CComContainedObject< contained > m_contained
Definition: atlcom.h:318
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ STDMETHOD_() [1/2]

template<class contained>
ATL::CComPolyObject< contained >::STDMETHOD_ ( ULONG  ,
AddRef   
)
inline

Definition at line 341 of file atlcom.h.

342  {
343  return this->InternalAddRef();
344  }

◆ STDMETHOD_() [2/2]

template<class contained>
ATL::CComPolyObject< contained >::STDMETHOD_ ( ULONG  ,
Release   
)
inline

Definition at line 346 of file atlcom.h.

347  {
348  ULONG newRefCount;
349  newRefCount = this->InternalRelease();
350  if (newRefCount == 0)
351  delete this;
352  return newRefCount;
353  }
unsigned int ULONG
Definition: retypes.h:1

Member Data Documentation

◆ m_contained

template<class contained>
CComContainedObject<contained> ATL::CComPolyObject< contained >::m_contained

Definition at line 318 of file atlcom.h.


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