C
cxlin
Unregistered / Unconfirmed
GUEST, unregistred user!
如何通过serversocket 和clientsocket发送和接收数据?<br>服务器端,图象捕捉和压缩图象的格式发送<br>procedure TForm1.Button1Click(Sender: TObject); <br>var vt2:OleVariant;<br>begin<br>Form1.VidCap1.Connect(0);<br>Form1.VidCap1.Compressor:='h263';<br>Form1.VidCap1.StartCapture;<br>vt2:= VidCap1.BitmapFormat;//压缩图象的格式,是OleVariant类型<br>if ok1=1 then //如果通信成功<br>begin<br>ServerSocket1.socket.Connections[0].sendbuf(vt2,sizeof(vt2));<br>end;<br>end;<br>客户端接收压缩图象的格式<br>procedure TForm1.ClientSocket1Read(Sender: TObject;<br> Socket: TCustomWinSocket);<br>var vt:OleVariant;<br>begin<br>ClientSocket1.socket.ReceiveBuf(vt,sizeof(vt));<br>end;<br><br>这样有什么错误吗,我每次运行时,当客户端收到数据时总时出现错误提示;说是<br>什么'oleaut32.dll'出错, 请各位高手帮助解决