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. can not see progress in the progress Bar

can not see progress in the progress Bar

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
4 Posts 3 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.
  • M Offline
    M Offline
    mrby123
    wrote on last edited by
    #1

    After I add a progess bar on the dialogue box, I added code: m_progress1.SetRange(0,100); m_progress1.SetStep(1); in OnInitDialog(), and m_progress1.SetPos(mmtt); in the Next(). WHen I tried to run the program, the blue blocks representing the progress can not be seen in the progress bar. In other words, the progress bar is only an empty rectangular grew box when I run the program until finish. Please help how to make it work. Thanks

    D 1 Reply Last reply
    0
    • M mrby123

      After I add a progess bar on the dialogue box, I added code: m_progress1.SetRange(0,100); m_progress1.SetStep(1); in OnInitDialog(), and m_progress1.SetPos(mmtt); in the Next(). WHen I tried to run the program, the blue blocks representing the progress can not be seen in the progress bar. In other words, the progress bar is only an empty rectangular grew box when I run the program until finish. Please help how to make it work. Thanks

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      mrby123 wrote:

      ...and m_progress1.SetPos(mmtt); in the Next().

      When does Next() get called? What is the value of mmtt?

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "Man who follows car will be exhausted." - Confucius

      M 1 Reply Last reply
      0
      • D David Crow

        mrby123 wrote:

        ...and m_progress1.SetPos(mmtt); in the Next().

        When does Next() get called? What is the value of mmtt?

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Man who follows car will be exhausted." - Confucius

        M Offline
        M Offline
        mrby123
        wrote on last edited by
        #3

        After click the next button in the dialogue box. Thanks

        C 1 Reply Last reply
        0
        • M mrby123

          After click the next button in the dialogue box. Thanks

          C Offline
          C Offline
          Cedric Moonen
          wrote on last edited by
          #4

          Are you aware that if you have a lenghty operation in the main thread, UI messages won't be processed until the task is finished ? This means that the UI won't be redrawn and you won't be able to see any progress in the bar until the end of the task (in which case, all messages are processed at once and the progress is full). A better approach would be to run your lenghty task in a separate thread. I really recommand reading this excellent article[^] about threading.

          Cédric Moonen Software developer
          Charting control [v3.0] OpenGL game tutorial in C++

          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