在C ++中访问多个COM端口 [英] Access Multiple COM Port in C++

查看:82
本文介绍了在C ++中访问多个COM端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我是C ++的新手.在我的项目中,我为我的项目使用了DLL.在C ++中创建的DLL用于访问COM端口.但是我需要同时更改多个COM端口"访问.我不知道如何要实现这一目标?请帮助我.
谢谢
问候,
Lakshmi Narayanan.S

Hi,
I am new for C++.In my Project,I used a DLL for my Project.In that DLL created in C++ for accessing COM Port.But i need to Change the Multiple COM Port access at same time.I don''t know how to achieve this ?Please help me.
Thanks
Regards,
Lakshmi Narayanan.S

推荐答案

您需要了解一些使用Windows API的基本文件操作.
首先浏览此api
http://msdn.microsoft.com/en-us/library/aa363858%28v = vs.85%29.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/aa365467% 28VS.85%29.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/ms724211%28v = VS.85%29.aspx [ ^ ]

您可以通过使用文件名称为COM1,COM2,COM3等的CreateFile来处理多个com端口.
You need to know some basic file operation using Windows APIs.
Go through this apis first
http://msdn.microsoft.com/en-us/library/aa363858%28v=vs.85%29.aspx[^]
http://msdn.microsoft.com/en-us/library/aa365467%28VS.85%29.aspx[^]
http://msdn.microsoft.com/en-us/library/ms724211%28v=VS.85%29.aspx[^]

You can get a handle to several com ports by using CreateFile with file name like COM1,COM2,COM3 and so on.


这篇关于在C ++中访问多个COM端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆