Announcement

Collapse
No announcement yet.

hit StatusDlg cancel button error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • hit StatusDlg cancel button error

    Click image for larger version

Name:	cancelbutton.png
Views:	1
Size:	13.1 KB
ID:	288354

    when setup download software from ftp.hit the cancel button of StatusDlg window this error happen.
    Why does this error happen?

  • #2
    You would need to provide your project file. We can't guess what happens on lines 12, 65, 258, in function DownloadMySQL, etc...

    Ulrich

    Comment


    • #3
      How to interrupt FTP.Download? I write below in CallbackFunction

      if StatusDlg.IsCancelled() then
      FTP.Disconnect();
      Application.Exit();
      return false;
      else
      return true;
      end;

      Comment


      • #4
        lines 258 call function DownloadMySQL
        line65 is "FTP.Download(MySQL_64_FILENAME, MySQL_64_PATH, DownloadCallback)",in function DownloadMySQL
        line 12 is Application.Exit(); in CallbackFunction
        CallbackFunction like below


        function DownloadCallback (nDownloaded, nTotal)
        -- Convert total and downloaded bytes into formatted strings
        sDownloaded = String.GetFormattedSize(nDownloaded, FMTSIZE_AUTOMATIC, true);
        sTotal = String.GetFormattedSize(nTotal, FMTSIZE_AUTOMATIC, true);
        StatusDlg.SetMessage(SetupData.GetLocalizedString( "MSG_DOWNLOADING_FILE"));
        StatusDlg.SetMeterRange(0,65534);
        -- Set meter position (fraction downloaded * max meter range)
        StatusDlg.SetMeterPos((nDownloaded / nTotal) * 65534);
        -- Continue with the download.
        if StatusDlg.IsCancelled() then
        FTP.Disconnect();
        Application.Exit();
        return false;
        else
        return true;
        end;
        return true;
        end

        Comment


        • #5
          You shouldn't attempt to end the application in the callback function. Instead, set a variable, and check if you need to exit the application after FTP.Download() by inspecting the content of that variable.

          Ulrich

          Comment


          • #6
            Originally posted by Ulrich View Post
            You shouldn't attempt to end the application in the callback function. Instead, set a variable, and check if you need to exit the application after FTP.Download() by inspecting the content of that variable.

            Ulrich
            thanks a lot

            Comment

            Working...
            X