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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CProgressCtrl problem in long function

CProgressCtrl problem in long function

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 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.
  • I Offline
    I Offline
    IGx89
    wrote on last edited by
    #1

    My app (if you play Freelancer, you've probably used it) has a function that takes up to 60 seconds to complete, and updates the current status using a CProgressCtrl. The problem is, sometimes after a little while (usually around half way) the progress control stops updating (even though I'm calling ProgressCtrl.RedrawWindow() every time), thus making the user think my app has stopped responding. Is there any way to get around that problem, without having to go through all the work and trouble of making a separate worker thread?

    M 1 Reply Last reply
    0
    • I IGx89

      My app (if you play Freelancer, you've probably used it) has a function that takes up to 60 seconds to complete, and updates the current status using a CProgressCtrl. The problem is, sometimes after a little while (usually around half way) the progress control stops updating (even though I'm calling ProgressCtrl.RedrawWindow() every time), thus making the user think my app has stopped responding. Is there any way to get around that problem, without having to go through all the work and trouble of making a separate worker thread?

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      Yes, don't send as many messages to the control. I once had an app that read in a big database (like 50K records) and sent a msg after every record. It did exactly what you describe. Once I changed it to send a message every few hundred records, it worked perfectly. --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber Actual sign at the laundromat I go to: "No tinting or dying."

      I 1 Reply Last reply
      0
      • M Michael Dunn

        Yes, don't send as many messages to the control. I once had an app that read in a big database (like 50K records) and sent a msg after every record. It did exactly what you describe. Once I changed it to send a message every few hundred records, it worked perfectly. --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber Actual sign at the laundromat I go to: "No tinting or dying."

        I Offline
        I Offline
        IGx89
        wrote on last edited by
        #3

        Thanks, that worked perfectly! :D

        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