Sorting???

Dear All,

I have done a sorting of a listview by using the function
CListCtrl::SortItems();.
My listview contain 4 columns:
tel no, first name, last mail, email.

The problem I faced now is :
Many people will have the same last name/ first name.
Thus when I am doing the sorting accoring to the first name,
eg. tel no   first name    last name
    999999   Peter
    888888   Peter
    222231   Peter
    982732   Peter
    777929  Peter

The tel no will not be sorted in ascedning order.
How can I implemnt like this:
eg. tel no   first name    last name
    222231   Peter
    777929   Peter
    888888   Peter
    982732   Peter
    999999  Peter

Thanks...
ee_lcpaaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
RONSLOWConnect With a Mentor Commented:
simply write your comparison function to return -1/0/+1 based on first name, then, if names are equal, compare telephone numbers.

0
All Courses

From novice to tech pro — start learning today.