3

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?

David Szalai
  • 2,363
  • 28
  • 47
Suri
  • 3,287
  • 9
  • 45
  • 75
  • I have run into a similar problem with the ATL wizard of Visual Studio 2005 in which using the Add Method wizard from Class View to add a method to an interface failed with this message. Using the answer below of deleting the Intellisense file (.ncb) worked for me. – Richard Chambers Jul 09 '15 at 23:48

3 Answers3

3

I meet this issue on VS 2022. I solved it by these steps:

  1. closing VS solution.
  2. delete .vs directory
  3. re-open *.sln
Jasper Li
  • 81
  • 5
2

Delete the Class Wizard file (.clw) and the Intellisense file (.ncb) file from your solution directory and try again.

  • I had the same problem with Visual Studio 2005 when creating an C++ ATL control. I deleted the Intellisense file (.ncb) from the solution directory and after reopening the project the Add Method wizard in the Class View started working. Thanks loads! – Richard Chambers Jul 09 '15 at 23:46
0

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.

Sunscreen
  • 3,452
  • 8
  • 34
  • 40