我用虚拟串口工具虚拟出20个串口,但是程序只能认到9,超过10,在ClearCommError时,返回错误,请教是怎么回事。
解决方案 »
- 这个功能是怎么实现的?
- odbc,ado,与oracle,sql server的驱动程序有什么区别?请各位赐教?
- 为什么编译时会提示缺少XPWINDOW.DCU
- 二进制文件有结构,请问怎么读出来呀.
- ???如何将查询内容保存到预先定义好的另外一张表内???
- 我眼中的Delphi8.net?(来者有分!)
- DataBase Desktop中的Alias新增与MS Access的连接失败。急请教。
- 一个简单的问题..(在线等待)
- 请问,在查询摸块上填入查询条件在edit控件里面,按回车怎样激活旁边的查询按钮
- 有关数据库路径问题,????????????????
- 放分100为妈妈压惊!
- 一个image调图片的问题!
就可
CreateFile() can be used to get a handle to a serial port. The "Win32 Programmer's Reference" entry for "CreateFile()" mentions that the share mode must be 0, the create parameter must be OPEN_EXISTING, and the template must be NULL.CreateFile() is successful when you use "COM1" through "COM9" for the name of the file; however, the message
INVALID_HANDLE_VALUE
is returned if you use "COM10" or greater.If the name of the port is \\.\COM10, the correct way to specify the serial port in a call to CreateFile() is as follows:
CreateFile(
"\\\\.\\COM10", // address of name of the communications device
fdwAccess, // access (read-write) mode
0, // share mode
NULL, // address of security descriptor
OPEN_EXISTING, // how to create
0, // file attributes
NULL // handle of file with attributes to copy
);
问题搞定。