关于大于9的串口打开失败的原因
例如 打开 COM15 CreateFile参数中串口名字是: "\\\\.\\COM15" 而不是"COM15"
Windows automatically maps COM1-COM9 ports to the right device name. COM ports with higher numbers should be opened as \\.\COMxxx, where xxx is a port number.
Example for VB:
hPort = CreateFile("\\.\COM15", ...);
Example for Delphi:
hPort := CreateFile('\\.\COM15', ...);
例如 打开 COM15 CreateFile参数中串口名字是: "\\\\.\\COM15" 而不是"COM15"
http://www.advancedvirtualcomport.com/faq.html (该文章还有其他关于串口的问题解答)
Windows automatically maps COM1-COM9 ports to the right device name. COM ports with higher numbers should be opened as \\.\COMxxx, where xxx is a port number.
Example for C/C++/C#:
hPort = CreateFile("\\\\.\\COM15", ...);
Example for VB:
hPort = CreateFile("\\.\COM15", ...);
Example for Delphi:
hPort := CreateFile('\\.\COM15', ...);

本文介绍了解决Windows系统中编号高于9的串口(如COM15)无法正常打开的问题。通常情况下,直接使用如COM15这样的名称会遇到问题,正确的做法是在串口名称前加上\.前缀,即使用\.COM15的形式来正确打开这些高编号的串口。
4290

被折叠的 条评论
为什么被折叠?



