5,927
社区成员




item := lstTest.items.add;
item.caption := str1;
item.subitems.add(str2);
item.subitems.add(str3);
procedure TServer.IdServerExecute(AThread: TIdPeerThread);
var
msg: String;
begin
msg := AThread.Connection.ReadLn;
if msg = '' then exit;
ReadMsg(msg);
end;
procedure TServer.ReadMsg(msg: String);
var
item: TListItem;
begin
M_Lock.Enter; //M_Lock是全局变量TCriticalSection
item := ListView1.Items.Add;
item.Caption := '0'; //单步执行到这里报错
item.subItems.Add('1');
item.subItems.Add('2');
item.subItems.Add('3');
item.subItems.Add(msg);
M_Lock.Leave;
end;
重新开个进程同样报错