Catch a control-break in a console app

Catch a control-break in a console app

I have a console app that accesses database routines in a dll. Before the program terminates I need to call a routine in the dll to de-initialize and close database connections. When a user breaks out of the program using Control-break I don't get a chance to call the routine and end up with an access violation. Is there a way to catch or prevent control-breaks before the program is terminated?

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.