dialogs and DDX_Radio()

This is a discussion on dialogs and DDX_Radio() within the Windows Programming forums, part of the Platform Specific Boards category; I need help getting from a radio button to a cstring. I need to find out the sex of the ...

dialogs and DDX_Radio()

I need help getting from a radio button to a cstring. I need to find out the sex of the user but am not sure how to use the DDX_Radio function to find out which button is checked. Here is what I have so far but it crashes at run time when I try to open the dialogbox.

ok I've sorted that now, I used the aptly named function IsDlgButtonChecked(...)

The problem now is that I need to ensure that at least 1 radio button is checked. The best way for me to do this would be to displaya messagebox when the user hits ok, but I dont know where to put the code for that. That way a number of different things could be checked, like other buttons and stuff. This is the code that calls the dialog box:

One solution is an event handler. Add an event handler for the radio buttons. When there is a change, traverse through them and determine their status. If none of the radio buttons is checked, then prompt the user.

Isn't there a simpler way? All I want is to check that 1 of 2 bools has been set to true, and other similar things with other buttons. I was hoping I could just check the variables and prompt the user to finish off the input before the dialog closes?

Btw, I've made this dialog with the visual editor so what is the easiest way to access the different components, like radio buttons?