Need advice on a Delphi programming problem - I need to develop a Delphi program that will be run by the Windows scheduler every 15 minutes, and when it runs it will call a web service, put some data into the database, and then exit. So that raises some questions:
1) Where do I put the code that needs to execute automatically? In the FormActivate routine of the startup form doesn't seem right, but that's all I can think of.
2) What will happen if the program hits some sort of problem and displays a pop-up error dialog? Because it is being run by the scheduler, not a person, no one will see the dialog box and it will just sit there. How do I deal with that?
3) In an attempt to deal with the previous issue I tried setting up a timer to trigger 10 minutes after startup and then put "Application.Terminate" or "Close" in the OnTimer event, but if the program is displaying an error dialog box when the timer fires that causes it's own pop-up error box that says "Object reference not set to an instance of an object." So the program continues to hang.
Thanks in advance for any advice.