BOOL m_bConnected; BOOL ClosePort(HANDLE hCommPort); //关闭串口 DWORD WritePort(TCHAR *buf,DWORD dwBytesToWrite); //写数据 BOOL OpenPort(LPTSTR lpszPortName); //打开串口 CSerial(); HANDLE hReadThread; virtual ~CSerial(); }; #endif // !defined(AFX_SERIAL_H__59575586_AAA9_4FEF_B2A7_E089553698EF__INCLUDED_) 源文件:Serial.cpp // Serial.cpp: implementation of the CSerial class. // ///////////////// #include "stdafx.h" #include "Serial.h" #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif HANDLE hPort; CString strInChar; ////////////////////////////////////////// // Construction/Destruction ///////////////////////////////////////// 希望看到更多更经典的开发技巧,请随时刷新《开发特区》栏目。 |
正在阅读:VC学习:Windows CE下的串口通讯类VC学习:Windows CE下的串口通讯类
2004-02-14 09:34
出处:PConline
责任编辑:linjixiong
键盘也能翻页,试试“← →”键