又一个MFC"作品".......

2007-12-08

void CMyDlg::OnOK()                                                                                                                    {                                                                                                                    // TODO: Add extra validation here                                                                                                  CString str,strCtrl;                                       //定义2个字符串变量,CString是操作字符串的MFC类 str=”你的年龄”;                                             //获取第一个问题的用户选择 UINT nID=GetCheckedRadioButton(IDC_AGE_L18,IDC_AGE_M38); GetDlgItemText(nID,strCtrl);                          //获取指定控件的内容 str=str+strCtrl;                                                                                                                                        str=str+”\n你使用的接入方式是:”;               //获取第2个问题的选择 nID=GetCheckedRadioButton(IDC_CM_FTTP,IDC_CM_OTHER); GetDlgItemText(nID,strCtrl);                         //获取指定控件的内容 str=str+strCtrl;                                                                                                                                      str=str+”\n你上网主要是:”;                             //获取第3个内容的选择                                                 UINT nCheckIDs[4]={IDC_DO_POP,IDC_DO_READ,IDC_DO_GAME,IDC_DO_OTHER}; CButton*pBtn;                                                                                                                    for(int i=0;iGetCheck())                                                                                                                       {                                                                                                                        pBtn->GetWindowText(strCtrl);                                                                                               str=str+strCtrl;                                                                                                                        str=str+” “;                                                                                                                       }                                                                                                                    }                                                                                                                    MessageBox(str);                                                                                                                    CDialog::OnOK();                                                                                                                   }                                                                                                                                             

基本能懂它的意思……………