ReactOS 0.4.16-dev-125-g798ea90
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 421 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 424 of file atlcom.h.

425 {
426 T1 *newInstance;
427 HRESULT hResult;
428
429 ATLASSERT(ppv != NULL);
430 if (ppv == NULL)
431 return E_POINTER;
432 *ppv = NULL;
433
434 hResult = E_OUTOFMEMORY;
435 newInstance = NULL;
436 ATLTRY(newInstance = new T1(pv))
437 if (newInstance != NULL)
438 {
439 newInstance->SetVoid(pv);
440 newInstance->InternalFinalConstructAddRef();
441 hResult = newInstance->_AtlInitialConstruct();
442 if (SUCCEEDED(hResult))
443 hResult = newInstance->FinalConstruct();
444 if (SUCCEEDED(hResult))
445 hResult = newInstance->_AtlFinalConstruct();
446 newInstance->InternalFinalConstructRelease();
447 if (SUCCEEDED(hResult))
448 hResult = newInstance->QueryInterface(riid, ppv);
449 if (FAILED(hResult))
450 {
451 delete newInstance;
452 newInstance = NULL;
453 }
454 }
455 return hResult;
456 }
#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
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define E_POINTER
Definition: winerror.h:2365

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