Share via


GetItemIndexFromOid

4/8/2010

The GetItemIndexFromOid function returns the index of the item in the collection for the given OID.

Syntax

HRESULT GetItemIndexFromOid(
  IPOutlookItemCollection * pItems,
  CEOID oidPIM,
  DWORD * pdwIndex
);

Parameters

Parameter Description

pItems

[in] Reference to a collection of POOM items in a folder. For more information, see IPOutlookItemCollection.

oidPIM

[in] Reference to the PIM item's Object Identifier (OID). OIDs are DWORD values that uniquely identify POOM items within an Item Store. In POOM, an OID is also a Windows CE Object Identifier (CEOID), which uniquely identify all WINCE objects (databases, database volumes, database records, files, registry keys, etc.). You can find the definition for this type in the Windbase.h header file.

pdwIndex

[out] Reference to the item's zerobased index position within the PIM Item collection.

Property Value/Return Value

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

  • S_OK
    The method completed successfully.

Remarks

The item collection can be a collection created with IPOutlookItemCollection::Restrict.

GetItemIndexFromOid returns a zerobased index value. To avoid a "one-off" error when you retrieve the Item, add 1 to the value returned in the dwIndex parameter before passing it to the IPOutlookItemCollection::Item method, because its iItem argument takes a onebased index value.

Requirements

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

See Also

Reference

Pocket Outlook Object Model Functions
CHOOSECONTACT Structure
ChooseContact
FindMatchingContact