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.