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. 【转】JS跨域(ajax跨域、iframe跨域)解决方法及原理详解(jsonp)

    这里说的js跨域是指通过js在不同的域之间进行数据传输或通信,比如用ajax向一个不同的域请求数据,或者通过js获取页面中不同域的框架中(iframe)的数据.只要协议.域名.端口有任何一个不同,都被 ...

  2. Zookeeper工作原理二

    ZooKeeper是Hadoop的正式子项目,它是一个针对大型分布式系统的可靠协调系统,提供的功能包括:配置维护.名字服务.分布式同步.组服务等.ZooKeeper的目标就是封装好复杂易出错的关键服务 ...

  3. MVC 将视图页table导出成excel

    前台代码: <table class="tablelist" id="myTable">    <thead>        <t ...

  4. eclipse中复制项目更名注意事项

    一.更改项目名称 web project Settings; 二.pom.xml中的项目名称更改

  5. 转:vs发布window应用程序时出错:未能签名 ...\setup.exe

      在vs发布window应用程序过程中,提示“SignTool 报告了一个错误‘未能签名 ...\setup.exe.SignTool 错误: ISignCode::Sign 返回的错误: 0x80 ...

  6. WIN 8.1 x64 环境下 COM Surrogate 停止工作解决方案

    我的笔记本电脑是THINKPAD T420 4180AT8,NVIDIA NVS 4200M,Intel(R) HD Graphics 3000,WIN 8.1 x64操作系统.在安装完NVIDIA独 ...

  7. WebAPI 安全性 使用TOKEN+签名验证(上)

    首先问大家一个问题,你在写开放的API接口时是如何保证数据的安全性的?先来看看有哪些安全性问题在开放的api接口中,我们通过http Post或者Get方式请求服务器的时候,会面临着许多的安全性问题, ...

  8. USACO CHAPTER 1 1.1 Ride 水题

    水题,主要是学习文件输入输出. /* ID: ijustwa1 LANG: C++ TASK: ride */ #include<cstdio> #include<cstring&g ...

  9. NeHe OpenGL教程 第二十一课:线的游戏

    转自[翻译]NeHe OpenGL 教程 前言 声明,此 NeHe OpenGL教程系列文章由51博客yarin翻译(2010-08-19),本博客为转载并稍加整理与修改.对NeHe的OpenGL管线 ...

  10. linux 常用alias

    alias qqcom='cd /usr/local/qqcom_app/' alias php_c='cd /usr/local/php/lib/' alias ap_c='cd /usr/loca ...