I want to determine when the file date changes and the DevX TdxMemData is updated, which is used as Tdatasource, which will then be displayed in the TDBGrid that uses it.
I found code that uses ReadDirectoryChangesW, but seems rather complicated for my simple needs.
I am considering using TTimer and firing from it every five seconds. (For me it's pretty good accuracy.)
Are there any reservations to this? I read that threads have all kinds of restrictions on access to VCL, etc. Does the same apply to TTimer events?
Is there anything I need to keep track of the FileAge call and the DevEx TdxMemData object updating during the Timer event? Will these updates be visible in my main application?
Is there a way to detect the “state” of my program when the Timer event gets control, so I can avoid problems?
Or am I opening a huge can of worms while thinking about using TTimer for this?
source
share