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

Zero = Boolean false. Use
nReadOK = (InternetReadFile(nHandle, @cReadBuffer, nPktSize, @nBytesRead) # 0)
To get a Boolean value.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform