c++mfcccombobox

Set ComboBox to ID of another ComboBox


I am currently trying to set a CComboBox* with the ID that is assigned for existing combo box(IDC_COMBO).

I've tried CWnd's GetDlgItem() and ID assignment, but I could not figure it out yet.

I know this isn't exactly the expected details, but this is all I can give you.


Solution

  • Is this what you want?

    CComboBox* pCombo = reinterpret_cast<CComboBox*>(GetDlgItem (IDC_COMBO));