IViewSort::GetSortOrder

Retrieves the sort order applied to a view.

HRESULT GetSortOrder (
   ULONG *         pcColumns,
   ULONG *         prgColumns[],
   DBSORT *      prgOrders[]);

Parameters

pcColumns

[out]
Count of the number of columns in the sort order.

prgColumns

[out]
The ordinals of the columns used to describe the sort. The order of the columns in the list defines the precedence of the columns in the sort.

prgOrders

[out]
The sort order for the corresponding column in the prgColumns list.

Return Code

S_OK
The method succeeded.

E_FAIL
A provider-specific error occurred.

E_INVALIDARG
pcColumns, prgColumns, or prgOrders was NULL.

E_OUTOFMEMORY
The provider was unable to allocate sufficient memory in which to return the sort information.

Comments

GetSortOrder returns the latest sort order successfully set on the view.

If GetSortOrder returns an error and pcColumns, prgColumns, and prgOrders are non-null, then *pcColumns, *prgColumns, and *prgOrders are set to NULL, respectively.