Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sorting Items in a TListWindow control

Posted on 1999-07-13
4
Medium Priority
?
258 Views
Last Modified: 2010-05-18
Hi... I have a TListWindow control in a resource file... I have set that I want the items to be ordered setting the LVS_SORTASCENDING style. The fact is that the items aren't sorted. How can I do it?

Thanks in advance
Jaime
0
Comment
Question by:demarcy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
gaohong earned 100 total points
ID: 1199976
You also have to call TListWindow control's
SortItems() function
0
 

Author Comment

by:demarcy
ID: 1199977
Can you give me an example of using SortItems method?

Thanks
0
 
LVL 3

Expert Comment

by:gaohong
ID: 1199978
You need derive a comparision class from TLwComparator and override
function of Compare() as to your own rule how to compare items.
In your case, by comparsing strings of item.

You need check win32 help for details. the 32 bit value passed are
supplied to your Compare()  function to find a particular item. The returned
structure will have the item string associated with it
0
 

Author Comment

by:demarcy
ID: 1199979
I've found the solution sending a message to the control with SendMessage

Thanks
Jaime
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

660 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