Solved

Sorting???

Posted on 1998-11-01
1
165 Views
Last Modified: 2013-11-20
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...
0
Comment
Question by:ee_lcpaa
1 Comment
 
LVL 10

Accepted Solution

by:
RONSLOW earned 40 total points
Comment Utility
simply write your comparison function to return -1/0/+1 based on first name, then, if names are equal, compare telephone numbers.

0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Expand LInux Boot partition remotly 3 78
Error on moodle after upgrade 3 105
Doc'in system (example?) BA 7 78
pre4 challenge 19 87
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now