IIRC,
Synchronize is a method of
TThread, not an independent function, so you can't call it like that.
In your case (and from a
very quick look to your code) what I would do probably is to use the critical section (or other "locking" mechanism) inside
AddMessage, which is where it's needed.
I would need to study the code deeper to give more meaningful (and complete) advice but I don't have time now, sorry.
Anyway, HTH