Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP Winsock blob data

Status
Not open for further replies.

sysimgrp

Programmer
Jul 25, 2015
1
US
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?
 
Welcome to the forum.

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.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top