Hello. Can someone tell me how can i add string to combo box? i tried


but it didn't worked. and everything that i could find on google didn't helped :( so i'm asking you pros ;)

Since this is MFC, see CComboBox::AddString() GetDlgItem() returns a CWnd * , meaning that you need a typecast to CComboBox * .

For example

CComboBox * pCombo = (CComboBox *) GetDlgItem(IDC_COMBO1);
commented: Thank you. It worked +1

CComboBox does not have an items property. (CComboBox*)(GetDlgItem(IDC_COMBO1))->AddString("Text");