When running an old MFC application in Visual Studio's debugger I've seen a lot of warnings in the Output window like the following:
Warning: skipping non-radio button in group.
I understand that in MFC you put radio buttons in groups to indicate which sets of radio buttons go together. If I remember correctly you do this by setting the "group" property of the first radio button to true, and then set the rest of the radio buttons "group" property to false.
I have three questions about this warning.
How do you get rid of this warning? Do you have to set the "group" property of all non-radio button controls to true to avoid this, or should you just set it for the first control after the last radio button?
Is there an easy way to figure out what controls or dialogs have this problem? I could open each dialog and fiddle with it until the warning pops up. This application has a lot of dialogs though, so it would be nice if there was an easier way.
What negative behavior can occur if you don't fix this warning? In other words, does this even matter?
Between the responses here and some research in old forums I think I've figured out at least how to fix my problems. Here is what I've found out for my above questions.
ChrisN and Smashery suggested that I reorder the tabs to make sure radio buttons are ordered sequentially, and this did fix some of the warnings.
Additionally, the first control in the tab order after the radio button group must have the WS_GROUP property set (or the group property set to true in the editor). This tells MFC that the radio button group has ended. Without it all remaining controls in the tab order until the next WS_GROUP will generate the warning. After doing both these things the warnings in these dialogs went away.
This is still an open question, I didn't find a good way to locate these problems without opening each dialog and waiting for warnings.
If you know a dialog is creating this warning but you don't know what control is causing it, you can set a breakpoint in the DDX_Radio() function on the TRACE() call that generates the warning. This can make it easier to identify the specific control that is being complained about.
I agree with ChrisN, I can't think of any reason for this warning other than to make you double check your tab order. Elsewhere online I can't find any other reference to a problem that this might cause.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With