IColumnData::GetColumnSortData method

The IColumnData::GetColumnSortData method enables a snap-in to retrieve from memory the sorted column and sorting direction for columns in a column set.


HRESULT GetColumnSortData(
  [in]  SColumnSetID      *pColID,
  [out] MMC_SORT_SET_DATA **ppColSortData


pColID [in]

A pointer to an SColumnSetID structure that contains the ID of the column set whose sort data is to be retrieved.

ppColSortData [out]

A pointer to a pointer to an MMC_SORT_SET_DATA structure that will contain the column sort data of the column set.

Return value

This method can return one of these values.


MMC has persisted the column sort data for the particular column set ID in memory and the snap-in successfully retrieved it.


No column sort data for the particular column set ID is persisted in memory, indicating that sorting has not been performed by either the user or the snap-in for the column set.


The persisted column sort data was not retrieved.


If the user selects a scope item and then modifies the sort data of the list view of the selected item. If the snap-in calls IColumnData::GetColumnSortData to retrieve the same sort data, the method will return the new data, regardless of whether the user has deselected the item or not.

The MMC_SORT_SET_DATA structure and its array of MMC_SORT_DATA structures are allocated as one contiguous memory block by MMC during calls to GetColumnSortData. The snap-in must call CoTaskMemFree with the given pointer to MMC_SORT_SET_DATA. This frees the entire memory block.

All data set and retrieved by the methods of the IColumnData interface is persisted by MMC in memory, and not in a stream or storage medium. This data is persisted to an .msc console file only when the user chooses the Save menu command.


Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008





See also

Using IColumnData