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. show text in statusbar

show text in statusbar

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelpannouncement
7 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.
  • J Offline
    J Offline
    jafrazee
    wrote on last edited by
    #1

    i need to show text in my status bar to show a process working and what is happening. the problem is i have no idle time to update the status bar. how can i update the status bar without stopping my code?. (or can i?)

    J J 2 Replies Last reply
    0
    • J jafrazee

      i need to show text in my status bar to show a process working and what is happening. the problem is i have no idle time to update the status bar. how can i update the status bar without stopping my code?. (or can i?)

      J Offline
      J Offline
      Jon Hulatt
      wrote on last edited by
      #2

      If you have no time to update your status bar, you have a more underlying problem with cpu usage. your app is going to be totally unresponsive. If someone obscures it with another window, and then hides that window, your app is not going to redraw. This creates a poor user experience and they'll think your app has crashed. Consider putting your intensive code in a worker thread, and leave the main thread free to pump messages, and update the UI. Signature space for rent. Apply by email to....

      J 1 Reply Last reply
      0
      • J Jon Hulatt

        If you have no time to update your status bar, you have a more underlying problem with cpu usage. your app is going to be totally unresponsive. If someone obscures it with another window, and then hides that window, your app is not going to redraw. This creates a poor user experience and they'll think your app has crashed. Consider putting your intensive code in a worker thread, and leave the main thread free to pump messages, and update the UI. Signature space for rent. Apply by email to....

        J Offline
        J Offline
        jafrazee
        wrote on last edited by
        #3

        my program imports or scans images and preforms icr on the image and archives that image to a drive or cd. i can also do all this in less that 1 sec. my program does lots in little time. some scan session will scan over 5000 documents without crashes. all i need to know if a statusbar can be forced to update.

        J 1 Reply Last reply
        0
        • J jafrazee

          i need to show text in my status bar to show a process working and what is happening. the problem is i have no idle time to update the status bar. how can i update the status bar without stopping my code?. (or can i?)

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

          if ( MFC ) if ( u have a CStatusBar object ) CStatusBar::SetPaneText Papa while (TRUE) Papa.WillLove ( Bebe ) ;

          1 Reply Last reply
          0
          • J jafrazee

            my program imports or scans images and preforms icr on the image and archives that image to a drive or cd. i can also do all this in less that 1 sec. my program does lots in little time. some scan session will scan over 5000 documents without crashes. all i need to know if a statusbar can be forced to update.

            J Offline
            J Offline
            Jon Hulatt
            wrote on last edited by
            #5

            In short, no, you can't update the status bar. To update the status bar, at the end of the day, involves sending a message to the status bar itself. There will be no cpu timeslice for that to happen if your one and only thread is blocked. That is the perfect case for a worker thread. If your user was doing a batch of 5,000 documents each taking 1s, he's going to be waiting a long time. you need to give him a cancel button- and you can't handle the click of the button if your main thread is busy doing scanning. someone else please back me up on this! or point me out if i'm wrong. Signature space for rent. Apply by email to....

            J 1 Reply Last reply
            0
            • J Jon Hulatt

              In short, no, you can't update the status bar. To update the status bar, at the end of the day, involves sending a message to the status bar itself. There will be no cpu timeslice for that to happen if your one and only thread is blocked. That is the perfect case for a worker thread. If your user was doing a batch of 5,000 documents each taking 1s, he's going to be waiting a long time. you need to give him a cancel button- and you can't handle the click of the button if your main thread is busy doing scanning. someone else please back me up on this! or point me out if i'm wrong. Signature space for rent. Apply by email to....

              J Offline
              J Offline
              jafrazee
              wrote on last edited by
              #6

              actually i have 2 threads. one for scanning or importing and the other for icr and saving. as thread 1 scans the other processes the prev image (if still in the buffer). i have a window for the scanner that pops up and there is a cancel button. it all works great the scanner will usally have to process the log that is ready to scan before it stops but i do not have any idle time to have the status bar update when ever.

              J 1 Reply Last reply
              0
              • J jafrazee

                actually i have 2 threads. one for scanning or importing and the other for icr and saving. as thread 1 scans the other processes the prev image (if still in the buffer). i have a window for the scanner that pops up and there is a cancel button. it all works great the scanner will usally have to process the log that is ready to scan before it stops but i do not have any idle time to have the status bar update when ever.

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

                Cant u do it from the working thread?? (but be sure to synchronize) 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