amo:
你的串口数超过十个了么?这么改一下试试。
[阅读: 616] 2007-04-15 16:13:03
[code='php']
// 支持COM10 以上的串口
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} );
//或者试试把下面这段注释掉,不过这可不是什么好招
// Is this a valid comm handle?
if GetFileType( hNewCommFile ) <> FILE_TYPE_CHAR then
begin
CloseHandle( hNewCommFile );
FPortOpenError := 'File handle is not a comm handle ';
// raise ECommsError.Create( FPortOpenError );
Exit;
end;
[/code]
oooO ↘┏━┓ ↙ Oooo
( 踩)→┃你┃ ←(死 )
\ ( →┃√┃ ← ) /
\_)↗┗━┛ ↖(_/
