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 problem dialog is defined as
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
}
and is read using
GetDlgItemTextA(hDlg, IDC_EDIT7, mx, SMALL);
GetDlgItemTextA(hDlg, IDC_EDIT8, yx, SMALL);
FindMonth(mx, &mxx); // convert from character name to numeric month
sscanf_s(yx, "%d", &yxx); // string to numeric year
dd2 = DateOfEnd(mxx, yxx); // Get last day of month
Number2 = DayNumber(yxx, mxx, dd2);
MyDates->day2 = dd2;
MyDates->month2 = mxx;
MyDates->year2 = yxx;
MyDates->DayNumber2 = Number2;
/* Check if Quarterly or Monthly */
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;
}
Investigation shows mx and yx both are null strings, and value is always SIXMONTHS.
As I said I have a different dialog box that only uses six Get's and that works perfectly. As far as I can see I have coded this correctly.
What am I doing wrong?

New Topic/Question
Reply



MultiQuote





|