On Mon, 25 Apr 2022 15:47:57 +0200 Thomas Kurz via fpc-pascal <fpc-pascal@lists.freepascal.org> wrote:
>[...] > As far as I have seen so far, the common solution is to use a > variable inside the class to cache the parameters, then to use a > DoCallSync procedure which takes no parameters but can use the cached > values inside, and finally to call TThread.Synchronize(NIL, > @DoCallSync). I have stick to this concept when using Synchronize, > too. Or some small class: type TMyData = class a: whatever; procedure Run; end; MyData:=TMyData.Create; MyData.a:=...; TThread.Synchronize(NIL, @MyData.Run). Free MyData when done and/or in the destructor. >[...] Mattias _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal