引用本文:李东晓,李晓明.实现基于Visual C+ +7.0的多线程串口通信[J].电力自动化设备,2002,(9):13-16
.Implementation of multithread serial communication with Visual C+ +7.0[J].Electric Power Automation Equipment,2002,(9):13-16
【打印本页】   【HTML】   【下载PDF全文】   查看/发表评论  【EndNote】   【RefMan】   【BibTex】
←前一篇|后一篇→ 过刊浏览    高级检索
本文已被:浏览 3009次   下载 0 本文二维码信息
码上扫一扫!
实现基于Visual C+ +7.0的多线程串口通信
李东晓,李晓明
作者单位
摘要:
串口通信程序多是用微软提供的MSComm控件实现的,但MSComm控件实现方法很难加入多线程技术提高程序的执行效率,尤其对微机与多台智能设备之间同时进行通信,这种方法的单线程局限性就更明显。为此,深入介绍了32位串口通信的结构体和WindowsAPI函数及多线程编程技术,,并结合面向对象的编程思想,将WindowsAPI函数、结构体及多线程技术进行了封装,形成新的串口通信类CCommunication,该类可以实现MSComm控件的所有功能,用该类开发的程序比用MSComm控件开发的程序的执行速度快。应用该类可很方便地实现基于Visual C 7.0多线程串口通信,且具有通用性好,使用性强等优点。
关键词:  VisualC++7.0 多线程 串口通信 MSComm控件 面向对象 程序设计
DOI:
分类号:TP311.1
基金项目:
Implementation of multithread serial communication with Visual C+ +7.0
LI Dong xiao  LI Xiao ming  XIAO Kun  ZHANG Fa zhong  PENG Jia yin
Abstract:
Most serial communication programs are developed with MSComm control supplied by Microsoft,but Multithread technology could not be easily added into it.The defect is more noteworthy in multi CPU communication.The structs and Windows API functions of 32?bit serial communication and the multithread programming technique are introduced.According to the OOP,the structs and functions are encapsulated to form a new class CCommunication.It can realize all the functions produced by MSComm control,and the efficiency of the program developed with it is better than that with the MSComm control.The multithread serial communication programming based on Visual C++7.0 becomes easier with better transplantability and practicability.
Key words:  Visual C++7.0,Windows API,struct,multithread,serial communication,

用微信扫一扫

用微信扫一扫