Here is my message handling function:
I just have this set up to test my radio buttons when I hit the "OK" button, but it seems like when I hit "OK" it isn't processing my SetAlarmTime function again. The ampm variable does change to the proper value after I hit the radio button, but when I hit "OK" the value is always what I initialized the ampm variable as (in this case, 0).
Am I going to have to create separate methods to set the members of the class individually? (one for h, min, and ampm)? I just want to set them all at once at the end...
Thanks for any help
-blazko
code:<HR>Code:BOOL CALLBACK ConfigProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { CAlarmTime alarm(0,0,0); int h=0,min=0,ampm=0;<P> switch(uMsg) {<P> case WM_INITDIALOG: CheckRadioButton(hWnd,IDC_RADIO1,IDC_RADIO2,IDC_RADIO1); return TRUE; case WM_COMMAND: if(HIWORD(wParam)==BN_CLICKED) { switch(LOWORD(wParam)) {<P> case IDC_RADIO1: ampm=0; CheckRadioButton(hWnd,IDC_RADIO1,IDC_RADIO2,IDC_RADIO1); return TRUE;<P> case IDC_RADIO2: ampm=1; CheckRadioButton(hWnd,IDC_RADIO1,IDC_RADIO2,IDC_RADIO2); return TRUE; } }<P> if(wParam==IDOK) { alarm.SetAlarmTime(h,min,ampm); alarm.PrintAlarmTime(); return TRUE; }<P> if(wParam==IDCANCEL) { EndDialog(hWnd,0); return TRUE; }<P> return TRUE;<P> case WM_CLOSE: EndDialog(hWnd,0); return TRUE;<P> }<P> return FALSE; }
I just have this set up to test my radio buttons when I hit the "OK" button, but it seems like when I hit "OK" it isn't processing my SetAlarmTime function again. The ampm variable does change to the proper value after I hit the radio button, but when I hit "OK" the value is always what I initialized the ampm variable as (in this case, 0).
Am I going to have to create separate methods to set the members of the class individually? (one for h, min, and ampm)? I just want to set them all at once at the end...
Thanks for any help
-blazko