Thank you have time to see this post
MFC, how to operate another class variables?
It can release success but while I run the program Trigger OnBnClickedOk() function the problem arise it says:
“Run-Time Check Failure #3 - The variable 'dlg' is being used without being initialized.â€
The function of the source code is as follows:
notes: CICDlg is another class
this program is based on MFC Dialog CICDlg is father dialog,Dialog box(I mean AddNewItemDlg) is a modal dialog box displayed
I don't know where I did wrong,I need your help .
MFC, how to operate another class variables?
It can release success but while I run the program Trigger OnBnClickedOk() function the problem arise it says:
“Run-Time Check Failure #3 - The variable 'dlg' is being used without being initialized.â€
The function of the source code is as follows:
Code:
void AddNewItemDlg::OnBnClickedOk()
{
CICDlg *dlg;
//Get User's data
GetDlgItem(ADDNEWITEM_ID)->GetWindowTextA(dlg->Value[0]);
GetDlgItem(ADDNEWITEM_PASSWORD)->GetWindowTextA(dlg->Value[1]);
GetDlgItem(ADDNEWITEM_PIECE)->GetWindowTextA(dlg->Value[2]);
GetDlgItem(ADDNEWITEM_ABOUT)->GetWindowTextA(dlg->Value[3]);
MessageBox(dlg->Value[0]+"\n"+dlg->Value[1]+"\n"+dlg->Value[2]+"\n"+dlg->Value[3],"C2p容错机制");
CDialogEx::OnOK();
}
this program is based on MFC Dialog CICDlg is father dialog,Dialog box(I mean AddNewItemDlg) is a modal dialog box displayed
I don't know where I did wrong,I need your help .