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. Progress bar

Progress bar

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
6 Posts 5 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
    MahaKh
    wrote on last edited by
    #1

    i want to use a progress bar in my dialog based MFC application,i have draged progess bar from tool box and have made its variable named m_prog now i dnt know what to do for making it working...can n e budy help me out in this....thanx.

    C C 2 Replies Last reply
    0
    • M MahaKh

      i want to use a progress bar in my dialog based MFC application,i have draged progess bar from tool box and have made its variable named m_prog now i dnt know what to do for making it working...can n e budy help me out in this....thanx.

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

      The first thing to think about is that you need to have a task with some progress. The common mistake people do when using a progress bar is that they put their task in the main thread and regularly advance progress on the progress bar. This is not going to work because while you are processing your task, no messages are processed which means the full UI will freeze (and the progress bar won't progress). What kind of task are you running ? Is it a kind of computation ? If yes, is it running in a separate thread ?

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

      M D 2 Replies Last reply
      0
      • C Cedric Moonen

        The first thing to think about is that you need to have a task with some progress. The common mistake people do when using a progress bar is that they put their task in the main thread and regularly advance progress on the progress bar. This is not going to work because while you are processing your task, no messages are processed which means the full UI will freeze (and the progress bar won't progress). What kind of task are you running ? Is it a kind of computation ? If yes, is it running in a separate thread ?

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

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

        yes...i m doing coplex calculations...inplementing methemathical algorithms....and these are happining in saperate methods.

        I 1 Reply Last reply
        0
        • M MahaKh

          i want to use a progress bar in my dialog based MFC application,i have draged progess bar from tool box and have made its variable named m_prog now i dnt know what to do for making it working...can n e budy help me out in this....thanx.

          C Offline
          C Offline
          CPallini
          wrote on last edited by
          #4

          What about documentation [^]? :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          1 Reply Last reply
          0
          • M MahaKh

            yes...i m doing coplex calculations...inplementing methemathical algorithms....and these are happining in saperate methods.

            I Offline
            I Offline
            Iain Clarke Warrior Programmer
            wrote on last edited by
            #5

            MahaKh wrote:

            saperate methods.

            He asked about separate threads. If that was a difficulty with language, no problem. If you don't understand the difference between a method and a thread, you have a whole lotta reading to do. Have a search for CreateThread, AfxBeginThread, PostMessage. Read these essays too: http://www.flounder.com/mvp_tips.htm#hreads%20and%20Processes%20series[^] Iain.

            I have now moved to Sweden for love (awwww). If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]

            1 Reply Last reply
            0
            • C Cedric Moonen

              The first thing to think about is that you need to have a task with some progress. The common mistake people do when using a progress bar is that they put their task in the main thread and regularly advance progress on the progress bar. This is not going to work because while you are processing your task, no messages are processed which means the full UI will freeze (and the progress bar won't progress). What kind of task are you running ? Is it a kind of computation ? If yes, is it running in a separate thread ?

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

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

              Cedric Moonen wrote:

              (and the progress bar won't progress).

              So what's the point in having a progress bar that won't progress? That just sounds counterintuitive. I suggest an unprogress bar instead. That way it won't matter if the primary thread is busy or not.

              "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

              "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

              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