473,386 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Problem when terminating application.

26
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.
Feb 16 '10 #1
4 1644
Banfa
9,065 Expert Mod 8TB
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?
Feb 17 '10 #2
Jajjo
26
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.
Feb 17 '10 #3
Jajjo
26
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.

http://social.msdn.microsoft.com/For...b-5c35ad092aa0

and

http://social.msdn.microsoft.com/for...-28b404263b3f/

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.
Feb 17 '10 #4
Jajjo
26
Well, it wasn't the export options.

It turns out it's VLD.
Feb 17 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Forecast | last post by:
I run the following code in UNIX compiled by g++ 3.3.2 successfully. : // proj2.cc: returns a dynamic vector and prints out at main~~ : // : #include <iostream> : #include <vector> : : using...
0
by: shaun roe | last post by:
This is perhaps more c++ than XML: I have a main program which instantiates two classes which use Xerces. Up until recently I followed the following philosophy in each class: 1) In...
8
by: dbuser | last post by:
Hi, I need help on a problem, as described below. I am reading a file "input.txt"which has data like this: abc def gh izk lmnopq rst uvwxyz I am using fstream object to read the file and...
4
by: Nurchi BECHED | last post by:
Hello, my dearest respected brother, All! I am writing an application which uses printer port to play with LEDs for now and something else later... I created a button which makes LEDs...
10
by: james | last post by:
My app has a notify Icon, but after the app exits, the Icon is still visible, and then when I runthe app multiple times I get multiple icons so that my status bas keeps accumulating them to the...
0
by: Tequila | last post by:
Here’s the description I’d launched Visual Studio and started to write an application After some time of coding, I wanted to test it. I pressed F5 hopin to run application for debugging. I...
5
by: ramendra | last post by:
Hello there, I am having some problem with using StreamWriter object in aspnet application. The thing is when i use the streamwriter in an aspnet page the code gets executed fine but its...
19
by: ern | last post by:
Right now I'm using exit(0) to terminate my program. My program is a console .exe application. After the "exit(0)" line of code is encountered, the console application waits for an enter press,...
7
by: Salvador | last post by:
Hi, I am using WMI to gather information about different computers (using win2K and win 2K3), checking common classes and also WMI load balance. My application runs every 1 minute and reports...
4
by: Al Norman | last post by:
We have two separate DLLs that do not interact (directly, at least). One is an MFC extension DLL that was built back in VC++ 6 days (but has been recompiled with VS2005). The other is a DLL that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.