Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
InternetFileRead Returns 0 instead of T/F
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
InternetFileRead Returns 0 instead of T/F
Divers
Thread ID:
00447557
Message ID:
00447557
Vues:
99
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform