Share via


XRValueCollectionT.GetItem(int,Obj**) (Compact 7)

3/12/2014

This method provides a helper template version of the XRValueCollectionT.GetItem(int,ItemType *) method, which obtains the item at the specified index of the collection.

Syntax

HRESULT GetItem(
int nIndex,
Obj * * ppObj)

Parameters

  • nIndex
    [in] The index of the item to obtain.
  • ppObj
    [out] A pointer of the specified interface pointer type that points to the item at the specified index within the collection.

Return Value

The following table shows the possible return values.

Value Description

S_OK

The method was successful.

E_FAIL

The method was unsuccessful.

E_POINTER

The ppObj parameter is not valid.

E_INVALIDARG

The index location is not valid.

Remarks

To use an interface pointer type other than ItemType, you can use the type-safe version of XRValueCollectionT.GetItem(int,ItemType *) that Silverlight for Windows Embedded provides. When you supply a derived type in ppObj, Silverlight for Windows Embedded automatically uses this type-safe method, which implicitly converts the returned type from a generic interface so that you do not have to explicitly call IUnknown::QueryInterface to convert the generic interface into the required object type.

ItemType is defined in the ItemType template parameter of the XRValueCollectionT<IFace,ItemType> class.

The index position at the beginning of the collection is 0 (zero).

Requirements

Header

XRCollection.h

See Also

Reference

XRValueCollectionT<IFace,ItemType>