DLL 소스 인데요...
소스 맨 아래에
Comport.OnRxChar:=aaa;
이벤트를 프로시져에 대입하는 부분에서 에러가 나네요...
에러는...
imcompatible types:'method pointer and regular procedure'
가르쳐 주세요...
procedure aaa(Sender: TObject; Count: Integer);
var
Str: String;
begin
ComPort.ReadStr(Str, Count);
messagedlg('Polling Ok',mtinformation,[mbok],1);
end;
procedure song(Sender: TObject);
var
str,readstr : string;
Buff: array[0..1023] of Char;
WLen: Word;
boardid,status,checksum:string;
start,command,cr:char;
begin
comport := TComport.create(application);
comport.Port:='com1';
comport.BaudRate := br9600;
comport.Open;
str:='1000869011?13';
start:=chr(strtoint(copy(str,1,1)));
boardid:=copy(str,2,3);
command:=chr(strtoint(copy(str,5,2)));
status:=copy(str,7,1);
checksum:=copy(str,8,4);
cr:=chr(strtoint(copy(str,12,2)));
str:=start + boardid + command + status + checksum + cr;
ComPort.WriteStr(Str);
Comport.OnRxChar:=aaa;
end;
procedure aaa(Sender: TObject; Count: Integer);
Comport.OnRxChar:=aaa;
결국 aaa를 넣으면 에러나겠네요..