主题:[讨论]为什么程序只能计算一次?
我用VC编的界面,上面放有两组RADIO BUTTON的单选按钮,第一组是IDC_RADIO1,IDC_RADIO2,IDC_RADIO3,IDC_RADIO4,第二组是IDC_RADIO5,IDC_RADIO6,IDC_RADIO7,已经将IDC_RADIO1和IDC_RADIO5的Group属性选中。但是每次的程序计算一次后,不能重新选择按钮进行第二次运算,比如,我第一次选择的是IDC_RADIO1和IDC_RADIO5,计算完成后,我想换成IDC_RADIO1和IDC_RADIO6的条件进行计算,可是这是程序就会出错终止。请问这个问题该怎么解决呢?m_typearray变量关联的是IDC_RADIO5,IDC_RADIO6,IDC_RADIO7,m_arth变量关联的是IDC_RADIO1,IDC_RADIO2,IDC_RADIO3,IDC_RADIO4。
switch(m_typearray)
{
case 0: //1号阵型
{
switch(m_arth)
{
case 0:
gacmfp1();
break;
case 1:
gamvcal1();
break;
case 2:
gamccal1();
break;
case 3:
gavclmcal1();
break;
default:
break;
}
}
break;
case 1: //2号阵型
{
switch(m_arth)
{
case 0:
gacmfp2();
break;
case 1:
gamvcal2();
break;
case 2:
gamccal2();
break;
case 3:
gavclmcal2();
break;
default:
break;
}
}
break;
case 2: //3号阵型
{
switch(m_arth)
{
case 0:
gacmfp3();
break;
case 1:
gamvcal3();
break;
case 2:
gamccal3();
break;
case 3:
gavclmcal3();
break;
default:
break;
}
}
break;
default:
break;
}
switch(m_typearray)
{
case 0: //1号阵型
{
switch(m_arth)
{
case 0:
gacmfp1();
break;
case 1:
gamvcal1();
break;
case 2:
gamccal1();
break;
case 3:
gavclmcal1();
break;
default:
break;
}
}
break;
case 1: //2号阵型
{
switch(m_arth)
{
case 0:
gacmfp2();
break;
case 1:
gamvcal2();
break;
case 2:
gamccal2();
break;
case 3:
gavclmcal2();
break;
default:
break;
}
}
break;
case 2: //3号阵型
{
switch(m_arth)
{
case 0:
gacmfp3();
break;
case 1:
gamvcal3();
break;
case 2:
gamccal3();
break;
case 3:
gavclmcal3();
break;
default:
break;
}
}
break;
default:
break;
}