Share via


IPOlItems2::GetProps

4/8/2010

The GetProps method gets the list of property values for a PIM item at a given index into its collection, without the need to instantiate an object for the item. It uses the index into the collection rather than an OID or another POOM object.

IPOlItems2::GetProps is useful for getting properties when iterating through a collection because you do not have to instantiate each object just to read its properties. Additionally, you do not have to cache the list of OID's.

Syntax

HRESULT GetProps((
  int iIndex,
  const CEPROPID * rgPropID,
  ULONG ulFlags,
  WORD cProps,
   CEPROPVAL ** prgVals,
  ULONG * pcbBuffer,
  HANDLE hHeap
)

Parameters

  • iIndex
    [in] The index into the array of property ID's.
  • rgPropID
    [in] An array of property ID's.
  • ulFlags
    [in] Flag specifying memory allocation for prgVals. To allocate memory for prgVals, set to CEDB_ALLOWREALLOC. Set to zero if already allocated.
  • cProps
    [in] The number of property values contained in rgPropID.
  • prgVals
    [out] Reference to an array used to return the list of property values if you allocate memory (i.e., set ulFlags to CEDB_ALLOWREALLOC), . If you do not allocate memory, then prgVals is NULL, and GetProps allocates the memory for you. For information about CEPROPVAL, see CEPROPVAL.
  • pcbBuffer
    [in/out] Reference to the count of bytes passed in prgVals if you allocate memory. If you do not allocate memory, then pcbBuffer is the size of the buffer that GetProps allocated instead.
  • hHeap
    [in] Handle to the heap memory to allocate prgVals (if you allocate memory). If you do not allocate memory, then hHeap must be NULL.

Return Value

This method returns the standard values HRESULT_FROM_WIN32(GetLastError()), E_INVALIDARG, and E_FAIL, as well as the following:

  • S_OK
    The method completed successfully.

Remarks

The GetProps method is based on IMAPIProp::GetProps.

If you do not allocate memory with prgVals, you must free *prgVals with HeapFree.

Requirements

Header pimstore.h
Library Pimstore.lib
Windows Mobile Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later

See Also

Reference

IPOlItems2
IItem::GetProps
IMAPIProp::GetProps

Other Resources