473,320 Members | 1,883 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,320 software developers and data experts.

Termination of application on win9x

Hi all,

I have a major problem with my application. For some reason on win9x my
application will not exit properly when the user shuts down there system.
This doesnt seem to be a problem on XP. My application in question is a
command prompt based app. For some reason the application does not seem to
recieve its termination signal. Is this a known problem with win9x systems
and if so is there a way to work arround it?

Thanks for any help in advance

Jamie
Nov 17 '05 #1
5 1482
Hi Jammie!
I have a major problem with my application. For some reason on win9x my
application will not exit properly when the user shuts down there system.
This doesnt seem to be a problem on XP. My application in question is a
command prompt based app. For some reason the application does not seem to
recieve its termination signal. Is this a known problem with win9x systems
and if so is there a way to work arround it?


You have correctly called "SetConsoleCtrlHandler", or?

See: SetConsoleCtrlHandler
http://msdn.microsoft.com/library/en...trlhandler.asp

Then normaly it should work.

I suppose, that after you receive the End-Event, you do not terminate
correctly...

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #2
Set ConsoleCtrlHandler is set.

The code in question is the following:

BOOL WINAPI ConsoleControlHandler ( DWORD dwCtrlType ){
BOOL bReturnStatus = FALSE;
switch( dwCtrlType ){
case CTRL_C_EVENT:
if(gstate.activities_suspended) {
resume_client();
} else {
suspend_client();
}
bReturnStatus = TRUE;
break;
case CTRL_BREAK_EVENT:
case CTRL_CLOSE_EVENT:
case CTRL_SHUTDOWN_EVENT:
quit_client();
bReturnStatus = TRUE;
break;
case CTRL_LOGOFF_EVENT:
if (!gstate.executing_as_daemon) {
quit_client();
}
bReturnStatus = TRUE;
break;
}
return bReturnStatus;
}

When i run the application on windows 98 the above code does not seem to run
when a shutdown or logoff action is taken. Does anyone have any idea's?

Jamie
"Jochen Kalmbach [MVP]" <no********************@holzma.de> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi Jammie!
I have a major problem with my application. For some reason on win9x my
application will not exit properly when the user shuts down there system.
This doesnt seem to be a problem on XP. My application in question is a
command prompt based app. For some reason the application does not seem
to recieve its termination signal. Is this a known problem with win9x
systems and if so is there a way to work arround it?


You have correctly called "SetConsoleCtrlHandler", or?

See: SetConsoleCtrlHandler
http://msdn.microsoft.com/library/en...trlhandler.asp

Then normaly it should work.

I suppose, that after you receive the End-Event, you do not terminate
correctly...

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/

Nov 17 '05 #3
I have investigated further, this is to do with a bug in windows 9x where if
multiple messages are sent to the console control at the same time they get
ignored. This means the messages are never recieved by the application. I
dont know waht to do now. Im working on pre ME so im not sure waht my
options are. I am running a separate application that is running as a
windows application, maybe i could authorise the shutdown of the client from
this other program, but if no messages are being recieved how is this going
to help? I guess i could launch the console part as a child process but im
not sure how that would work.

Have other people here had this problem? What path have you taken to solve
this?
Jamie

"Jammie" <ja****@dsl.pipex.com> wrote in message
news:J7********************@pipex.net...
Set ConsoleCtrlHandler is set.

The code in question is the following:

BOOL WINAPI ConsoleControlHandler ( DWORD dwCtrlType ){
BOOL bReturnStatus = FALSE;
switch( dwCtrlType ){
case CTRL_C_EVENT:
if(gstate.activities_suspended) {
resume_client();
} else {
suspend_client();
}
bReturnStatus = TRUE;
break;
case CTRL_BREAK_EVENT:
case CTRL_CLOSE_EVENT:
case CTRL_SHUTDOWN_EVENT:
quit_client();
bReturnStatus = TRUE;
break;
case CTRL_LOGOFF_EVENT:
if (!gstate.executing_as_daemon) {
quit_client();
}
bReturnStatus = TRUE;
break;
}
return bReturnStatus;
}

When i run the application on windows 98 the above code does not seem to
run when a shutdown or logoff action is taken. Does anyone have any
idea's?

Jamie
"Jochen Kalmbach [MVP]" <no********************@holzma.de> wrote in
message news:%2****************@tk2msftngp13.phx.gbl...
Hi Jammie!
I have a major problem with my application. For some reason on win9x my
application will not exit properly when the user shuts down there
system. This doesnt seem to be a problem on XP. My application in
question is a command prompt based app. For some reason the application
does not seem to recieve its termination signal. Is this a known problem
with win9x systems and if so is there a way to work arround it?


You have correctly called "SetConsoleCtrlHandler", or?

See: SetConsoleCtrlHandler
http://msdn.microsoft.com/library/en...trlhandler.asp

Then normaly it should work.

I suppose, that after you receive the End-Event, you do not terminate
correctly...

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/


Nov 17 '05 #4
>I have investigated further, this is to do with a bug in windows 9x where
if multiple messages are sent to the console control at the same time they
get ignored. This means the messages are never recieved by the application.
I dont know waht to do now. Im working on pre ME so im not sure waht my
options are. I am running a separate application that is running as a
windows application, maybe i could authorise the shutdown of the client
from this other program, but if no messages are being recieved how is this
going to help? I guess i could launch the console part as a child process
but im not sure how that would work.

Have other people here had this problem? What path have you taken to solve
this?


You can acknowledge this as known bug in your program, and can state that
it's fixed in XP. :-)
Nov 17 '05 #5
I could, but ideally i need to cover the fact that people are still using
this platform.

Jamie

"Vladimir Nesterovsky" <vl******@nesterovsky-bros.com> wrote in message
news:u1****************@TK2MSFTNGP09.phx.gbl...
I have investigated further, this is to do with a bug in windows 9x where
if multiple messages are sent to the console control at the same time
they get ignored. This means the messages are never recieved by the
application. I dont know waht to do now. Im working on pre ME so im not
sure waht my options are. I am running a separate application that is
running as a windows application, maybe i could authorise the shutdown of
the client from this other program, but if no messages are being
recieved how is this going to help? I guess i could launch the console
part as a child process but im not sure how that would work.

Have other people here had this problem? What path have you taken to
solve this?


You can acknowledge this as known bug in your program, and can state that
it's fixed in XP. :-)

Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Timothy Smith | last post by:
i want to run my sql statements on a seperate thread to prevent my app from stop responding to input (atm is says "not responding" under windows until the sql is finished) but i'm hesitant because...
2
by: Jim McGrail | last post by:
Background: I am investigating a problem involving a windows .NET application that is being developed in C# with Visual Studio 2003. It is a multi-threaded application that uses MSMQ to...
6
by: Nou Dadoun | last post by:
I'm currently developing an application in C++/MFC (Visual Studio 6, if that makes a difference) and I'd like to avoid the Windows style UI widgets and dialogs if at all possible. In fact, what...
2
by: José Joye | last post by:
I have a library written in C (I do not have the source) and having some callbacks exported. It is currently not that stable and write to stdout and stderr :-(( The idea I have is to wrap it with...
4
by: Jeff Molby | last post by:
Does anyone know offhand how the EventLog acts on Win9x? Does it know to create text logs or does it just raise an exception? If anyone has any experience with this, I'd appreciate a brief...
1
by: Gernot Frisch | last post by:
Hi, I have recompiled a VC+ 6 project to VC++ 7.1 (native code - am I OT here?). Everything went smoothly, but now, after 6 month of work, when I want to run the program for the first time on...
2
by: Oenone | last post by:
I'm developing a wrapper around a series of VB6 plugins that I now want to be able to run in my VB.NET application. Everything is working fine, except I can't find a way to get the...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
10
by: sp | last post by:
The application is written in Visual Basic / .NET and working without problems under Windows XP, Windows 2000, Windows 2003 but it isn't working under Windows ME and Windows 98 - the computer...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.