Announcement

Collapse
No announcement yet.

How does Windows decide a program is "not responding"?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Gösta H. Lovgren-2
    replied
    Originally posted by Michael Mattias View Post
    >
    Thank you for mentioning - even off-handedly - the flair, elan, and panache.

    MCM
    "off-handed"? Why, Michael, whatever do you mean? Those are exactly the qualities I was referring to.

    Leave a comment:


  • Michael Mattias
    replied
    >>I write with a lot of white space and comments.
    >Among other things

    Thank you for mentioning - even off-handedly - the flair, elan, and panache.

    MCM

    Leave a comment:


  • Gösta H. Lovgren-2
    replied
    Originally posted by Michael Mattias View Post
    I write with a lot of white space and comments.
    Among other things.

    =====================================
    "Alia jacta est." (The die is cast.)
    JULIUS CAESAR
    after crossing the Rubicon
    =====================================

    Leave a comment:


  • Michael Mattias
    replied
    > the demo is longer than my entire app...

    I write with a lot of white space and comments.

    Leave a comment:


  • Conrad Hoffman
    replied
    Michael, I need to do it that way at some point, as an abort would be nice feature. Ok, an essential feature OTOH, the demo is longer than my entire app, and since my last fix and post, I've used the app to collect data on multiple parts, analyzed the data in a spreadsheet and written/distributed a report on those parts, so the quick fix was pretty successful!

    Leave a comment:


  • Michael Mattias
    replied
    Thanks all- though it might not be the most sophisticated way, a dialog doevents in my loop solved the problem nicely! The loop typically runs in about 100 mS, but it runs continuously for up to a minute or two.
    GUI + Worker Thread + Abort Demo 11-24-07

    Leave a comment:


  • Conrad Hoffman
    replied
    Thanks all- though it might not be the most sophisticated way, a dialog doevents in my loop solved the problem nicely! The loop typically runs in about 100 mS, but it runs continuously for up to a minute or two.

    Leave a comment:


  • Michael Mattias
    replied
    SendMessageTimeout() would be useful.

    Leave a comment:


  • Paul Dixon
    replied
    Conrad,
    I thought it was to do with the windows message loop. When Windows sends your application a message it expects you to take it in a reasonable time. If you don't then Windows assumes the application is not responding.

    When you try to close an application, a WM_CLOSE notification will be sent to your program to tell it to close down. Again, if your program does not respond in a timely manner then Windows will offer the option to the user to forcibly terminate the application with the potential loss of data.

    Are you sure you keep responding to messages in your application's message queue while your data is being acquired?

    Paul.

    Leave a comment:


  • Adam J. Drake
    replied
    You can also throw a DIALOG DOEVENTS statement in your loop as well to help flush out the message queue...

    Leave a comment:


  • Kev Peel
    replied
    Windows detects an app is "not responding" when the app's message queue is full (ie. you are running the app in a loop without allowing Windows to process messages). The best way around this (IMO) is to put your processing code in a second thread and disable the dialog that's running in the primary thread. The primary thread will then be able to process the message queue properly, while the second thread does it's work. That's basically all there is to it.

    Leave a comment:


  • How does Windows decide a program is "not responding"?

    My app will be humming along moving motors and recording data, when Windows decides it's not responding. Usually takes about 5-10 seconds, or may not happen at all. My screen updates stop, but all my motion and data collections continues to work fine. When the activity is supposed to stop, it stops. Program flow goes back to the callback, the screen is updated and everything is normal again. No data is lost. This is one thread and just a series of calls to various instrument drivers, then data updates to text boxes.
Working...
X
😀
🥰
🤢
😎
😡
👍
👎