User Tools

Site Tools


tplextensioncleanclosedown.htm
Navigation:  Templates > Guide to all Templates > Extension Templates >====== CleanCloseDown Global Extension ====== Previous pageReturn to chapter overviewNext page

(ABC Template Chain Only)

This extension template is used to include the CleanCloseDown( ) procedure prototype that can be used in any procedure to cleanly close down your application.

NoteBox.jpg

This template also requires the global FrameExtension Template

A clean closedown is defined as the proper and automatic shutdown of any application, regardless of the state of the application. For example, if a user leaves the office with an application running, and a form procedure is open, the CleanCloseDown procedure, when called on a timer event, can shut down the application without user intervention.

This global extension automatically includes a local extension for every procedure in your application that incorporates a WINDOW structure.

To use this template, simply call the CleanCloseDown() procedure from any embed point. Normally this would be from a TIMER event on any window.

The CleanCloseDown( ) procedure is simple, and takes advantage of the proper method to close down a program in a multi-threaded environment with the proper use of the NOTIFY language statement:

CleanCloseDown PROCEDURE()

CODE

MESSAGE('BYE')

GLO:CleanCloseDown = True

NOTIFY(NOTIFY:CloseDown,GLO:CleanCloseDownMainThread)

NoteBox.jpg

When using this template in your application, the following global variables are internally defined:

 

GLO:CleanCloseDown           BYTE(0)

GLO:CleanCloseDownMainThread LONG

The only template prompt available is the ability to Disable Clean Close Down when testing its compatibility with other third-party templates.

NoteBox.jpg

In multi-DLL applications, you will also need to include the global extension in any DLL target application that will need to use the CleanCloseDown procedure.

tplextensioncleanclosedown.htm.txt · Last modified: 2021/04/15 15:57 (external edit)