Please Help...UpdateData Answer...

Hi Guy's
i have a little problem..
i want to use an UpdateData (TRUE);
when i press my OnCalculate (button) Function...
then i want to do this within my UpdateDate ...

UpdateData (TRUE);
if
" Hex radio button checked "
then goto my function OnBhex function
else
if " Ascii radio button checked"
then goto my function OnBascii function
else
if " decimal radion button checked"
then goto my function OnBdecimal function

is this possible ?
and if so can somebody point me in the right direction to get this done...
please i need help.....(ok not so desperate steve)
many thanks
steve
[694 byte] By [stephenwhite] at [2007-11-16 5:40:35]
# 1 Re: Please Help...UpdateData Answer...
Bind your check boxes to boolean value using the class wizzard
ric980 at 2007-11-10 4:42:09 >
# 2 Re: Please Help...UpdateData Answer...
Assuming you have mapped Boolean variables to your buttons in the object wizard.

UpdateData (TRUE);

if (m_hex_radio_button)
OnHex(...)
else if (m_bascii_button)
OnBAscii
else
OnBDecimal
pebbles at 2007-11-10 4:43:09 >
# 3 Re: Please Help...UpdateData Answer...
upon checking i dont think my radio buttons have been mapped to the variables within class wizard
how can i do that
or do i have to start again ?
thanks
steve
stephenwhite at 2007-11-10 4:44:09 >
# 4 Re: Please Help...UpdateData Answer...
Hi ric.
it does'nt look like class wizard has mapped them across when i designed the dialog box
im trying to do it now but can't seem to find a way .....any ideas
many thanks
steve
stephenwhite at 2007-11-10 4:45:03 >
# 5 Re: Please Help...UpdateData Answer...
You are absolutely right, Classwizard does not allow you to map a member variable to a radio button - why, I do not know! You can however use CWnd::GetCheckedRadioButton () to find out which of your radio buttons are checked, it takes two parameters, the ID of the first radio button to look at, and the ID of the last.

Assuming you have three radio buttons as follows:
IDC_HEX = 1001
IDC_DEC = 1002
IDC_BIN = 1003

then the following code should do what you want:

switch (GetCheckedRadioButton (IDC_HEX, IDC_BIN)
{
case IDC_HEX:
{
// Do stuff for Hexadecimal
break;
}
case IDC_DEC:
{
// Do stuff for Decimal
break;
}
case IDC_OCT:
{
// Do stuff for Octal
break;
}
}

Hope this helps.
Darren.
Darren Wood at 2007-11-10 4:46:13 >
# 6 Re: Please Help...UpdateData Answer...
it will not let me map the buttons in the wizard.
any ideas
steve
stephenwhite at 2007-11-10 4:47:14 >