CComPolyObject::CreateInstance

Allows you to create a new CComPolyObject< contained > object without the overhead of CoCreateInstance.

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

Parameters

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

Return Value

A standard HRESULT value.

Remarks

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 don't need direct access to the object, but still want to create a new object without the overhead of CoCreateInstance, use CComCoClass::CreateInstance instead.

Requirements

Header: atlcom.h

See Also

Reference

CComPolyObject Class

Other Resources

CComPolyObject Members