Delphi使用spcomm串口通信 串口号大于10出错的解决办法 spcomm error opening serial port
来源:互联网 发布:淘宝网页怎么看直播 编辑:程序博客网 时间:2024/05/16 12:09
如果你已经会使用SPCOMM且出现10个以上的串口问题
请改一下串口名
COM1.CommName='//./com18';
就这样 加'//./'就行了我也不知道什么回事.......
比如
Comm1.CommName := '//./'+ComboBox1.Text;
//./com18是windows里边的SymbolLinkName,这个在WINAPI里边就需要这样写,SPCOMM的这部分的源代码如下:
procedure TComm.StartComm;
var
hNewCommFile: THandle;
begin
// Are we already doing comm?
if (hCommFile <> 0) then
raise ECommsError.Create( 'This serial port already opened' );
hNewCommFile := CreateFile( PChar(FCommName), <------就是这里,要加上//./
GENERIC_READ or GENERIC_WRITE,
0, {not shared}
nil, {no security ??}
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL or FILE_FLAG_OVERLAPPED,
0 {template} );
if hNewCommFile = INVALID_HANDLE_VALUE then
raise ECommsError.Create( 'Error opening serial port' );
^^^^^^^^^^^^^^^^^^^^^^^^^^^如果不是SymbolLinkName写法,串口号大于9这里就出错了
- Delphi使用spcomm串口通信 串口号大于10出错的解决办法 spcomm error opening serial port
- Delphi中串口通信SPCOMM的实现
- Delphi中SpComm串口通信的实现
- Delphi里使用SPComm串口控件的一个乌龙BUG
- DELPHI 串口通讯编程 SPCOMM
- Spcomm串口控件的例程
- Delphi使用spcomm实现串口通信 基础知识及(两个实例)
- Delphi使用spcomm实现串口通信 基础知识及(两个实例)
- 在Delphi中用SPCOMM实现串口编程
- Delphi下SPCOMM串口编程(转)
- Delphi开发环境下利用Spcomm控件实现PC机与单片机之间串口通信的方法
- 串口调试成功 yeah SPCOMM
- 用SPCOMM 在 Delphi中实现串口通讯
- 用SPCOMM 在 Delphi中实现串口通讯
- 用SPCOMM 在 Delphi中实现串口通讯
- 用SPCOMM 在 Delphi中实现串口通讯
- 用SPCOMM 在 Delphi中实现串口通讯
- SPCOMM控件在Delphi7.0串口通信中的应用
- Introduction - Linux Kernel Crash Dump
- OMS
- C++的流派
- Linux: Kernel Crash Dumps
- 关于PCL以及PCL 从一到五综述
- Delphi使用spcomm串口通信 串口号大于10出错的解决办法 spcomm error opening serial port
- 002-C和指针
- PCL 6 综述
- MFC使用ini文件
- Installation Mechanism
- N001.微软打造新手机操作系统:改变手机业游戏规则
- Quick reference of Autoboxing in JDK 1.5
- N002.解读Adobe PhotoShop的20年发展之路
- 白帝托孤杂论(一)