Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
4/8/2010

The GetItemIndexFromOidfunction 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.

GetItemIndexFromOidreturns a zerobased index value. To avoid a "one-off" error when you retrieve the Item, add 1 to the value returned in the dwIndexparameter before passing it to the IPOutlookItemCollection::Itemmethod, because its iItemargument 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