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. Windows XP - Not Responding

Windows XP - Not Responding

Scheduled Pinned Locked Moved C / C++ / MFC
c++helplearning
9 Posts 7 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.
  • D Offline
    D Offline
    Doug Knudson
    wrote on last edited by
    #1

    Hi, I have a problem with a VC++ (6.0) dialog based application running under Windows XP. From a modal dialog, the user initiates some long-running activity, in a loop, that can take as much as 10 - 15 minutes to complete. If during the processing, the user covers the modal dialog with another window, even for a second or two, and then re-exposes it and clicks in the dialog, on Windows XP, "Not Responding" is displayed in the window title bar, causing the user to believe the app has died... but of course it hasn't. This behavior does not seem to occur under Windows 2000 or NT. There are a whole host of reasons why it would not be a good idea, in this particular situation, to start a new thread to do the processing, freeing up the dialog to respond to whatever messages XP is sending to determine if it is alive.... so.... Short of a separate thread... any ideas would be really, really appreaciated :) Thanks, Doug Doug Knudson

    C RaviBeeR D J S 6 Replies Last reply
    0
    • D Doug Knudson

      Hi, I have a problem with a VC++ (6.0) dialog based application running under Windows XP. From a modal dialog, the user initiates some long-running activity, in a loop, that can take as much as 10 - 15 minutes to complete. If during the processing, the user covers the modal dialog with another window, even for a second or two, and then re-exposes it and clicks in the dialog, on Windows XP, "Not Responding" is displayed in the window title bar, causing the user to believe the app has died... but of course it hasn't. This behavior does not seem to occur under Windows 2000 or NT. There are a whole host of reasons why it would not be a good idea, in this particular situation, to start a new thread to do the processing, freeing up the dialog to respond to whatever messages XP is sending to determine if it is alive.... so.... Short of a separate thread... any ideas would be really, really appreaciated :) Thanks, Doug Doug Knudson

      C Offline
      C Offline
      Chris Meech
      wrote on last edited by
      #2

      The only other approach is to implement a message loop within the long running function. This used to be general practice back in the 16 bit days and I think if you search here on codeproject, you'll likely find an article that describes how to implement what you are looking for. Chris Meech I am Canadian. [heard in a local bar] Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden] Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]

      1 Reply Last reply
      0
      • D Doug Knudson

        Hi, I have a problem with a VC++ (6.0) dialog based application running under Windows XP. From a modal dialog, the user initiates some long-running activity, in a loop, that can take as much as 10 - 15 minutes to complete. If during the processing, the user covers the modal dialog with another window, even for a second or two, and then re-exposes it and clicks in the dialog, on Windows XP, "Not Responding" is displayed in the window title bar, causing the user to believe the app has died... but of course it hasn't. This behavior does not seem to occur under Windows 2000 or NT. There are a whole host of reasons why it would not be a good idea, in this particular situation, to start a new thread to do the processing, freeing up the dialog to respond to whatever messages XP is sending to determine if it is alive.... so.... Short of a separate thread... any ideas would be really, really appreaciated :) Thanks, Doug Doug Knudson

        RaviBeeR Offline
        RaviBeeR Offline
        RaviBee
        wrote on last edited by
        #3

        Doug, check out the section "Responding to user input while performing a long task" in this[^] article. /ravi My new year's resolution: 2048 x 1536 Home | Articles | Freeware | Music ravib@ravib.com

        1 Reply Last reply
        0
        • D Doug Knudson

          Hi, I have a problem with a VC++ (6.0) dialog based application running under Windows XP. From a modal dialog, the user initiates some long-running activity, in a loop, that can take as much as 10 - 15 minutes to complete. If during the processing, the user covers the modal dialog with another window, even for a second or two, and then re-exposes it and clicks in the dialog, on Windows XP, "Not Responding" is displayed in the window title bar, causing the user to believe the app has died... but of course it hasn't. This behavior does not seem to occur under Windows 2000 or NT. There are a whole host of reasons why it would not be a good idea, in this particular situation, to start a new thread to do the processing, freeing up the dialog to respond to whatever messages XP is sending to determine if it is alive.... so.... Short of a separate thread... any ideas would be really, really appreaciated :) Thanks, Doug Doug Knudson

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

          Doug Knudson wrote: Short of a separate thread Why not create a separate thread to do the work? It would be the correct solution


          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          1 Reply Last reply
          0
          • D Doug Knudson

            Hi, I have a problem with a VC++ (6.0) dialog based application running under Windows XP. From a modal dialog, the user initiates some long-running activity, in a loop, that can take as much as 10 - 15 minutes to complete. If during the processing, the user covers the modal dialog with another window, even for a second or two, and then re-exposes it and clicks in the dialog, on Windows XP, "Not Responding" is displayed in the window title bar, causing the user to believe the app has died... but of course it hasn't. This behavior does not seem to occur under Windows 2000 or NT. There are a whole host of reasons why it would not be a good idea, in this particular situation, to start a new thread to do the processing, freeing up the dialog to respond to whatever messages XP is sending to determine if it is alive.... so.... Short of a separate thread... any ideas would be really, really appreaciated :) Thanks, Doug Doug Knudson

            J Offline
            J Offline
            Jim Howard
            wrote on last edited by
            #5

            What you are describing is the textbook case for using a thread, your app must have some FUBAR'd design to preclude this. But another alternative that doesn't always occur to us Windows guys is to just do the long calculation in a whole seperate process, using any of the several available windows interprocess communications techniques to keep your GUI informed on how things are going.

            1 Reply Last reply
            0
            • D Doug Knudson

              Hi, I have a problem with a VC++ (6.0) dialog based application running under Windows XP. From a modal dialog, the user initiates some long-running activity, in a loop, that can take as much as 10 - 15 minutes to complete. If during the processing, the user covers the modal dialog with another window, even for a second or two, and then re-exposes it and clicks in the dialog, on Windows XP, "Not Responding" is displayed in the window title bar, causing the user to believe the app has died... but of course it hasn't. This behavior does not seem to occur under Windows 2000 or NT. There are a whole host of reasons why it would not be a good idea, in this particular situation, to start a new thread to do the processing, freeing up the dialog to respond to whatever messages XP is sending to determine if it is alive.... so.... Short of a separate thread... any ideas would be really, really appreaciated :) Thanks, Doug Doug Knudson

              S Offline
              S Offline
              Shog9 0
              wrote on last edited by
              #6

              Well, you've got your other options. But as David said, putting it in a separate thread is The Right Way. That's kinda what they're meant for, after all. FWIW, on Win2k and NT, Windows will also determine (at some point) that your app isn't responding. The difference under WinXP is that XP replaces your (unresponsive) window with a dummy window that displays the tile + "Not Responding", and allows the user to close it. They did this because, after six years of being told that the primary thread was for keeping the UI responsive and to do real work in other threads, we still weren't writing responsive apps.
              "The time has come," the Walrus said, "To talk of many things..."

              B 1 Reply Last reply
              0
              • D Doug Knudson

                Hi, I have a problem with a VC++ (6.0) dialog based application running under Windows XP. From a modal dialog, the user initiates some long-running activity, in a loop, that can take as much as 10 - 15 minutes to complete. If during the processing, the user covers the modal dialog with another window, even for a second or two, and then re-exposes it and clicks in the dialog, on Windows XP, "Not Responding" is displayed in the window title bar, causing the user to believe the app has died... but of course it hasn't. This behavior does not seem to occur under Windows 2000 or NT. There are a whole host of reasons why it would not be a good idea, in this particular situation, to start a new thread to do the processing, freeing up the dialog to respond to whatever messages XP is sending to determine if it is alive.... so.... Short of a separate thread... any ideas would be really, really appreaciated :) Thanks, Doug Doug Knudson

                D Offline
                D Offline
                Doug Knudson
                wrote on last edited by
                #7

                Hi all, Oh, how I miss the days of my youth when there was only one "correct" way to solve every problem... and I was always sure what the "correct" solution was to everyone's problems, even when I had no idea of the circumstances of the other person's problem. Oh well, those days are gone and I am much older now :-) At any rate, the winner is... Ravi Bhavnani for his excellent reference to the article on periodically pumping messages to keep the dialog alive. My sincere thanks to Ravi! Doug Doug Knudson

                1 Reply Last reply
                0
                • S Shog9 0

                  Well, you've got your other options. But as David said, putting it in a separate thread is The Right Way. That's kinda what they're meant for, after all. FWIW, on Win2k and NT, Windows will also determine (at some point) that your app isn't responding. The difference under WinXP is that XP replaces your (unresponsive) window with a dummy window that displays the tile + "Not Responding", and allows the user to close it. They did this because, after six years of being told that the primary thread was for keeping the UI responsive and to do real work in other threads, we still weren't writing responsive apps.
                  "The time has come," the Walrus said, "To talk of many things..."

                  B Offline
                  B Offline
                  Blake Miller
                  wrote on last edited by
                  #8

                  Only six years :wtf: I thought they have been rpeaching thread usage since Windows NT was released, back in something like 1993 :doh:

                  S 1 Reply Last reply
                  0
                  • B Blake Miller

                    Only six years :wtf: I thought they have been rpeaching thread usage since Windows NT was released, back in something like 1993 :doh:

                    S Offline
                    S Offline
                    Shog9 0
                    wrote on last edited by
                    #9

                    Maybe. I was stuck on OS/2 then though.
                    "The time has come," the Walrus said, "To talk of many things..."

                    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