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. not resonding /slow to response any click event

not resonding /slow to response any click event

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
8 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
    anilaabc
    wrote on last edited by
    #1

    I m using multimedia timer in my application but problem is ..application do not reponde to any click event /slow to respond .wht should i do????? thanks

    C K 2 Replies Last reply
    0
    • A anilaabc

      I m using multimedia timer in my application but problem is ..application do not reponde to any click event /slow to respond .wht should i do????? thanks

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

      anilaabc wrote:

      wht should i do?????

      At least provide much more informations because with the info you gave, it is almost impossible to help you. Are you doing heavy processing in the main thread ? Remember that if your main thread is busy, it won't be able to process messages, which means that your UI will not respond.

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

      A 1 Reply Last reply
      0
      • A anilaabc

        I m using multimedia timer in my application but problem is ..application do not reponde to any click event /slow to respond .wht should i do????? thanks

        K Offline
        K Offline
        KarstenK
        wrote on last edited by
        #3

        Maybe your code is doing something else: posting messages from from control to one other or drawing itself again and again. Make debug out or disable main portions of your code.:~

        Greetings from Germany

        A 1 Reply Last reply
        0
        • C Cedric Moonen

          anilaabc wrote:

          wht should i do?????

          At least provide much more informations because with the info you gave, it is almost impossible to help you. Are you doing heavy processing in the main thread ? Remember that if your main thread is busy, it won't be able to process messages, which means that your UI will not respond.

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

          A Offline
          A Offline
          anilaabc
          wrote on last edited by
          #4

          i m doing some calculations in a separate thread after a particalar interval .for this i m using a flag that is set to true in timeproc.I want that UI must repond quickly .I m not doing anything in main thread. Is it enough info ? Thanks in advance

          C 1 Reply Last reply
          0
          • K KarstenK

            Maybe your code is doing something else: posting messages from from control to one other or drawing itself again and again. Make debug out or disable main portions of your code.:~

            Greetings from Germany

            A Offline
            A Offline
            anilaabc
            wrote on last edited by
            #5

            no main thread is idle

            1 Reply Last reply
            0
            • A anilaabc

              i m doing some calculations in a separate thread after a particalar interval .for this i m using a flag that is set to true in timeproc.I want that UI must repond quickly .I m not doing anything in main thread. Is it enough info ? Thanks in advance

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

              anilaabc wrote:

              Is it enough info ?

              I'm afraid not :~

              anilaabc wrote:

              i m doing some calculations in a separate thread after a particalar interval .for this i m using a flag that is set to true in timeproc.

              Ok, so when are you starting your processing ? When the user clicks on a button ? If yes, can you post the code for the button click handler (please use the "code block" tag to format your code). Could you describe exactly what happens ? User interaction, when does the UI becomes unresponsive, .. Is the UI completely frozen for a while or just slow ? I think you will need to post relevant part of your code for us to be able to help.

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

              A 1 Reply Last reply
              0
              • C Cedric Moonen

                anilaabc wrote:

                Is it enough info ?

                I'm afraid not :~

                anilaabc wrote:

                i m doing some calculations in a separate thread after a particalar interval .for this i m using a flag that is set to true in timeproc.

                Ok, so when are you starting your processing ? When the user clicks on a button ? If yes, can you post the code for the button click handler (please use the "code block" tag to format your code). Could you describe exactly what happens ? User interaction, when does the UI becomes unresponsive, .. Is the UI completely frozen for a while or just slow ? I think you will need to post relevant part of your code for us to be able to help.

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

                A Offline
                A Offline
                anilaabc
                wrote on last edited by
                #7

                run is set to true. on click i set run=false; to stop thread. when i click run is not set to true and keep on alive to thread void method() { while(run) { if(Draw) { //doing some calculations here } Draw=0; greating_time_id=timeSetEvent(100, 0, GreatingResume_t, (DWORD)this,TIME_ONESHOT); } } }//while end }//end method void CALLBACK GreatingResume_t(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) { if(uID==greating_time_id) { Draw=1; timeKillEvent(greating_time_id); } }

                C 1 Reply Last reply
                0
                • A anilaabc

                  run is set to true. on click i set run=false; to stop thread. when i click run is not set to true and keep on alive to thread void method() { while(run) { if(Draw) { //doing some calculations here } Draw=0; greating_time_id=timeSetEvent(100, 0, GreatingResume_t, (DWORD)this,TIME_ONESHOT); } } }//while end }//end method void CALLBACK GreatingResume_t(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) { if(uID==greating_time_id) { Draw=1; timeKillEvent(greating_time_id); } }

                  C Offline
                  C Offline
                  Code o mat
                  wrote on last edited by
                  #8

                  Just for a test, run "Task Manager" and check "Performance", does your CPU seem overloaded (100% CPU usage)? If so, check "Processes" and see if your process is the one consuming all the CPU time, if so, you have there a run away thread probably. Try putting a Sleep(1) (or maybe Sleep(0)?) in your thread (inside that while-loop) and check if anything changes.

                  > The problem with computers is that they do what you tell them to do and not what you want them to do. <

                  modified on Thursday, December 4, 2008 7:08 AM

                  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