Initializing ComboBox inside CDialogBar
Posted on 1998-11-30
I am trying to initialize a CComboBox control in a CDialogBar created with the Resource editor. I attach the tool bar to a Child Window in an MDI app. I want to fill the contents of the CboBox when the tool bar is loaded.
This is how I am trying to do it...
-- inside CMyChildFrm::OnCreate(....)
pCombo = (CComboBox*)GetDlgItem(IDC_COMBOBOX);
I am sure I am just overlooking something, what am I doing wrong???
The assertion error occurs when the pCombo->AddString("") is attempted. It is an Access Violation.
What is the proper casting and access method?