I have a problem with my radio button groups.
I am working on an SDI app based on CFormView, with multiple views, 12 views. Most views have several radio groups. I coded view1, then reread the specs and found that the operator could choose any one of the group, or none. To allow the operator to correct a mistake, I used toggle logic to remove a check from a group, to clear the entire group. CheckDlgButton(nID, 0) did this. It worked.
I then coded the rest of the views and found that it worked for some of them, but not for others. On the views that it didn't work, the radio groups behaved normally--as standard radio logic should--but a checked button would not toggle clear. The following are the symptoms.
1. GetDlgCtrlID() works, and returns the correct ID.
2. GetCheckedRadioButton(nIDfirst,nIDlast) always returns 0, even though one of the buttons is checked.
3. CheckDlgButton(nID,0) does not work--the button stays checked.
4. Either all groups in a view work, or they all don't work--the toggle function that is.
Coding is keyed on the OnButton() entry. All buttons in a view are mapped to a single OnButton function and that function calls a single master utility function. There is one and only one function-set to process all controls for all views.
In the resource editor, I carefully reviewed the setup, at least a dozen times. The tab order is sequentially correct. The 1st button is group-checked, the last button + 1 is group-checked, whatever that control happens to be. The groups work as standard (non-toggling) groups should.
This occurred with version 5, but it's still here now that I have migrated to .net 2003.
I sure hope someone out there knows what's going on here.
I am working on an SDI app based on CFormView, with multiple views, 12 views. Most views have several radio groups. I coded view1, then reread the specs and found that the operator could choose any one of the group, or none. To allow the operator to correct a mistake, I used toggle logic to remove a check from a group, to clear the entire group. CheckDlgButton(nID, 0) did this. It worked.
I then coded the rest of the views and found that it worked for some of them, but not for others. On the views that it didn't work, the radio groups behaved normally--as standard radio logic should--but a checked button would not toggle clear. The following are the symptoms.
1. GetDlgCtrlID() works, and returns the correct ID.
2. GetCheckedRadioButton(nIDfirst,nIDlast) always returns 0, even though one of the buttons is checked.
3. CheckDlgButton(nID,0) does not work--the button stays checked.
4. Either all groups in a view work, or they all don't work--the toggle function that is.
Coding is keyed on the OnButton() entry. All buttons in a view are mapped to a single OnButton function and that function calls a single master utility function. There is one and only one function-set to process all controls for all views.
In the resource editor, I carefully reviewed the setup, at least a dozen times. The tab order is sequentially correct. The 1st button is group-checked, the last button + 1 is group-checked, whatever that control happens to be. The groups work as standard (non-toggling) groups should.
This occurred with version 5, but it's still here now that I have migrated to .net 2003.
I sure hope someone out there knows what's going on here.