Comm1.CommName := '//./' + Trim(combx_Port.Text);

目前串口大于20  用上面方法解决的

网上也有上面方法解决如下错误的。

若是您已会应用SPCOMM且涌现10个以上的串心题目 请改一下串心名 COM1.CommName='//./com18'; 便如许减'//./'就好了我也没有晓得甚么回事....... 比方 Comm1.CommName := '//./'+ComboBox1.Text; //./com18是win]

如果你已经会使用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),                 & lt;------就是这里,要加上//./ 
                                 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这里就出错了

串口总是报'Error opening serial port'的更多相关文章

  1. 安装aptana插件报Error opening the editor. java.lang.NullPointerException

    Aptana的官方网站下载eclipse的插件:  http://update.aptana.com/update/studio/3.2/ ,可以在线安装也可以下载插件后再安装,我是以在线的形式安装的 ...

  2. Serial Port Programming using Win32 API(转载)

    In this tutorial we will learn How to communicate with an external device like a microcontroller boa ...

  3. 【Flink】flink执行jar报错:java.io.IOException: Error opening the Input Split file 或者 java.io.FileNotFoundException

    报错内容 flink执行jar时,报如下错误: org.apache.flink.client.program.ProgramInvocationException: Job failed. (Job ...

  4. 串口数据监视 Serial Port Monitor

    串口数据监视工具 Serial Port Monitor可以在其它应用读写串口时监视串口数据, 很好用,但只有15天试用期.

  5. 安卓开发error opening trace file: No such file or directory (2)报错原因

    error opening trace file: No such file or directory (2) 这个问题的出现是因为运行的测试机android系统版本和项目api不一致导致. 改成一样 ...

  6. Serial Port Programming on Linux(转载)

    This is a tutorial on how to program the Serial Ports on your Linux box.Serial Ports are nice little ...

  7. Non-standard serial port baud rate setting

    ////combuad_recv.cpp #include <stdio.h> /*标准输入输出定义*/ #include <stdlib.h> /*标准函数库定义*/ #in ...

  8. 编写ros串口节点,使用官方serial包

    参考http://www.roswiki.com/read.php?tid=557&fid=39 1.通过sudo apt-get install ros-<distro>-ser ...

  9. [转]How Can I Find Out What Is Using a Busy or Reserved Serial Port?

    转自:http://digital.ni.com/public.nsf/allkb/29B079481C5ECE76862578810082394E How Can I Find Out What I ...

随机推荐

  1. Android拍照、录像、录音代码范例

    <p>import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; import andro ...

  2. C#文件系统管理

    目录 前言 Directory类和DirectoryInfo类 File类和FileInfo类 Path类 前言 管理文件系统主要是对计算机中文件和目录的管理,例如,读取文件信息.删除文件和读取目录信 ...

  3. R提高篇(一): 输入输出

    目录: 文本输出 图形输出 数据输入 数据框输出 文本导入 Excel导入 文本输出 语法: sink(file = NULL, append = FALSE, type = c("outp ...

  4. [原]Fedora 20的yum配置

    新装了一套Fedora 20操作系统,又要开始配置yum了.下面总结以下步骤: 1.下载国内比较快的yum源 推荐163的yum源,sohu的yum源也不错,我一般就装第一个,安装163 yum源主页 ...

  5. C#.NET ,微信退款证书

    微信退款时遇到:基础连接已经关闭 连接被意外关闭. 服务器环境:WIN SERVER 2008 R2.  WINDOWS服务承载的WCF服务,基于.NET FRAMEWORK 3.5. 第一笔交易的退 ...

  6. 在Linux中使用VS Code编译调试C++项目

    最近项目需求,需要在Linux下开发C++相关项目,经过一番摸索,简单总结了一下如何通过VS Code进行编译调试的一些注意事项. 关于VS Code在Linux下的安装这里就不提了,不管是CentO ...

  7. uboot在nandflash和norflash是如何运行的

    转自:http://www.aiuxian.com/article/p-2796357.html 电子产品如果没有了电,就跟废品没什么区别,是电赋予了他们生命,然而程序则是他们的灵魂. 小时候一直很好 ...

  8. item30,最小的k个数

    剑指offer给出两类方法: 1,借助快排的思想,需要修改输入数组的元素,时间复杂度O(n) 2,借助STL中set或者multiset,因为它们的底层数据结构是红黑树实现的,插入数据时间复杂度为O( ...

  9. C# is和as操作符

    is和as操作符 is操作符:检查对象是否与给定类型兼容. 说明: 1.如果所提供的表达式非空,并且所提供的对象可以强制转换为所提供的类型而不会导致引发异常,则 is 表达式的计算结果将是 true, ...

  10. Exception error message with incorrect line number

    In Release mode the number in front of the exception is NOT the line of code. Instead it's an offset ...