J
jsjyzhangjq
Unregistered / Unconfirmed
GUEST, unregistred user!
各位大侠:
private
{ Private declarations }
hotkeyid1:integer;
hotkeyid2:integer;
procedure WMHOTKEY(var Msg:TWMHOTKEY);message WM_HOTKEY;
public
bj:integer;
str2:string;
{ Public declarations }
end;
type
TParity = ( None, Odd, Even, Mark, Space );
TStopBits = ( _1, _1_5, _2 );
TByteSize = ( _5, _6, _7, _8 );
TDtrControl = ( DtrEnable, DtrDisable, DtrHandshake );
TRtsControl = ( RtsEnable, RtsDisable, RtsHandshake, RtsTransmissionAvailable );
var
main: Tmain;
Viewstring:string;
js:integer;
implementation
procedure Tmain.Timer1Timer(Sender: TObject);
var
Filepath,Filename:string;
Inifile:Tinifile;
i,key1,key2:integer;
k:boolean;
begin
if bj=1 then
begin
Filename:=ExtractFilePath(Application.ExeName)+'hotkey.ini';//取得*.ini绝对路径;
k:=fileexists(Filename);
Inifile:=Tinifile.Create(FileName); //打开*.ini;
comm1.StopComm;
Comm1.Parity := TParity(GetEnumValue(TypeInfo(TParity),Inifile.ReadString('com','parity','')));
//Comm1.StartComm; //打开串口
Inifile.free;
end;
end;
我编译的时候提示:incompatible types: spcomm.tparity and unit1.tparity 望大侠们指导! 还要就是 delphi 中的type 到底是怎么用法的,有没有学习这个的相关资料!
private
{ Private declarations }
hotkeyid1:integer;
hotkeyid2:integer;
procedure WMHOTKEY(var Msg:TWMHOTKEY);message WM_HOTKEY;
public
bj:integer;
str2:string;
{ Public declarations }
end;
type
TParity = ( None, Odd, Even, Mark, Space );
TStopBits = ( _1, _1_5, _2 );
TByteSize = ( _5, _6, _7, _8 );
TDtrControl = ( DtrEnable, DtrDisable, DtrHandshake );
TRtsControl = ( RtsEnable, RtsDisable, RtsHandshake, RtsTransmissionAvailable );
var
main: Tmain;
Viewstring:string;
js:integer;
implementation
procedure Tmain.Timer1Timer(Sender: TObject);
var
Filepath,Filename:string;
Inifile:Tinifile;
i,key1,key2:integer;
k:boolean;
begin
if bj=1 then
begin
Filename:=ExtractFilePath(Application.ExeName)+'hotkey.ini';//取得*.ini绝对路径;
k:=fileexists(Filename);
Inifile:=Tinifile.Create(FileName); //打开*.ini;
comm1.StopComm;
Comm1.Parity := TParity(GetEnumValue(TypeInfo(TParity),Inifile.ReadString('com','parity','')));
//Comm1.StartComm; //打开串口
Inifile.free;
end;
end;
我编译的时候提示:incompatible types: spcomm.tparity and unit1.tparity 望大侠们指导! 还要就是 delphi 中的type 到底是怎么用法的,有没有学习这个的相关资料!