Crash error in CComboBox (common controls 6.0)?

I created a simple MFC application (Visual Studio 2008 based on dialog) and added CComboBox using the resource editor. I used the resource editor to specify the height of the dropdown. Then I added code to add 100 texts to the combo box. If I run this simple app, the dropdown height is ignored. If I disable the Microsoft.Windows.Common-Controls 6.0.0.0 style (disable the pragma which will add it to the manifest file) then everything is fine.

Has anyone noticed this behavior (and knows a solution)? I've searched the web and msdn but no luck so far.

+2


source to share


2 answers


The only solution I have found (thanks to someone on the Microsoft MFC newsgroup) is to use the CBS_NOINTEGRALHEIGHT flag, which tells the combobox to look at the exact size specified by the user and not automatically adjust it (the reason for this is the patch. so this is that the flag is usually meant to turn off a feature where the height change is changed so that no partial elements are displayed).



+2


source


The difference lies in the "new" combo box Common-Controls-6.0 or the "original" combo box of the old style (pre 6.0).



I think Microsoft has finally "fixed" the ComboBox control so that it dynamically changes the height of the dropdown based on the number of items and the available screen real estate, which is better than a fixed height (IMHO).
Unfortunately I don't have a source for this, just wild guesses :)

0


source







All Articles