rt!

解决方案 »

  1.   

    DCB m_dcb;
    GetCommState(m_hComDev, &m_dcb);
    m_dcb.Parity = nParity;
    SetCommState(m_hComDev, &m_dcb);其中nParity就是你要设置的奇偶效验的值, m_hComDev为打开串口的ID
      

  2.   

    SetCommState
    http://www.xiao-qi.com/netfile/PC_MCU_VC.html
    http://www.pcvc.net/category/content.asp?sendid=279
    http://www.gjwtech.com/scomm/sc2vc6serialprogexamle.htm
      

  3.   

    http://www.cetinet.com/t_article/list.asp?indexid=1473
      

  4.   

    DCB.Parity=NOPARITY;    //无校验
            DCB.Parity=ODDPARITY;   //奇校验
            DCB.Parity=EVENPARITY;  //偶校验 
            DCB.Parity=MARKPARITY;  //校验置位(第9位置1)                 
            DCB.Parity=SPACEPARITY; //校验清零(第9位置0)
      

  5.   

    DCB m_dcb;
    GetCommState(m_hComDev, &m_dcb);
    m_dcb.Parity = nParity;
    SetCommState(m_hComDev, &m_dcb);