> 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.

You can store a pointer to the object itself in the list control.  That way,
you use that object pointer to call any member functions on it, and you
won't need any nasty casting operations.

-------------
Ehsan Akhgari

Farda Technology (http://www.farda-tech.com/)

List Owner: [EMAIL PROTECTED]

[ Email: [EMAIL PROTECTED] ]
[ WWW: http://www.beginthread.com/Ehsan ]

Whoever fights monsters should see to it that in the process he does not
become a monster. And when you look long into the abyss, the abyss also
looks into you.
-Beyond Good And Evil, F. W. Nietzsche




_______________________________________________
msvc mailing list
[EMAIL PROTECTED]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription 
changes, and list archive.

Reply via email to