ReactOS  0.4.15-dev-2704-gd5265b0
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 132 of file atlcom.h.

Constructor & Destructor Documentation

◆ CComObject()

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

Definition at line 135 of file atlcom.h.

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

◆ ~CComObject()

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

Definition at line 140 of file atlcom.h.

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

Member Function Documentation

◆ CreateInstance()

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

Definition at line 166 of file atlcom.h.

167  {
168  CComObject<Base> *newInstance;
169  HRESULT hResult;
170 
171  ATLASSERT(pp != NULL);
172  if (pp == NULL)
173  return E_POINTER;
174 
175  hResult = E_OUTOFMEMORY;
176  newInstance = NULL;
177  ATLTRY(newInstance = new CComObject<Base>())
178  if (newInstance != NULL)
179  {
180  newInstance->SetVoid(NULL);
181  newInstance->InternalFinalConstructAddRef();
182  hResult = newInstance->_AtlInitialConstruct();
183  if (SUCCEEDED(hResult))
184  hResult = newInstance->FinalConstruct();
185  if (SUCCEEDED(hResult))
186  hResult = newInstance->_AtlFinalConstruct();
187  newInstance->InternalFinalConstructRelease();
188  if (hResult != S_OK)
189  {
190  delete newInstance;
191  newInstance = NULL;
192  }
193  }
194  *pp = newInstance;
195  return hResult;
196  }
#define ATLTRY(x)
Definition: atlcomcli.h:44
#define ATLASSERT(x)
Definition: CComVariant.cpp:10
if(dx==0 &&dy==0)
Definition: linetemp.h:174
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
if SUCCEEDED(hr)
LONG HRESULT
Definition: typedefs.h:79
#define S_OK
Definition: intsafe.h:51
#define NULL
Definition: types.h:112
#define E_POINTER
Definition: winerror.h:2365

Referenced by ATL::CComEnumImpl< Base, piid, T, Copy >::Clone().

◆ QueryInterface()

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

Definition at line 161 of file atlcom.h.

162  {
163  return this->_InternalQueryInterface(iid, ppvObject);
164  }
REFIID LPVOID * ppvObject
Definition: precomp.h:44

Referenced by CFindFolderContextMenu::Create().

◆ STDMETHOD_() [1/2]

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

Definition at line 146 of file atlcom.h.

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

◆ STDMETHOD_() [2/2]

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

Definition at line 151 of file atlcom.h.

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

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