Hi Sergey,
Can one TRVHunSpell object (alone with a TRVAHunSpellInterface) be used by multiple editors for live spell check? As we know, the OnSpellingCheck event is called in a background thread.
Is TRVHunSpell thread-safe and can be used for multiple editors?
Re: Is TRVHunSpell thread-safe and can be used for multiple editors?
According to the RichViewAtions document:
Currently I have only a single TRVAControlPanel but have multiple editors. By looking at the TRichViewEdit source code, I found that each editor has its own spell check thread. Does it mean with the approach above, there will be multiple threads accessing the same TRVAHunSpellInterface/TRVHunSpell pair?Create TRVAHunSpellInterface component, assign it to SpellInterface property of TRVAControlPanel component.
Create TRVHunSpell component, assign it to HunSpell property of this TRVAHunSpellInterface component.
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Is TRVHunSpell thread-safe and can be used for multiple editors?
Yes, there will be one thread for each editor.
So I recommend to protect OnSpellingCheck code by a TCriticalSection.
So I recommend to protect OnSpellingCheck code by a TCriticalSection.
Re: Is TRVHunSpell thread-safe and can be used for multiple editors?
Great, it's a piece of cake!