HyperEngineer
Programmer
I'm trying to subclass two edit boxes from a dialog box that is not the main dialog box.
AppVar returns a good handle. But scanCode and SN2 do not. I can get to the variables of AppVar, but not for scanCode or SN2. What am I missing?
Thanks,
HyperEngineer
If it ain't broke, it probably needs improvement.
Code:
CEditCode::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CScan_SN_DLG* scanCode; // dialog with two text boxes
CAppDlg* AppVar; // main app dialog
// need to get variables from main program
AppVar = (CAppDlg*)AfxGetMainWnd();
// need to get variables from this class
// this is a dialog box with two text boxes
scanCode = (CScan_SN_DLG*)GetDlgItem(IDD_DIALOG_SCAN_SN);
// this is one of the text boxes to get the focus
CEdit* SN2;
SN2 = (CEdit*) GetDlgItem(IDC_SCAN_2);
.
.
.
.
}
AppVar returns a good handle. But scanCode and SN2 do not. I can get to the variables of AppVar, but not for scanCode or SN2. What am I missing?
Thanks,
HyperEngineer
If it ain't broke, it probably needs improvement.