I have 2 radio button under a group box and i made first one group as true. but when i am adding radio button variable the it showing message "Failed to return new code element possibly a syntax error", what would be the reason?
Failed to return new code element, Possible syntax error
4.6k views Asked by Suri At
3
There are 3 answers
0
On
You need to have only one variable for your data and one for your control for your grouped Controls:
int m_RBData;
CRadio m_RBControl;
Then you need to group all ID Controls within the linked function like this:
ON_CONTROL_RANGE(BN_CLICKED,IDC_RB,IDC_RB3,OnClickRb)
You also need to add reference to String Table:
1R__C 0,1,2 in your first ID (IDC_RB).
Now your data variable, takes the values 0,1 or 2 whenever you click the first, the second or the third radio button respectively.
Delete the Class Wizard file (.clw) and the Intellisense file (.ncb) file from your solution directory and try again.