Example of multiple selection in CListBox
Posted on 1998-01-27
I'm using VC++ 5.0
I've never implemented multiple selection before in CListBox and am running into some difficulty. I'm using the function (I think it is called) GetSelItems which takes an integer max number of selections to allow and an LPINT buffer which is supposed to receive the zero ordered array positions within the list box of the selected items. This buffer is supposed to be "big enough to hold the max number of selectsion" but I'm not sure how to define it that way. The function returns an integer which is the number of selected items.
I can get the function to return the number of items, but I'm having no luck getting the LPINT buffer to give me the array positions of the selected items. Can someone please provide some sample code for how to define the buffer and how to get the item positions out of this buffer. I want to get these items so as to move them to another listbox. I figure this isn't hard if you know what you are doing.
Thanks in advance for any help.