ReactOS  0.4.12-dev-51-ge94618b
ATL::CComCreator< T1 > Class Template Reference

#include <atlcom.h>

Static Public Member Functions

static HRESULT WINAPI CreateInstance (void *pv, REFIID riid, LPVOID *ppv)
 

Detailed Description

template<class T1>
class ATL::CComCreator< T1 >

Definition at line 415 of file atlcom.h.

Member Function Documentation

◆ CreateInstance()

template<class T1 >
static HRESULT WINAPI ATL::CComCreator< T1 >::CreateInstance ( void pv,
REFIID  riid,
LPVOID ppv 
)
inlinestatic

Definition at line 418 of file atlcom.h.

419  {
420  T1 *newInstance;
421  HRESULT hResult;
422 
423  ATLASSERT(ppv != NULL);
424  if (ppv == NULL)
425  return E_POINTER;
426  *ppv = NULL;
427 
428  hResult = E_OUTOFMEMORY;
429  newInstance = NULL;
430  ATLTRY(newInstance = new T1(pv))
431  if (newInstance != NULL)
432  {
433  newInstance->SetVoid(pv);
434  newInstance->InternalFinalConstructAddRef();
435  hResult = newInstance->_AtlInitialConstruct();
436  if (SUCCEEDED(hResult))
437  hResult = newInstance->FinalConstruct();
438  if (SUCCEEDED(hResult))
439  hResult = newInstance->_AtlFinalConstruct();
440  newInstance->InternalFinalConstructRelease();
441  if (SUCCEEDED(hResult))
442  hResult = newInstance->QueryInterface(riid, ppv);
443  if (FAILED(hResult))
444  {
445  delete newInstance;
446  newInstance = NULL;
447  }
448  }
449  return hResult;
450  }
#define ATLTRY(x)
Definition: atlcomcli.h:44
#define ATLASSERT(x)
Definition: CComVariant.cpp:9
REFIID riid
Definition: precomp.h:44
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define E_POINTER
Definition: winerror.h:2365
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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