window 95串口通讯函数集合(只适用于32位)
头文件(.h) 【程序编程相关:在Visual C++中用ADO进行数据】
需要说明的是:这是我程序的一部分,因此有一些与具体应用无关的部分. 但我觉得关键是原理,而不是程序本身.后面有些使用介绍,帮助理解这长的程序. 【推荐阅读:在Visual C++中用ADO进行数据】
#define gwl_pgpsinfo 0 #define gpsextrabytes sizeof( long ) 【扩展信息:Using ADO from C++ 】
#include "stdafx.h"
#define maxports 4
#define cn_send wm_user+100
#define rxqueue 4096 #define txqueue 4096
// cursor states
#define cs_hide 0x00 #define cs_show 0x01
// flow control flags
#define fc_dtrdsr 0x01 #define fc_rtscts 0x02 #define fc_xonxoff 0x04
// ascii definitions
#define ascii_bel 0x07 #define ascii_bs 0x08 #define ascii_lf 0x0a #define ascii_cr 0x0d #define ascii_xon 0x11 #define ascii_xoff 0x13
// data structures
typedef struct taggpsinfo { handle idcomdev; byte bport; bool fconnected; byte bbytesize,bparity,bstopbits; dword dwbaudrate;
handle hpostevent,hwatchthread,hwatchevent; hwnd htermwnd; dword dwthreadid; overlapped oswrite,osread; } gpsinfo, *pgpsinfo ;
#define comdev( x ) (x -> idcomdev) #define port( x ) (x -> bport) #define connected( x ) (x -> fconnected) #define bytesize( x ) (x -> bbytesize) #define parity( x ) (x -> bparity) #define stopbits( x ) (x -> bstopbits) #define baudrate( x ) (x -> dwbaudrate)
... 下一页