Forum > Windows

Synchronize() seems to not work in Total Commander plugin

<< < (2/2)

Remy Lebeau:

--- Quote from: korba812 on March 25, 2022, 03:14:53 pm ---I assume you are using LCL. If so, you must periodically call Application.ProcessMessages method in main thread.
If you are not using LCL then you must periodically call procedure CheckSynchronize, also from the main thread.

--- End quote ---

However, if the main thread is in the EXE and the Synchronize() call is in the DLL, you need to call CheckSynchronize() from inside the DLL, not from inside the EXE, since the EXE and DLL will likely be operating on separate RTL instances, and thus using separate Synchronize() queues.  In this case, the DLL would have to export a function to call its version of CheckSynchronize(), and then the EXE would have to call that exported function periodically, such as in a Timer, or a TApplication.OnIdle handler, etc.  Calling Application.ProcessMessages() in the EXE would not cut it.

My case is:
EXE: Total Commander. I cannot affect it.
DLL: main thread: painting of text editor; 2nd thread: text parser.

Now what I did: I started the timer from DLL main thread which calls App.ProcessMessages.


[0] Message Index

[*] Previous page

Go to full version