Problem when terminating application.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jajjo
    New Member
    • May 2009
    • 26

    Problem when terminating application.

    Hello,

    I have an issue with closing my application. I'll try to convey my problem as coherently as possible. It's a mite convoluted.

    I have my program that I'm coding in C++, using MS Visual Studio 2005. I have a Log Manager in said program that uses DirectX to write messages to the applications client area.

    Describing the problem as "the time my program takes to close" is a bit of a misnomer. What's actually happening (I thought I'd describe it in it's own paragraphs) is thus: I terminate the application. The app is returning 0 to WinMain. All of the code is running/completing. I have Visual Leak Detector and DirectX Error Logging enabled and I'm not getting any unreleased devices or memory leaks. The program closes. The part that takes a long time is Visual Studio exiting Debug mode and returning to the Editing mode (not sure what the normal mode is called).

    To elaborate; you know when you run your app in debug mode and the layout of Visual Studio changes (The location of the callstack/output window etc.)? And then you stop your app, and the layout of VS reverts to how you had it when coding before you ran the app? The error is in the time between stopping the app (alt-f4 is how I'm terminating the app) and Visual Studio reverting the layout to the way it was before I ran the app.

    Sorry for the drawn out explaination, but it seems that the more info I can provide, the more chance there is of a resolution.

    Here is the problem: when I write messages to the screen, the application takes an amount of time relative to the amount of time the messages were displayed to close. That is, the longer I'm writing messages, the longer my application takes to close.

    I'm at work at the moment, but can provide code or detailed explaination of any processes involved if necessary when I get home. If anyone has any preliminary insight, it'd be appreciated.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    I would start by seeing if I get the same behaviour if I just run the program from a command prompt.

    Also I would use Process Explorer (google it its a free download from Microsoft) to monitor the activity of the program.

    Are you sure the amount of time to close is relative to the amount of time the messages are displayed as opposed to the number of messages that are displayed?

    Comment

    • Jajjo
      New Member
      • May 2009
      • 26

      #3
      In regards to your first suggestion; do you mean to just try running the application outside of the IDE? Seems such a simple test to perform that I have overlooked... I'll give it a shot when I get home.

      I will also look into getting Process Explorer. [Researching it after this post]

      I can't say for sure that the amounts are relative, but there is definitely a correlation between the length of time the messages are being displayed (or, as you say, the amount of messages - which, implicitly, means the amount of calls to the draw function I'm using to write the text) and the duration of time the IDE takes to exit debug mode.

      I will say though, that the computer shows no sign of processor drain while the IDE is in the process of returning to the normal editing mode.

      Thanks for your input, and I will contribute more speculation / facts when I get home and act upon your suggestions.

      Comment

      • Jajjo
        New Member
        • May 2009
        • 26

        #4
        Just another update,

        I have continued in my endeavours to find a solution (yay for slow days at work) to my problem and may have stumbled upon one.

        The home for technical questions and answers at Microsoft. Get started asking, answering, and browsing questions about products like .Net, Azure, or Teams.


        and

        The home for technical questions and answers at Microsoft. Get started asking, answering, and browsing questions about products like .Net, Azure, or Teams.


        Hopefully, when I get home I will try this and solve the problem.

        What the person explains is almost exactly what happens to mine, except that mine is quite considerably more frequent (see: every time).

        I shall keep the thread informed of my progress. I am doubtful of this resolving my issue, however. (Ever the pessimist).

        Edit: Upon further inspection, it looks as though this WON'T fix the problem. They refer to pressing the "STOP" button causing the error, while if I press the stop button it doesn't happen. It's only when I natively close the program (I think that's the right term). Still, though - I'll give it a shot.

        Edit2: I forgot to mention that the computer works completely fine while the program is returning to editing mode, the editor section of the program is still fully functional. Everything is still fully functional.The program is not FREEZING - it's just not switching back to editing mode immediately upon termination of the application.

        Just thought I should clarify that point. The program is NOT freezing, just failing to switch modes.

        Comment

        • Jajjo
          New Member
          • May 2009
          • 26

          #5
          Well, it wasn't the export options.

          It turns out it's VLD.

          Comment

          Working...