Rank: Member
Groups: Registered
Joined: 3/28/2017 Posts: 12 Location: Graz, Austria
|
Hey there,
i recently added Spellchecking to many standard winform - textboxes across the application. To do that i intialize a rapidspellasyoutype object once on global level, and add on the Form_Load events whenever i require spellchecking.
rapidSpell.AddTextBoxBase(textbox1); HOWEVER: If you close that form fast (so that rapidspell.AddTextBoxBase started threads aren'T finished you will get an InvalidOperationException - (Invoke or BeginInvoke cannot be called on a control until the window handle has been created) StackTrace: System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
What crashes the whole application with a TargetInvocationException,
If you add rapidSpell.RemoveTextBoxBase(textbox1) on the FormClosing event the problem can be resolved. I first tried it on Dispose, but that's to late ... ) Still for rapidSpell.AddTextComponent this issue doesn't exist.
I think the issue is very mean, as it only occurs if you close the Form fast (what isn't a standard use/test case). So this one gave me quite some headache. I hope you can fix it for future releases.
Best regards, Alwin
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 10/20/2004 Posts: 456
|
Hi Alwin, Thank you for your post. I will make sure a developer looks at this today and if necessary we'll post here with an update. Thanks again. Dan Keyoti Dan Wright
|
Rank: Advanced Member
Groups: Administrators, Registered
Joined: 8/13/2004 Posts: 2,669 Location: Canada
|
Hi Alwin, thanks for your bug report and for posting a workaround. I'll log it to be fixed in the next release. If you do need it sooner (sounds like you won't) then just let me know. Jim -your feedback is helpful to other users, thank you!
|