Re: ListView sort problem
- Posted by Mario Steele <eumario at trilake.net> May 12, 2005
- 471 views
Pete Lomax wrote: > > On Wed, 11 May 2005 03:52:08 -0700, Al Getz <guest at RapidEuphoria.com> > wrote: > > >Hi Pete, > > > >Funny, i cant get mine to sort in Report View at all. > That's what I just said )! > (BTW, I'm only attempting report view anyway; what happens in > LVS_[SMALL]ICON & LVS_LIST modes does not concern me) > >Keeps returning all zeros as in your first example. > Yes, have you set the LVIF_PARAM bit in LVITEM_mask? > You probably don't have the code to set LVITEM_lParam either. > If not, don't worry about it, show a bit or patience and, I'll release > a working version in a few days. I think I have all the info I now > need, it was not setting the LVIF_PARAM bit that really stumped me. > >Now that i think about it, what is it that it is trying > >to sort anyway, when the sort sendmessage is called? > >How can it know what column you want sorted... > >i must be missing something here... > That one happens to be: > SortColumn=peek4s(lParam+NMLISTVIEW_iSubItem) > > Leave this with me a couple of days, OK? > > Regards, > Pete He He he, I just thought I'd throw in my two cents here. Cause I mean, we're talking about trying to fetch the String that is stored in the list view, to make our comparison, correct? Well, just for kicks and giggles, why not assign LVITEM_lParam a Memory location to the string that's being used? That way, in your sort function, all you have to do, is peek() the memory location in the two lParam's from the LVITEM_lParams, to see where to move it. Just quirky that way I guess. As far as I'm concerned, the LVITEM_lParam can be anything, so you could legally assign a Memory Location that holds the String into it. Mario Steele http://enchantedblade.trilake.net Attaining World Dominiation, one byte at a time...