delphi service application stop after 15 second, timer not executing

前端 未结 3 1345
梦如初夏
梦如初夏 2021-01-16 08:35

I want to make service application in Delphi that run and copy some files everyday at 02:00 PM. So i have used timer. but control not going to timer event and Service termin

3条回答
  •  无人及你
    2021-01-16 09:22

    Instead of a timer, use a simple thread launched in OnStart event.

    A tutorial is here:

    http://www.tolderlund.eu/delphi/service/service.htm

    TTimer is better suited for GUI applications. They need a message pump (see here):

    TTimer requires a running message queue in order to receive the WM_TIMER message that allows the OS to pass the message to the HWND, or to trigger the specified callback

提交回复
热议问题