当前位置:首页 » 多媒体相关

想学习利用vc进行计算机串口或者usb口与外部通讯的知识,应该看哪一部分?


期待指教中~~

推荐阅读

  • 华硕服务器助力网游巨作《傲世Online》 信息化解决方案/案例资料中心 [详细内容]
  • Network Appliance存储技术培训机构落户北京 [详细内容]
  • 一个不知是不是错误的错误 [详细内容]
  • 华硕打造高可用主动自调度集群服务系统 信息化解决方案/案例资料中心 [详细内容]
  • Network Appliance继续保持IP SAN和NAS市场的领导地位 [详细内容]
  • 关于大家认为820的BUG [详细内容]
  • 惠普推两款服务器新品 对抗IBM、Sun竞争 服务器存储频道 [详细内容]
  • 网友回答:
    网友:ljmanage

    串口的话,vc中有现成的类,好像是cserial,  
       
       
       
      我这里有个写好的类  
      头文件是  
      //   serial.h  
       
      #ifndef   __serial_h__  
      #define   __serial_h__  
       
      #define   fc_dtrdsr               0x01  
      #define   fc_rtscts               0x02  
      #define   fc_xonxoff             0x04  
      #define   ascii_bel               0x07  
      #define   ascii_bs                 0x08  
      #define   ascii_lf                 0x0a  
      #define   ascii_cr                 0x0d  
      #define   ascii_xon               0x11  
      #define   ascii_xoff             0x13  
       
      class   cserial  
      {  
       
      public:  
      cserial();  
      ~cserial();  
       
      bool   open(   int   nport   =   2,   int   nbaud   =   9600   );  
      bool   close(   void   );  
       
      int   readdata(   void   *,   int   );  
      int   senddata(   const   char   *,   int   );  
      int   readdatawaiting(   void   );  
       
      bool   isopened(   void   ){   return(   m_bopened   );   }  
       
      protected:  
      bool   writecommbyte(   unsigned   char   );  
       
      handle   m_hidcomdev;  
      overlapped   m_overlappedread,   m_overlappedwrite;  
      bool   m_bopened;  
       
      };  
       
      #endif  
     

    .

    讨论区

    Login