0

I'm a newbie learning to make a MFC App C++ in Visual Studio 2019.

I have 1 EDIT CONTROL, ID = txtResult, with a value CString variable resultText.

I have a group of 2 RADIO BUTTONS:

  • ID: btnUp
  • ID: btnLow

and I have 1 "Apply" BUTTON with ID = btnApply.

I tried adding a variable to the radio button itself (Right-Click, Add Variable, Category: Value, bool variable radioUp) but I get an error as soon as I run with that added in dlgdata.cpp.

Debug Assertion Failed! File: d:\agent_work\3\s\src\vctools\VC7Libs\Ship\ATLMFC\Src\MFC\dlgdata.cpp Line: 269

The error is getting in the way; it doesn't seem to like me assigning a bool variable to the radio button itself.

  • 1
    [Prerequisites for learning MFC programming](https://stackoverflow.com/q/18165076/1889329). – IInspectable Dec 02 '20 at 10:09
  • Assure that radioUpperCase and other radio button member variable are valid, and call UpdateData() before use it. – Flaviu_ Dec 02 '20 at 12:53
  • Have you looked at [the documentation for `DDX_Radio`](https://learn.microsoft.com/en-us/cpp/mfc/reference/standard-dialog-data-exchange-routines?view=msvc-160#ddx_radio)? It's not a boolean value per control, it's a single integer telling you *which* control is selected. – Mark Ransom Dec 03 '20 at 05:57

0 Answers0