Where to do the final processing before closing the application?

I am trying to write data to storage when the form closes or the application terminates and was NOT successful.

At first I tried from the form module

procedure TForm1.FinalizeObject; begin inherited; SaveData; end; 

and

 procedure TForm1.FinalizeObject; begin SaveData; inherited; end; 

none of these attempts worked, so I fixed my code and tried it from the project block

 procedure TApplication.ApplicationClosing; begin SaveData; inherited; end; 

and

 procedure TApplication.ApplicationClosing; begin inherited; SaveData; end; 

I have w3_showmessage as the first line of SaveData and it is never called ever .... so if I can verify that one of these 4 methods is running, I can use one of them

What am I doing wrong? Thanks

+4
source share
1 answer

Since its inception, Smart provides two objects in the application object:

  • Onunload
  • OnBeforeUnload

This will simplify the processing of shutdown sequences. The smart javascript bootstrap also calls the application.terminate () application automatically, so your code should work fine.

+2
source

All Articles