I finaly made it!
Here's my solution:
On the server side:
Private Sub Command1_Click()
Dim pb As PropertyBag
Set pb = New PropertyBag
pb.WriteProperty "SentStdPicture", Image1.Picture, 0
Winsock1.SendData pb.Contents
End Sub
Private Sub Form_Load()
Winsock1.Listen
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Close
Winsock1.Accept requestID
End Sub
On the client side:
Dim pb As PropertyBag
Dim Buffer() As Byte, Storage() As Byte
Dim Nr As Integer
Private Sub Command1_Click()
Image2.Picture = LoadPicture
End Sub
Private Sub Form_Load()
Winsock2.Connect
ReDim Preserve Storage(0)
End Sub
Private Sub Winsock2_DataArrival(ByVal bytesTotal As Long)
Set pb = New PropertyBag
Winsock2.GetData Buffer, vbByte + vbArray, bytesTotal
OldUBoundStorage = IIf(UBound(Storage) = 0, 0, UBound(Storage))
ReDim Preserve Storage(UBound(Storage) + UBound(Buffer) + 1)
For x = 0 To UBound(Buffer)
Storage(x + OldUBoundStorage) = Buffer(x)
Next
On Error GoTo e:
pb.Contents = Storage
Set Image2.Picture = pb.ReadProperty("SentStdPicture", 0)
ReDim Storage(0)
e:
End Sub
strongm, thanks for the initial hint!
Here's a star for you. Well, I should probably award one to myself to!
Hope I've been helpful,
Bogdan Muresan.