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.