The ITableData::HrEnumRow method retrieves a row based on its position in the table.
HRESULT HrEnumRow(
ULONG ulRowNumber,
LPSRow FAR * lppSRow
);
The ITableData::HrEnumRow method retrieves a row based on a sequential number. This number represents the order of insertion, with 0 being the first row and the number of rows minus 1 being the last row. MAPI maintains this chronological order of row insertion for the lifetime of the table data object.
If the number specified in ulRowNumber does not correspond to a row in the table, HrEnumRow returns S_OK and sets the lppSRow parameter to NULL.
MAPI allocates memory for the returned SRow structure using the MAPIAllocateBuffer function when the table data object is created. The caller must release this memory by calling the MAPIFreeBuffer function.
To retrieve rows from a table in the order that they were inserted, table data object users call the HrEnumRow method.
MAPIAllocateBuffer, MAPIFreeBuffer, SRow