在VC ++中的串行端口中创建文件 [英] Create File in the Serial Port in VC++

查看:86
本文介绍了在VC ++中的串行端口中创建文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


是否可以在COM端口中同时创建多个文件?请告诉我 .如何解决这个问题??
在此先感谢..
问候,
Lakshmi Narayanan.S

Hi,
Is it Possible to create more than one file in the COM Port at same time? Please tell me . how to solve this problem.?
Thanks in Advance..
Regards,
Lakshmi Narayanan.S

推荐答案

如果您的意思是:我是否可以一次通过CreateFile多次打开同一串行端口?"答案是.
串行端口不是共享设备,并且文档明确指出(通信资源在MSDN上 [ ^ ]):

If you mean: "Can I open the same serial port, via CreateFile more than once at time?" the answer is no.
The serial port is not a shared device and the documentation clearly states ("Communications Resources" at MSDN[^]):

当进程使用CreateFile打开通信资源时,它必须为以下参数指定某些值:
  • fdwShareMode参数必须为零,打开用于独占访问的资源.
  • fdwCreate参数必须指定OPEN_EXISTING标志.
  • hTemplateFile参数必须为NULL.
When the process uses CreateFile to open a communications resource, it must specify certain values for the following parameters:
  • The fdwShareMode parameter must be zero, opening the resource for exclusive access.
  • The fdwCreate parameter must specify the OPEN_EXISTING flag.
  • The hTemplateFile parameter must be NULL.

  • 这篇关于在VC ++中的串行端口中创建文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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