Поделиться через


CComAggObject::CreateInstance

This static function allows you to create a new **CComAggObject<**contained > object without the overhead of CoCreateInstance.

static HRESULT WINAPI CreateInstance(
   LPUNKNOWN pUnkOuter, 
   CComAggObject< contained >** pp 
);

Параметры

  • pp
    [out] A pointer to a **CComAggObject<**contained > pointer. If CreateInstance is unsuccessful, pp is set to NULL.

Возвращаемое значение

A standard HRESULT value.

Заметки

The object returned has a reference count of zero, so call AddRef immediately, then use Release to free the reference on the object pointer when you're done.

If you do not need direct access to the object, but still want to create a new object without the overhead of CoCreateInstance, use CComCoClass::CreateInstance instead.

Требования

Header: atlcom.h

См. также

Основные понятия

CComAggObject Class

CComAggObject Members