Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
InternetFileRead Returns 0 instead of T/F
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
InternetFileRead Returns 0 instead of T/F
Miscellaneous
Thread ID:
00447557
Message ID:
00447557
Views:
98
Here is my code and at the button my questions

I Have:

******INSIDE MY.Prg***********

lnPktSize = 100
lnBytesRead = 0
FOR x=1 to 5
lcReadBuffer=SPACE(100)
bOk=oFTP.FtpReadXBytes(Handle,lcReadBuffer,lnPktSize,lnBytesRead)
lnBytesRead=lnBytesRead+lnPktSize
ENDFOR

******INSIDE FTPClass.prg******

LOCAL lcReadBuffer,lnBytesToRead,lnBytesRead

DECLARE INTEGER InternetReadFile IN WinInet ;
INTEGER nConnect_Handle, STRING @lcReadBuffer,INTEGER lnBytesToRead,INTEGER @lnBytesRead

PROCEDURE FtpReadXBytes
LPARAMETERS nHandle,cReadBuffer,nPktSize,nBytesRead
LOCAL nReadOk
IF THIS.OpenFtpConnection()
nReadOK = InternetReadFile(nHandle,@cReadBuffer,nPktSize,@nBytesRead)
THIS.GetExtendedError()
THIS.CloseFtpConnection()
RETURN nReadOk
ELSE
MESSAGEBOX("Not connected!!!")
RETURN .F.
ENDIF
ENDPROC

But:

1- InternetReadFile Return 0 instead of .T. or .F.
2- I Call FtpReadXBytes Inside a loop beacuse I want to display a progressbar
3- If I check cReadBuffer that is what the API function Read is always Empty (100 Spaces as I declare)

Regards.
Francisko Paternoster
fpater@patercorp.com
Next
Reply
Map
View

Click here to load this message in the networking platform