I am running a program created using Visual C++ 2010 Express.
I have several dialog boxes to read input data.
One works perfectly, but a second one simply does not read any data at all, and I cannot figure out why.
The dialogs are defined as
The first dialog box works correctly and I can read all six values.
The code to read the second dialog is
Analysis of the second box shows that the two values are both NULL strings and 'value' is always set to SIXMONTHS.
Can someone suggest why this is not working?
I have several dialog boxes to read input data.
One works perfectly, but a second one simply does not read any data at all, and I cannot figure out why.
The dialogs are defined as
Code:
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG5 DIALOG 0, 0, 275, 95
STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU
CAPTION "Enter Start and End Date"
FONT 8, "Ms Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 218, 9, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 218, 30, 50, 14
EDITTEXT IDC_EDIT1, 11, 17, 36, 18, ES_AUTOHSCROLL
EDITTEXT IDC_EDIT2, 53, 17, 88, 18, ES_AUTOHSCROLL
EDITTEXT IDC_EDIT3, 147, 17, 57, 18, ES_AUTOHSCROLL
EDITTEXT IDC_EDIT4, 12, 55, 36, 18, ES_AUTOHSCROLL
EDITTEXT IDC_EDIT5, 54, 55, 88, 18, ES_AUTOHSCROLL
EDITTEXT IDC_EDIT6, 148, 55, 57, 18, ES_AUTOHSCROLL
}
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG6 DIALOG 0, 0, 227, 105
STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU
CAPTION "Date for Chart"
FONT 8, "Ms Shell Dlg"
{
DEFPUSHBUTTON "OK", IDOK, 166, 5, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 166, 26, 50, 14
EDITTEXT IDC_EDIT7, 14, 20, 71, 16, ES_AUTOHSCROLL
EDITTEXT IDC_EDIT8, 95, 20, 44, 16, ES_AUTOHSCROLL
AUTORADIOBUTTON "Monthly", ID_CHECKBOXM, 20, 50, 41, 8, WS_GROUP | WS_CHILD | WS_VISIBLE | WS_TABSTOP
AUTORADIOBUTTON "Quarterly", ID_CHECKBOXQ, 20, 65, 44, 8, WS_CHILD | WS_VISIBLE
AUTORADIOBUTTON "Six Months", ID_CHECKBOX6, 20, 80, 51, 8, WS_CHILD | WS_VISIBLE
}
The code to read the second dialog is
Code:
GetDlgItemTextA(hDlg, IDC_EDIT7, mx, SMALL);
GetDlgItemTextA(hDlg, IDC_EDIT8, yx, SMALL);
FindMonth(mx, &mxx); // Convert string to numeric month
sscanf_s(yx, "%d", &yxx);
dd2 = DateOfEnd(mxx, yxx); // Get date of end of month
Number2 = DayNumber(yxx, mxx, dd2);
MyDates->day2 = dd2;
MyDates->month2 = mxx;
MyDates->year2 = yxx;
MyDates->DayNumber2 = Number2;
/* Check if Monthly, Quarterly or 6 Months */
if (IsDlgButtonChecked(hDlg, ID_CHECKBOXM) == BST_CHECKED)
{
LastOption = value;
value = MONTHLY;
CheckOne = ID_CHECKBOXM;
}
else if (IsDlgButtonChecked(hDlg, ID_CHECKBOXQ) == BST_CHECKED)
{
LastOption = value;
value = QUARTERLY;
CheckOne = ID_CHECKBOXQ;
}
else
{
LastOption = value;
value = SIXMONTHS;
CheckOne = ID_CHECKBOX6;
}
Can someone suggest why this is not working?