Share via


_ItemLifeManager.CloneToBox(Obj *,XRValue *) (Compact 2013)

3/28/2014

This helper template method provides a type-safe version of the _ItemLifeManager.CloneToBox(const Type&,XRValue *) method that returns an XRValue object that encapsulates the specified object.

Syntax

HRESULT CloneToBox(
Obj * pItem,
XRValue * pValue)

Parameters

  • pItem
    [in] An interface pointer to a custom object type to encapsulate into an XRValue object. The interface pointer type you specify must support IUnknown.
  • pValue
    [out] A pointer to an XRValue object that encapsulates the object in the pItem parameter.

Return Value

The following table shows the possible return values.

Value

Description

S_OK

The method succeeded.

E_POINTER

The pValue parameter is not valid.

Remarks

This method boxes the object type in the pItem parameter by wrapping it into an XRValue value-type object.

To use an interface pointer type other than ItemType, you can use the type-safe version of the _ItemLifeManager.CloneToBox(const Type&,XRValue *) method. When you supply a derived type in pItem, XAML for Windows Embedded automatically uses the type-safe method, which adds a reference to the object so that you do not have to call XRObject.AddRef or IUnknown::AddRef.

Requirements

Header

XRCollection.h

See Also

Reference

_ItemLifeManager