请问这段代码那里有问题啊! ( 积分: 50 )

  • 主题发起人 主题发起人 sbzldlb
  • 开始时间 开始时间
S

sbzldlb

Unregistered / Unconfirmed
GUEST, unregistred user!
QQClientSocket.Socket.SendText(SendStr);
FStream:=TStream.Create;
While QQClientSocket.Activedo
begin
ZeroMemory(@FBufByte,sizeof(FBufByte));
RecLengthOnce:=QQClientSocket.Socket.ReceiveBuf(FBufByte,sizeof(FBufByte));
if RecLengthOnce=0 then
break;
FStream.Write(FBufByte,RecLengthOnce);
memo1.Lines.LoadFromStream(FStream);
application.ProcessMessages;
end;
 
QQClientSocket.Socket.SendText(SendStr);
FStream:=TStream.Create;
While QQClientSocket.Activedo
begin
ZeroMemory(@FBufByte,sizeof(FBufByte));
RecLengthOnce:=QQClientSocket.Socket.ReceiveBuf(FBufByte,sizeof(FBufByte));
if RecLengthOnce=0 then
break;
FStream.Write(FBufByte,RecLengthOnce);
memo1.Lines.LoadFromStream(FStream);
application.ProcessMessages;
end;
 
TStream是个抽象类,要使用流的方法,应该使用它的子类,如:
TFileStream (for working with files)
TStringStream (for manipulating in-memory strings)
TMemoryStream (for working with a memory buffer)
TBlobStream (for working with BLOB fields)
TWinSocketStream (for reading and writing over a socket connection)
TOleStream (for using a COM interface to read and write)
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
2K
import
I
I
回复
0
查看
850
import
I
后退
顶部