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. Use Thread to update UI

Use Thread to update UI

Scheduled Pinned Locked Moved C / C++ / MFC
designtutorialquestionannouncement
5 Posts 4 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.
  • A Offline
    A Offline
    a_du
    wrote on last edited by
    #1

    i want to create a status dlg which can display the status of a process, for example transfer files. i find that use user created thread to control UI often causes crashes or make system hung. so i have to change to using timer. is user created thread not allowed to control UI display?

    S D 2 Replies Last reply
    0
    • A a_du

      i want to create a status dlg which can display the status of a process, for example transfer files. i find that use user created thread to control UI often causes crashes or make system hung. so i have to change to using timer. is user created thread not allowed to control UI display?

      S Offline
      S Offline
      sayup
      wrote on last edited by
      #2

      hello, I also have a similar kind of problem.I need to update data from my UI(dialog box with some controls).So aren't user interface threads not of use?Did you try the OnTimer function? Tell me if it works?

      A 1 Reply Last reply
      0
      • S sayup

        hello, I also have a similar kind of problem.I need to update data from my UI(dialog box with some controls).So aren't user interface threads not of use?Did you try the OnTimer function? Tell me if it works?

        A Offline
        A Offline
        a_du
        wrote on last edited by
        #3

        my boss told me that user created thread cannot be used for updating the UI data. i am wondering wheather it is true as i never see this in MSDN. timer works properly. i think the other way is to use event, but i have tried this way

        PJ ArendsP 1 Reply Last reply
        0
        • A a_du

          my boss told me that user created thread cannot be used for updating the UI data. i am wondering wheather it is true as i never see this in MSDN. timer works properly. i think the other way is to use event, but i have tried this way

          PJ ArendsP Offline
          PJ ArendsP Offline
          PJ Arends
          wrote on last edited by
          #4

          http://www.codeproject.com/threads/usingworkerthreads.asp[^]


          "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ???  You're definitely a superstar!!!" - mYkel - 21 Jun '04 "There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05 Within you lies the power for good - Use it!

          Within you lies the power for good; Use it!

          1 Reply Last reply
          0
          • A a_du

            i want to create a status dlg which can display the status of a process, for example transfer files. i find that use user created thread to control UI often causes crashes or make system hung. so i have to change to using timer. is user created thread not allowed to control UI display?

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

            a_du wrote: is user created thread not allowed to control UI display? No. Since the secondary thread does not own the UI or the message pump, it has no choice but to post a message to the main thread indicating that something needs to be updated.


            "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

            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