一段delphi程序的解释
functionComPortAvailable(Port:PChar):boolean;VarDeviceName:Array[0..80]ofChar;ComFile...
function ComPortAvailable(Port: PChar) : boolean;
Var
DeviceName: Array[0..80] of Char;
ComFile: THandle;
begin
StrPCopy(DeviceName, Port);
ComFile := CreateFile(DeviceName, GENERIC_READ or GENERIC_WRITE, 0, Nil,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL, 0);
Result := ComFile <> INVALID_HANDLE_VALUE;
CloseHandle(ComFile);
end;
其中confile的作用,每一句的具体解释,谢谢 展开
Var
DeviceName: Array[0..80] of Char;
ComFile: THandle;
begin
StrPCopy(DeviceName, Port);
ComFile := CreateFile(DeviceName, GENERIC_READ or GENERIC_WRITE, 0, Nil,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL, 0);
Result := ComFile <> INVALID_HANDLE_VALUE;
CloseHandle(ComFile);
end;
其中confile的作用,每一句的具体解释,谢谢 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询