Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why the progress bar not moving?
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Why the progress bar not moving?
Divers
Thread ID:
00889669
Message ID:
00889669
Vues:
64
I am tring to download some files via FTP protcol using Robert Abram's FTP class. I rebuild this class to Visual (by copy & paste) & made some modification to show progress of the donwload process (Thanks again Cetin) by creating Progress event w/ the class. Somethng like that:
  lnSize = FtpGetFileSize(hFile, @lpdwFileSizeHigh)
  lnSize = lnSize + lpdwFileSizeHigh * (0xFFFFFFFF+1)

  hOut = FCREATE(lcNewFile)
  lnBytesWritten = 0
  ret_val = .T.
  DO WHILE lnBytesWritten < lnSize
     lpdwNumberOfBytesRead = 0
     lcRead = SPACE(this.bites_to_read)
     IF InternetReadFile(hFile, @lcRead, this.bites_to_read, @lpdwNumberOfBytesRead) = 0
        THIS.GetExtendedError()
        THIS.CloseFtpConnection()   && Close FTP Handle
        RETURN .F.
     ENDIF
     lnBytesWritten = lnBytesWritten + FWRITE(hOut,lcRead,lpdwNumberOfBytesRead)
     this.Progress(lnBytesWritten, lnSize)
     IF INKEY() == 27
        ret_val = .F.
        EXIT
     ENDIF
  ENDDO
  =FCLOSE(hOut)
...
I put that class in the form where I have ProgressBar control & modify Progress event of the FTP class:
 LPARAMETERS lnBytesWritten, lnSize
 thisform.ProgressBar.Value = INT(lnBytesWritten / lnSize * 100)
 thisform.Label1.Caption  = STR(lnBytesWritten) + " / "+ STR(lnSize)
but when I run the download, caption of the label is changed, but the progressbar not.
Why?
When I pass a progressbar as a parameter to FTP class & put it into Progress Event everithing is OK.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform