I am having trouble sending a propertybag over winsock. I have a client/server application that sends images through using a propertybag. I convert the propertybag into a byte array and try to send it over winsock and then when I convert the byte array back to a propertybag, it cant seem to read it. It looks like the data was corrupted when it was sent.
Client(sending propertybag)
Server(Receiving propertybag)
The error I received:
Run-time error '327':
Data value named 'picc' not found
When I try to do execute the code in a single program without winsock, it works just fine. The problem occurs when I send the byte array over winsock. Can someone please help?
Client(sending propertybag)
Code:
Dim pb As PropertyBag
Dim byt() As Byte
Set pb = New PropertyBag
pb.WriteProperty "picc", Image1.Picture
byt = pb.Contents
Winsock1.SendData byt
Server(Receiving propertybag)
Code:
Dim byt() As Byte
Dim pb As PropertyBag
Set pb = New PropertyBag
Winsock1.GetData byt, vbByte
pb.Contents = byt
Image1.Picture = pb.ReadProperty("picc")
Run-time error '327':
Data value named 'picc' not found
When I try to do execute the code in a single program without winsock, it works just fine. The problem occurs when I send the byte array over winsock. Can someone please help?