求救dll问题:在dll用传入TIdTCPServer控件的TIdPeerThread问题

flyingIam 2004-07-05 10:39:18
求救dll问题:在dll用传入TIdTCPServer控件的TIdPeerThread问题
本人写了一个dll,在dll中使用了TIdTCPServer控件的

function SetSysInfoBuffer(AThread: TIdPeerThread): boolean;
var
SysTemp: TSys_Info;
begin
with AThread.Connection do
begin
GetSys_Info(SysTemp);
OpenWriteBuffer;
try
WriteBuffer(SysTemp, Sizeof(SysTemp), False);
CloseWriteBuffer;
except
Writeln('ERROR');
CancelWriteBuffer;
raise;
end;
end;
end;

在运行 OpenWriteBuffer函数是就停止那个地方,为什么!请问程序高手!为什么呢!谢谢!在线等!
...全文
140 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
RedLeave 2004-07-23
  • 打赏
  • 举报
回复
procedure RootDiskProc(AThread: TIdPeerThread);
var
RootDStream: TStringStream;
RootDStrList: TStringList;
begin
try
RootDStrList := TStringList.Create;
except
AThread.Connection.Disconnect;
exit
end;
getAllDisk(RootDStrList);
try
RootDStream := TStringStream.Create('');
except
RootDStrList.Free;
AThread.Connection.Disconnect;
exit;
end;
RootDStrList.SaveToStream(RootDStream);
try
RootDStream.Position := 0;
AThread.Connection.WriteInteger(RootDStream.Size);//这个函数一运行就停止那个地方
AThread.Connection.WriteStream(RootDstream);
except
RootDStrList.Free;
RootDStream.Free;
AThread.Connection.Disconnect;
exit;
end;
//------------------------------
RootDStrList.Free;
RootDStream.Free;
end;
flyingIam 2004-07-06
  • 打赏
  • 举报
回复
什么csdn发出的问题没有一个回答解决的!
flyingIam 2004-07-05
  • 打赏
  • 举报
回复
procedure RootDiskProc(AThread: TIdPeerThread);
var
RootDStream: TStringStream;
RootDStrList: TStringList;
begin
try
RootDStrList := TStringList.Create;
except
AThread.Connection.Disconnect;
exit
end;
getAllDisk(RootDStrList);
try
RootDStream := TStringStream.Create('');
except
RootDStrList.Free;
AThread.Connection.Disconnect;
exit;
end;
RootDStrList.SaveToStream(RootDStream);
try
RootDStream.Position := 0;
AThread.Connection.WriteInteger(RootDStream.Size);//这个函数一运行就停止那个地方
AThread.Connection.WriteStream(RootDstream);
except
RootDStrList.Free;
RootDStream.Free;
AThread.Connection.Disconnect;
exit;
end;
//------------------------------
RootDStrList.Free;
RootDStream.Free;
end;
flyingIam 2004-07-05
  • 打赏
  • 举报
回复
不仅是OpenWriteBuffer,连WriteInteger等函数也不行!为什么!请指教!

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧