Share via


XRObject.CreateInstance(As * *) (Compact 2013)

3/28/2014

This method converts the specified object that is a type that is different from ItemType into an XRObject<Base> instance that also supports functionality that resembles the Component Object Model (COM).

Syntax

template<typename As>HRESULT CreateInstance(
As ** ppRet)

Parameters

  • ppRet
    [in] Object pointer of type As to convert into an XRObject<Base> instance.

Return Value

The following table shows the possible return values.

Value

Description

S_OK

The method succeeded.

E_FAIL

The method was not successful.

E_OUTOFMEMORY

The method implementation could not allocate memory to create a new XRObject<Base> object instance.

E_POINTER

The method’s internal call to XRObject.CreateInstance(XRObject<Base> * *) could not create an instance by using the internal object pointer, or the method’s internal call to XRObject.QueryInterface(const IID&,void * *) could not return an interface by using the ppRet pointer.

Remarks

A generic wrapper class type can use this method to create object instances as an implemented interface. This functionality is analogous to the functionality in a COM class factory object.

Requirements

Header

XRUnknown.h

See Also

Reference

XRObject<Base>