Appendices > Using Rogue Wave Server on Windows > Shutting Down an Application Cleanly
 
Shutting Down an Application Cleanly
In order to close down your application cleanly, you can trap the close request (either from the Close menu if not of type ILS_WINDOWTYPE_POP or by the Ctrl-Q command) and shutdown the application yourself. Here is an example:
#include <ilserver/logfile.h>
#include <ilserver/wtty.h>
 
IlsTTY* tty = IlsLogfile::getTTY();
if (tty) {
tty->setCloseFunc(closeRequested);
}
closeRequested is a callback with the following signature:
typedef IlsBoolean (*IlsTTYCloseFunc)(IlsAny, UINT);
The application callback should return IlsTrue if the application can safely exit or IlsFalse if the shutdown failed and the application does not want to exit.

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.