CreateFile Windows COM1 [英] CreateFile Windows COM1

查看:166
本文介绍了CreateFile Windows COM1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用CreateFile在XP中打开COM1,我一直收到INVALID_HANDLE_VALUE。


这里是我正在使用的代码:


/ / main

.............

.....

....

..


展开 | 选择 | Wrap | 行号

解决方案

尝试在文件名中添加一个冒号:COM1:。


没有用。我甚至尝试过(由某些人推荐)"" ////.// COM1" :(


错误123 ...你可以在winerror.h中查找错误代码,你会发现


//

// MessageId:ERROR_INVALID_NAME

//

// MessageText:

//

//文件名,目录名或卷标语法

//不正确。

//

#define ERROR_INVALID_NAME 123L // dderror



您可能尝试过////.// COM1,但是您是否尝试使用正确的斜杠\\ \\\\\\\COM1"?


Trying to open COM1 in XP using CreateFile and I keep getting INVALID_HANDLE_VALUE.

here is the code I am using:

//main
.............
.....
....
..
.

Expand|Select|Wrap|Line Numbers

解决方案

Try adding a colon to the filename: "COM1:".


no good. I have even tried (recommended by some) ""////.//COM1" :(


Error 123... you can look up error code in winerror.h where you would find

//
// MessageId: ERROR_INVALID_NAME
//
// MessageText:
//
// The filename, directory name, or volume label syntax
// is incorrect.
//
#define ERROR_INVALID_NAME 123L // dderror

You may have tried "////.//COM1" but did you try it with the correct slash "\\\\.\\COM1"?

Actually I have to say that "COM1" has always worked for me I assume you computer has a COM1?


这篇关于CreateFile Windows COM1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆