ReactOS 0.4.15-dev-8127-g6338913
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 137 of file atlcom.h.

Constructor & Destructor Documentation

◆ CComObject()

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

Definition at line 140 of file atlcom.h.

141 {
142 _pAtlModule->Lock();
143 }

◆ ~CComObject()

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

Definition at line 145 of file atlcom.h.

146 {
147 this->FinalRelease();
148 _pAtlModule->Unlock();
149 }

Member Function Documentation

◆ CreateInstance()

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

Definition at line 171 of file atlcom.h.

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

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

◆ QueryInterface()

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

Definition at line 166 of file atlcom.h.

167 {
168 return this->_InternalQueryInterface(iid, ppvObject);
169 }
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082

Referenced by CFindFolderContextMenu::Create().

◆ STDMETHOD_() [1/2]

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

Definition at line 151 of file atlcom.h.

152 {
153 return this->InternalAddRef();
154 }

◆ STDMETHOD_() [2/2]

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

Definition at line 156 of file atlcom.h.

157 {
158 ULONG newRefCount;
159
160 newRefCount = this->InternalRelease();
161 if (newRefCount == 0)
162 delete this;
163 return newRefCount;
164 }
uint32_t ULONG
Definition: typedefs.h:59

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