Posted By: ploe | Nov 12th, 2008 @ 1:41 PM
page 1 of 1
Comments: 8 | Views: 800
So I have this c++ console application that takes a while to close. In my SetConsoleCtrlHandler handler I have to write some things to disk before my program can closes. So when you close my application the End Program dialog comes up because Windows thinks my application is not responding. Is there a way for me to tell Windows "hey I am still responding, it just takes me a while to close"?
littleguru
littleguru
<3 Seattle

Why are you actually writing that much data while closing? I mean it might be valid to do that but I'm curious why you keep all that stuff to the end. What if your application crashes, do you loose data?

TommyCarlier
TommyCarlier
I want my scalps!
Console applications are not meant to be closed by the user. They don't have a message loop and should shut down when their task has been performed.
staceyw
staceyw
Before C# there was darkness...
How about writing some progress to the console?
Curt Nichols
Curt Nichols
No Silver Bullet
Have you considered structuring your file so you can simply append each newly completed computation to the end of the file? That might be faster than writing all your data to the file at once.
Minh
Minh
WOOH! WOOH!
I think he meant if you do a Windows Logout / Shutdown?

It gets worse in Vista... Vista won't even wait for your app... (I think)

There must be a WM_ that you have to respond to though...
Curt Nichols
Curt Nichols
No Silver Bullet
> There must be a WM_ that you have to respond to though...

Not in console apps.
W3bbo
W3bbo
The Master of Baiters
So how come the console programs I write end simply enough by closing their terminal window.

But if you open Telnet and try to close it whilst it's attempting to forge a connection it won't die until the network timeout has passed.

How does it do that?
page 1 of 1
Comments: 8 | Views: 800
Microsoft Communities