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

Exit handler?

Hi all,

I have a VS 2003 unmanaged C++ DLL library application. One of my routines
needs to do some cleanup when the calling application exits for any reason.
What are my options for creating some sort of "application termination
handler" that gets control when the application exits? (In particular, I
need to perform the cleanup if the calling app terminates abnormally.) TIA!
Mar 16 '06 #1
2 1156
Hi Bob!
I have a VS 2003 unmanaged C++ DLL library application. One of my routines
needs to do some cleanup when the calling application exits for any reason.
What are my options for creating some sort of "application termination
handler" that gets control when the application exits?
See: _onexit
http://msdn2.microsoft.com/en-us/library/zk17ww08.aspx
(In particular, I
need to perform the cleanup if the calling app terminates abnormally.) TIA!


AFAIK, you have no chance to survive a "TerminateProcess"...

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Mar 16 '06 #2
Just what the doctor ordered. Thanks!

"Jochen Kalmbach [MVP]" <no********************@holzma.de> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi Bob!
I have a VS 2003 unmanaged C++ DLL library application. One of my routines needs to do some cleanup when the calling application exits for any reason. What are my options for creating some sort of "application termination
handler" that gets control when the application exits?
See: _onexit
http://msdn2.microsoft.com/en-us/library/zk17ww08.aspx
(In particular, I
need to perform the cleanup if the calling app terminates abnormally.)

TIA!
AFAIK, you have no chance to survive a "TerminateProcess"...

--
Greetings
Jochen

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

Mar 16 '06 #3

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

Similar topics

0
by: Andrew Athan | last post by:
I have a python program (snippet below) which does not want to seem to die when I issue a sys.exit() inside the SIGTERM handler. The output below is generated as the result of sending several...
2
by: Ishwar Rattan | last post by:
Here is a piece code (according to blurb on os.wait, the lower order 7 bits of exit status of process should contain the signal number of signal that terminated the process..) and signal number...
13
by: Siemel Naran | last post by:
Hi. I posted this question to comp.lang.c++, but am rephrasing it a bit from what I learned and posting to comp.lang.c++.moderated for more insight. So how do I solve my problem? I want it so...
0
by: szehau | last post by:
Hi all, I have a program written in C with embeded SQL. Following are the configuration: DB2/LINUX 8.1.5 Thread model: posix gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7) My problems...
2
by: chuckles | last post by:
Hullo all, as the subject says Does pthread emit a sigchld signal on successful exit? I have an app which starts a thread in response to a button press in a GUI. I can't join the thread but I need...
4
by: Chuck | last post by:
Hello everybody, I need to abort execution during start up, while the constructor called by Application.Run is executing. If the database fails to connect during my application's startup I...
6
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
2
by: GGerard | last post by:
Hello Is there a way to exit all running procedures with one command? Sometimes a procedure(1) will call another procedure(2) which could call a third procedure(3) and what I would like to...
20
by: lovecreatesbeauty | last post by:
Hello experts, Is the following code snippet legal? If it is, how can exit() do the keyword return a favor and give a return value to the main function? Can a function call (or only this...
8
by: Suresh | last post by:
Hi All I have one STATES table with two fields (STATECODE, NAME). I had written following stored procedure on this table CREATE PROCEDURE ESCRIP.STATES_GETALL(OUT @ERRORCODE INT, OUT...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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.