Re: Problem with ComboBox
What you are seeing may actually be correct. If your ComboBox is sorted, then adding an item will automatically trigger a resort, thus it would depend on the sort order of the items you're adding.
If you set the ComboBox to unsorted, you'll probably see what you are expecting.
Hope that helps.
Re: Problem with ComboBox
Good idea, and I thinkit explains why I was seing the intIndex values I was seing. However, changing the combobox to not sort while it did sort out what I was seing in the debug did nothing to change the fact that result is always equal to the same thing...
The 4 values loaded are knit ; non woven; woven; and other
Result is always = to other no matter what I select in the combobox...
I have comfirmed that the value of nCurSel is changing but it does not affect the output result.
Thanks A
Re: Problem with ComboBox
The basic problem seems to be that what you have set for ItemData on all entries is the pConstructionData pointer. This means that all of your entries point to the same memory location.
Since pConstructionData can only hold one item at a time. It changes as you initially load the data into the ComboBox, but when you've finished loading, it holds the last item you entered ("other").
Therefore when you try to retrieve the ItemData, it returns the pConstructionData pointer, which still contains "other".
You need some kind of array or collection of your Constructions so that you can access them later.
Hope that helps.