MFC population

I'm trying to populate the combo box in an MFC application with no luck, I tried all the methods available on the Internet, but no one works for me if I try to enter values โ€‹โ€‹using the data parameter in the property windows, for example, โ€œvalue 1; value 2โ€ only value 2 is displayed in the combo box if I try to add it using

comboxbox.AddString("value 1"); 

I get

to the left of AddString should be the class / union / struct.

I am using Visual Studio 2008.

+7
source share
2 answers
 CComboBox* pComboBox = (CComboBox*)GetDlgItem(YOUR_COMBO_ID); pComboBox->AddString( _T( "Value" ) ); pComboBox->AddString( _T( "Value" ) ); 

Know what _T means: Read this

+9
source

Create a control variable for combobox and call m_ctrlCombo.AddString (_T ("My String"));

Another thing you need to do is open the dialog box in the resource editor, select the combo box, click the drop-down arrow, and now you will see that the drop-down list will be highlighted, now drag it down with the mouse.

0
source

All Articles