ReactOS  0.4.12-dev-36-g472787f
ATL::CComObject< Base > Class Template Reference

#include <atlcom.h>

Inheritance diagram for ATL::CComObject< Base >:
Collaboration diagram for ATL::CComObject< Base >:

Public Member Functions

 CComObject (void *=NULL)
 
virtual ~CComObject ()
 
 STDMETHOD_ (ULONG, AddRef)()
 
 STDMETHOD_ (ULONG, Release)()
 
STDMETHOD() QueryInterface (REFIID iid, void **ppvObject)
 

Static Public Member Functions

static HRESULT WINAPI CreateInstance (CComObject< Base > **pp)
 

Detailed Description

template<class Base>
class ATL::CComObject< Base >

Definition at line 131 of file atlcom.h.

Constructor & Destructor Documentation

◆ CComObject()

template<class Base>
ATL::CComObject< Base >::CComObject ( void = NULL)
inline

Definition at line 134 of file atlcom.h.

135  {
136  _pAtlModule->Lock();
137  }

◆ ~CComObject()

template<class Base>
virtual ATL::CComObject< Base >::~CComObject ( )
inlinevirtual

Definition at line 139 of file atlcom.h.

140  {
141  this->FinalRelease();
142  _pAtlModule->Unlock();
143  }

Member Function Documentation

◆ CreateInstance()

template<class Base>
static HRESULT WINAPI ATL::CComObject< Base >::CreateInstance ( CComObject< Base > **  pp)
inlinestatic

Definition at line 165 of file atlcom.h.

166  {
167  CComObject<Base> *newInstance;
168  HRESULT hResult;
169 
170  ATLASSERT(pp != NULL);
171  if (pp == NULL)
172  return E_POINTER;
173 
174  hResult = E_OUTOFMEMORY;
175  newInstance = NULL;
176  ATLTRY(newInstance = new CComObject<Base>())
177  if (newInstance != NULL)
178  {
179  newInstance->SetVoid(NULL);
180  newInstance->InternalFinalConstructAddRef();
181  hResult = newInstance->_AtlInitialConstruct();
182  if (SUCCEEDED(hResult))
183  hResult = newInstance->FinalConstruct();
184  if (SUCCEEDED(hResult))
185  hResult = newInstance->_AtlFinalConstruct();
186  newInstance->InternalFinalConstructRelease();
187  if (hResult != S_OK)
188  {
189  delete newInstance;
190  newInstance = NULL;
191  }
192  }
193  *pp = newInstance;
194  return hResult;
195  }
#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
if(!(yy_init))
Definition: macro.lex.yy.c:717
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

◆ QueryInterface()

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

Definition at line 160 of file atlcom.h.

161  {
162  return this->_InternalQueryInterface(iid, ppvObject);
163  }

◆ STDMETHOD_() [1/2]

template<class Base>
ATL::CComObject< Base >::STDMETHOD_ ( ULONG  ,
AddRef   
)
inline

Definition at line 145 of file atlcom.h.

146  {
147  return this->InternalAddRef();
148  }

◆ STDMETHOD_() [2/2]

template<class Base>
ATL::CComObject< Base >::STDMETHOD_ ( ULONG  ,
Release   
)
inline

Definition at line 150 of file atlcom.h.

151  {
152  ULONG newRefCount;
153 
154  newRefCount = this->InternalRelease();
155  if (newRefCount == 0)
156  delete this;
157  return newRefCount;
158  }
unsigned int ULONG
Definition: retypes.h:1

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