0

I am using Visual C++ 2010 Express (that doesn't have MFC). Despite that, I have been able to create a Dialog box and populate the fields (and hopefully, soon, read back some data).
I now want to use some radio buttons.
To that end I have created two buttons with BS_AUTORADIOBUTTON as a group.
I cannot set one button active using CheckRadioButton, and if I use the form and click on the OK button, IsDlgButtonChecked returns zero no matter which button is checked.

if ((IsChecked = IsDlgButtonChecked(hDlg, IDM_SPUPD)) == BST_CHECKED)
			{
				fprintf(fp1, "Ischecked UPD (%d)\n", IsChecked);
				fflush(fp1);
			}
			else
			{
				fprintf(fp1, "Is NOT checked UPD(%d)\n", IsChecked);
				fflush(fp1);
			}

File fp1 is my debug trace file - no matter which button is clicked I ALWAYS get the "Is NOT checked" response.
The button definitions are

CONTROL "  Add", 343, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 89, 251, 32, 12
	CONTROL "  Update", 344, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE, 191, 251, 39, 12

Can someone suggest why this is not working, and if this is wrong, what I should be using?

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by NicAx64
0

your ID 343, and 344 are what?
and what's the value of IDM_SPUPD ?
could you check those values for me?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.