I have a CDialog , i decleared the Combobox in .rc file , i can see that combobox on screen but as soon as i do DDX mapping of this combobox , dialog dont open and produces asseetion failed. I have added other combobox in same dialog but addidtion of this combobox produces above mentioned problem.Sample code are below:
//MyDialog.cppCode:// Mydialog.h CComboBox combo_one ; CComboBox combo_two; CComboBox combo_three; CComboBox combo_four;
//Mydialog.rcCode:void MyDialog :: DoDataExchange(CDataExchange* pDX) { DDX_Control(pDX, IDC_COMBO_ONE, combo_one); DDX_Control(pDX, IDC_COMBO_TWO, combo_two); DDX_Control(pDX, IDC_COMBO_THREE, combo_three); DDX_Control(pDX, IDC_COMBO_FOUR, combo_four); }
i am getting no error when i added and mapped IDC_COMBO_ONE, IDC_COMBO_TWO,IDC_COMBO_THREE but as soon as i mapped IDC_COMBO_FOUR in DoDataExchange , error of assertion failed comes.Code:COMBOBOX IDC_COMBO_ONE, 10.,20,30,40, CBS_DROPDOWN COMBOBOX IDC_COMBO_TWO, 20.,30,30,40, CBS_DROPDOWN COMBOBOX IDC_COMBO_THREE, 30.,40,30,40, CBS_DROPDOWN COMBOBOX IDC_COMBO_FOUR,40,50,30,40, CBS_DROPDOWN
I debugged and found that when i hover combo_four variable during debug its hwnd is null while other three varaible have some memory.




Reply With Quote
