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.
Code:
void NewCompetitorDlg::DoDataExchange( CDataExchange* pDX )
{
CDialog :: DoDataExchange( pDX );
DDX_Text( pDX, IDC_EDIT_FIRST, newCompetitor->m_firstname );
DDV_MaxChars( pDX, newCompetitor->m_firstname, 20 );
DDX_Text( pDX, IDC_EDIT_LAST, newCompetitor->m_lastname );
DDV_MaxChars( pDX, newCompetitor->m_lastname, 40 );
DDX_Text( pDX, IDC_EDIT_SCHOOL, newCompetitor->m_school );
DDV_MaxChars( pDX, newCompetitor->m_school, 40 );
DDX_Radio( pDX, IDC_MALE, newCompetitor->m_sex );
DDX_Radio( pDX, IDC_FEMALE, newCompetitor->m_sex );
}
In case it isnt clear I have a compeitior object which contains a CString which needs to contain the competitors gender.
tia