程序写出来了,目的是向串口传数据,但是我写的程序运行之后不管按哪个按钮发的数据是一样的,不知道是哪儿的问题,希望高手能帮忙看一下,感激不尽
void CCarSmartDlg::OnButton() 
{
// TODO: Add your control notification handler code here
if(m_radio1 == 1)  //1号车停
{
m_strTXData = "0001";

}
else if(m_radio2 == 2)  //1号车慢
{
m_strTXData = "0002";

}
    else if(m_radio3 == 3)  //1号车快
{
m_strTXData = "0003";
}
else if(m_radio4 == 4)  //1号车停
{
m_strTXData = "0101";
}
else if(m_radio5 == 5)  //1号车停
{
m_strTXData = "0102";
}
else if(m_radio6 == 6)  //1号车停
{
m_strTXData = "0103";
}
else if(m_radio7 == 7)  //1号车停
{
m_strTXData = "0201";
}
else if(m_radio8 == 8)  //1号车停
{
m_strTXData = "0202";
}
else if(m_radio9 == 9)  //1号车停
{
m_strTXData = "0203";
}  
m_ctrlComm.SetOutput(COleVariant(m_strTXData));//发送数据
}
void CCarSmartDlg::OnRadio1() 
{
// TODO: Add your control notification handler code here
    m_radio1 = 1;
}void CCarSmartDlg::OnRadio2() 
{
// TODO: Add your control notification handler code here
    m_radio2 = 2;
}void CCarSmartDlg::OnRadio3() 
{
// TODO: Add your control notification handler code here
m_radio3 = 3;
}void CCarSmartDlg::OnRadio4() 
{
// TODO: Add your control notification handler code here
m_radio4 = 4;
}void CCarSmartDlg::OnRadio5() 
{
// TODO: Add your control notification handler code here
m_radio5 = 5;
}void CCarSmartDlg::OnRadio6() 
{
// TODO: Add your control notification handler code here
m_radio6 = 6;
}void CCarSmartDlg::OnRadio7() 
{
// TODO: Add your control notification handler code here
m_radio7 = 7;
}void CCarSmartDlg::OnRadio8() 
{
// TODO: Add your control notification handler code here
m_radio8 = 8;
}void CCarSmartDlg::OnRadio9() 
{
// TODO: Add your control notification handler code here
m_radio9 = 9;
}