Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Handling timely Progress bar

Handling timely Progress bar

Scheduled Pinned Locked Moved C / C++ / MFC
performancequestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vikash Dubey 0
    wrote on last edited by
    #1

    How can we set the progress bar for a situation where we dont know how much time the operation takes like Windows displays the progress when copying/Moving a file it varies depending on read data speed. Is there any estimation method. I saw one article on this site called Timed Progress but the code is not at all documented so i cannot understand what it is doing? Can anyone suggest something? Vikash

    J 1 Reply Last reply
    0
    • V Vikash Dubey 0

      How can we set the progress bar for a situation where we dont know how much time the operation takes like Windows displays the progress when copying/Moving a file it varies depending on read data speed. Is there any estimation method. I saw one article on this site called Timed Progress but the code is not at all documented so i cannot understand what it is doing? Can anyone suggest something? Vikash

      J Offline
      J Offline
      jmkhael
      wrote on last edited by
      #2

      What you can set in a progress bar, is the the range, the position and the step. Lets say the range is 0 to 100, the starting position is 0 and the step is 1. You should do the calculation in a way that in the end you have a hundred, You dont really care about the time, what you care about is to put your StepIt function in a way that it gets called on every "iteration" of the long process so the progress bar gets updated, this shows that you need somehow to know the number of iterations needed and based on that to calculate your step. So for a range of 100 , an iterations number of N > 0 , the step should be 100 / N. If you cant know the iterations number, you should try to "approximate it" Hope this helps, Papa while (TRUE) Papa.WillLove ( Bebe ) ;

      V 1 Reply Last reply
      0
      • J jmkhael

        What you can set in a progress bar, is the the range, the position and the step. Lets say the range is 0 to 100, the starting position is 0 and the step is 1. You should do the calculation in a way that in the end you have a hundred, You dont really care about the time, what you care about is to put your StepIt function in a way that it gets called on every "iteration" of the long process so the progress bar gets updated, this shows that you need somehow to know the number of iterations needed and based on that to calculate your step. So for a range of 100 , an iterations number of N > 0 , the step should be 100 / N. If you cant know the iterations number, you should try to "approximate it" Hope this helps, Papa while (TRUE) Papa.WillLove ( Bebe ) ;

        V Offline
        V Offline
        Vikash Dubey 0
        wrote on last edited by
        #3

        Thank you. But suppose the process is spread over several loops then how do i do it.

        J 1 Reply Last reply
        0
        • V Vikash Dubey 0

          Thank you. But suppose the process is spread over several loops then how do i do it.

          J Offline
          J Offline
          jmkhael
          wrote on last edited by
          #4

          Then divide by the number of loops too Papa while (TRUE) Papa.WillLove ( Bebe ) ;

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups