BOOL Personal::OnInitDialog() { CPropertyPage::OnInitDialog(); CComboBox *pCombo2 = (CComboBox *)GetDlgItem(IDC_COMBO4); CComboBox *pCombo3 = (CComboBox *)GetDlgItem(IDC_COMBO5); int i = 0; while(*szSex[i]) { int iPosition = pCombo2->AddString(szSex[i]);//throws an exception at this point. pCombo2->SetItemData(iPosition,i); i++; } pCombo2->SetCurSel(0); i = 0; while(*szStudentKind[i]) { int iPosition = pCombo3->AddString(szStudentKind[i]); pCombo2->SetItemData(iPosition,i); i++; } pCombo3->SetCurSel(0); if(!LoadClassStudents(pStudEdit->m_iClassID)) { return 0; } INT_PTR iStudentID = pStudEdit->m_Personal.GetStudentID(); if(!Load(iStudentID)) { return 0; } CString stTitle; stTitle.LoadString(m_hInstance,IDS_PERSONAL,(WORD)LANGUAGE); SetWindowText(stTitle); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)