中国开发网: 论坛: 程序员情感CBD: 贴子 113630
阿善: DLL里的事件被出发了,EXE里怎么知道,回调函数怎么做?
function SendDataToComm: String; export;
var
i:integer;
commflg:boolean;
s: String;
begin
sbuf[1] := 'a'; //帧头
sbuf[2] := 'b'; //命令号
sbuf[3] := 'c';
sbuf[4] := 'd';
sbuf[5] := 'e';
sbuf[6] := 'f'; //帧尾
commflg := True;
s := '';
for i := 1 to 6 do
begin
if not Comm1.WriteCommData(@sbuf[i],1) then
begin
commflg := False;
break;
end;
//发送时字节间的延时
sleep(2);
s := s + sbuf[i];
end;
Result := s;
// Form1.Memo1.lines.add(viewstring);
// Form1.Memo1.lines.add('');
if not commflg then messagedlg('发送失败 !', mterror, [mbyes], 0);
end;

exports
SendDataToComm;
让暴风雨来的更猛烈些吧!


相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录