My application is exceptioning with an out of memory error.
I traced it to the Dictionary.
I couldn't see what I wasn't doing correctly and then when I searched I saw that you've had issues with it in some builds.
I upgraded to 19.1.6 and I still have the issue.
I need to know if I have to comment out my calls to the Dictionary and publish my code to my users, or if this is a known problem that has a solution from you.
I have another ticket but I piggy-backed onto someone else's ticket where the problem was resolved several versions ago so that ticket may be at the bottom of your pile but I'd like to know what I can do ASAP for my users. I realize it absolutely could be a problem of mine, so if you confirm the dictionary is good in v19.1.6 I will examine my code more closely.
I noticed that you create a separate SpellChecker instance for each spelled editor and load dictionaries for each SpellChecker. Note that loaded dictionaries may allocate a significant amount of memory. There are no Stream.Close/Dispose method calls in the provided code snippet, so it looks like the dictionary streams stayed open after a form with SpellCheckers was closed.
As far as I understand your scenario, you wish to prevent check spelling in some controls on the form. If so, to accomplish the task, use the following approach:1. Create one SpellChecker instance and set the SpellChecker.ParentContainer property to the form where the spelled editors are located.
2. Exclude the required editors using the SpellChecker.SetCanCheckText(Control, Boolean) method.
spellChecker1.SetCanCheckText (editorName, false);
Alternatively, you can handle the BeforeCheck event and set the e.Cancel parameter to true to forbid checking in a certain control.
If you need to check spelling on several forms, you can create several SpellChecker instances with a shared dictionary collection. Use the SharedDictionaryStorage component to store and share dictionaries between spell checkers in your application. Refer to the How to: Use the SharedDictionaryStorage Component article for clarification.Show all comments