I am trying to receive blob data via a tcpip connection using winsock.ocx. I can receive the data into the buffer, but I get an OleDispatch error whenever I try to use the getdata or peekdata methods. Does anybody know how to do this?
What's your code (in short)?
It's quite hard to help without knowing what you did so far.
You cant simply use GetData, you need to wait for DataArrival events and something like a blob will not come in one event. The data type is quite irrelevant, what matters is the size. DataArrival will tell you how many bytes arrived, that is the portion you can read via GetData then. Doing it earlier leads to OLE Errors, yes.
There is no event when the data received is complete, though, the client side actually can't know, this has to be "told" somehow by the server. So your code sending the blob will need to send over a length at first, for example.
If you want to download a file from a url there are much easier methods than using winsock.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.