Hi Everyone,

I am working on a command line application that runs in a console (the dos window). It starts with the typical int main(argc, argv), there are no dialogs or MFC employed. It uses a third party API to work with a PDM system (that works with a database in turn). The program initializes the PDM system when it starts, and at the end of the program, it terminates the PDM process.

The issue is when CTRL-C is pressed, the program simply shuts down and the PDM system generates errors, since there is not a clean shutdown of the process.

Is there a way I can trap the CTRL-C to be able to do the cleanup? Would this be through the use of Exception Handling? (I am not currently using any exception handling).

Thanks for the anticipated help.

Kamran