PRB: GetCheckedRadioButton() Returns ID Outside Button Group (138663)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++ 1.51
- Microsoft Visual C++ 1.52
- Microsoft Visual C++, 32-bit Editions 2.0
- Microsoft Visual C++, 32-bit Editions 2.1
- Microsoft Visual C++, 32-bit Editions 2.2
- Microsoft Visual C++, 32-bit Editions 4.0
This article was previously published under Q138663 SYMPTOMS
Usually, the intention while using the CWnd::GetCheckedRadioButton()
function is to retrieve, from a group of option buttons, the ID of the
one that is selected. However, if it is not used correctly, this function
may return the ID of a selected button that lies outside a button group.
CAUSE
The CWnd::GetCheckedRadioButton() function takes two arguments:
nIDFirstButton -- the ID of the first option button.
nIDLastButton -- the ID of the last option button in a group.
It returns the ID of the selected option button in a group of option
buttons if both the following conditions hold:
- The IDs of the option buttons in the group are consecutive
-and-
- The IDs are in ascending order
If these conditions are not met, the function may either fail (return 0) or
return the ID of a control that is not in the option button group.
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 12/2/2003 |
---|
Keywords: | kbButton kbhowto kbprb KB138663 |
---|
|