The SortTable method orders the rows of the table based on sort criteria.
Note This method is supported for contents tables only.
HRESULT SortTable ( LPSSortOrderSet lpSortCriteria, ULONG ulFlags );
[in] Reference to an SSortOrderSet structure containing the sort criteria to apply; cannot be NULL. See Remarks for information about the restrictions on the members of this parameter.
[in] Not used; must be zero.
This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:
Another operation is in progress that prevents the sort operation from starting. Either the operation in progress should be allowed to complete or it should be stopped.
The table does not support the type of sorting requested.
The SSortOrderSet structure that is referenced by the lpSortCriteria parameter has the following restrictions:
- The cSorts member must be either 0 (no sort performed) or 1 (sort on the criterion specified by the aSort member).
- The cCategories member must be 0.
- The cExpanded member must be 0.
- The aSort.ulOrder member cannot be TABLE_SORT_COMBINE.
- The aSort.ulPropTag member must be one of the following:
- PR_MESSAGE_DELIVERY_TIME (Sort by time received.)
- PR_SENDER_NAME_W (Sort by sender.)
- PR_SUBJECT_W (Sort by subject.)
- PR_CONTENT_LENGTH (Sort by size.)
When there are zero columns in the SSortOrderSet structure pointed to by the lpSortCriteria parameter, the table returns the current column set.
All bookmarks for a table are invalidated and should be deleted when a call to SortTable is made, and the BOOKMARK_CURRENT bookmark, indicating the current cursor position, should be set to the beginning of the table.
Whenever SortTable fails, the sort order that was in effect before the failure remains in effect.
Pocket PC: Pocket PC 2002 and later
Smartphone: Smartphone 2002 and later
OS Versions: Windows CE 3.0 and later
Send Feedback on this topic to the authors