CListCtrl::SetColumnOrderArray
BOOL SetColumnOrderArray( int iCount, LPINT piArray );
Return Value
Nonzero if successful; otherwise zero.
Parameters
piArray
A pointer to a buffer containing the index values of the columns in the list view control (from left to right). The buffer must be large enough to contain the total number of columns in the list view control.
iCount
Number of columns in the list view control.
Remarks
This member function implements the behavior of the Win32 macro,ListView_SetColumnOrderArray, as described in the Platform SDK.
CListCtrl Overview | Class Members | Hierarchy Chart
m_nSortedCol = nSortedCol;
int NumItems = GetItemCount();
//将比较条件打包保存到对应的缓冲地址
for (int i = 0; i < NumItems; i++)
{
DWORD dwData = GetItemData(i); // save current data to restore it later
CString strText = GetItemText(i, m_nSortedCol);