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
# 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
# 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.