Y
yuanxianer
Unregistered / Unconfirmed
GUEST, unregistred user!
用MSCOMM控件发数据的时候怎么发不出去 请看以下代码:
procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
t: dword;
begin
Memo1.Lines.Clear;
if MSComm1.PortOpen = true then
MSComm1.PortOpen := False;
MSComm1.CommPort := 2;
MSComm1.PortOpen := true;
MSComm1.OutBufferCount := 0;
MSComm1.InBufferCount := 0;
for i := 0 to ListBox1.Items.Count - 1 do
begin
MSComm1.Output := ListBox1.Items + chr(13);
while MSComm1.OutBufferCount > 0 do
Application.ProcessMessages;
t := GetTickCount;
while GetTickCount - t < 500 do
Application.ProcessMessages;
end;
end;
有人能帮我看一下吗 谢谢!
procedure TForm1.Button1Click(Sender: TObject);
var
i: integer;
t: dword;
begin
Memo1.Lines.Clear;
if MSComm1.PortOpen = true then
MSComm1.PortOpen := False;
MSComm1.CommPort := 2;
MSComm1.PortOpen := true;
MSComm1.OutBufferCount := 0;
MSComm1.InBufferCount := 0;
for i := 0 to ListBox1.Items.Count - 1 do
begin
MSComm1.Output := ListBox1.Items + chr(13);
while MSComm1.OutBufferCount > 0 do
Application.ProcessMessages;
t := GetTickCount;
while GetTickCount - t < 500 do
Application.ProcessMessages;
end;
end;
有人能帮我看一下吗 谢谢!