At 7/12/2004 12:13 PM, prosen wrote:
>> There must be an easier way to solve my problem, because it >> must come up often. I have a CListCtrl with quite a few >> items in it, and the data in the list control must be >> periodically updated. Since the order of the items in the >> list can be changed through drag/drop, it's not so simple as >> to do a Get1() call for the first item in the list, Get2() >> for item 2, etc. >> Of course I can still used SetItemData to save the original >> index of an item, and then do a lookup based on that original >> index number. It just seems that there should be an easier, >> more elegant way to do it. This is why I wanted to assign >> the address of the corresponding Get() with SetItemData. > >I think saving the original index is not that bad a solution. I've done >it before and it is easy to understand and easy to debug and maintain.
I am not sure that I understand what the problem is.
I use SetItemData to store a value unique to the class holding the data in that row.
Then, whenever I get a call for updating a row's data, I use that value to get to the class and then return the appropriate member variable holding that item's piece of data.
Probably, I am misunderstanding some part of the problem.
Phil Daley < AutoDesk > http://www.conknet.com/~p_daley
_______________________________________________ msvc mailing list [EMAIL PROTECTED] See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription changes, and list archive.
