Re: CListCtrl sort not working



This article should help you:

http://support.microsoft.com/kb/250614

Tom

"Bill Brehm >" <<don't want spam> wrote in message news:eProxrioIHA.548@xxxxxxxxxxxxxxxxxxxxxxx
I have a CListCtrl. In response to pressing one of the columns, I process the LVN_COLUMNCLICK notification by calling SortItems() and providing a callback. The two parameters coming to my callback function are always zero. The documentation implies that the two parameters are indexes of two rows to be compared. I did a search and found this FAQ http://www.celticwolf.com/FAQs/CListCtrl_FAQ.html#Q14 that says those parameters are really the 32 bit data item stored in the row item. I confirmed this. Unfortunately the FAQ doesn't suggest how this should be used. I did try to set the data item equal to the index of the row item and the first sort works. Problem is, a subsequent sort doesn't work because now the data item no longer matches the actual index of the row item. I suppose I could change the data items depending on whether I pass back a positive, zero or negative value, but it seems to me I shouldn't have to do that and also, it seems to me that the data item loses it's usefulness if I just have to store an index in it.

So how is a sort meant to work?

Thanks...


.



Relevant Pages

  • CListCtrl sort not working
    ... The two parameters coming to my callback function are always zero. ... I did a search and found this FAQ ... a subsequent sort doesn't work because now ...
    (microsoft.public.vc.mfc)
  • Re: CListCtrl sort not working
    ... implies that I can maintain the data myself and set a callback to provide ... basically empty the list control and refill it to do a sort? ... I did a search and found this FAQ ... back a positive, zero or negative value, but it seems to me I shouldn't ...
    (microsoft.public.vc.mfc)
  • Re: to keep you from having difficulties of greater proportions -- Ray (the nice guy)
    ... what Zero fantasized I said but can't of course cite: ... others make "some sort of claim to be an expert of some sort" are the ... citing his own experiences. ... Which is to say that you said without qualification that I was ...
    (misc.writing)
  • RE: Setting Range by calculation
    ... 'Return the address of cell containing zero ... 'Or return the row of the cell containing zero ... As far the sort, I tried your code, but was not sure how to set "i" so I set ... In my working tab I have references to the pasted tab for up to 200 ...
    (microsoft.public.excel.programming)
  • Re: strange record sorting behavior
    ... In this case I have a script that organizes records in t_draft so the ... contour of crime you're incorrigible ... I ain't no nice guy zero hour ... or ways I try sort by name this arrangement persists. ...
    (comp.databases.filemaker)