Probem using the RV Edit OnSpellingCheck event
Posted: Thu Feb 01, 2007 4:45 pm
Hello All:
I am having a problem with TRichViewEdit and EDDSpell working together nicely. It appears to be some kind of race condition.
It appears to have to do with the OnSpellingCheck event. As far as I can tell, the problem occurs when the event is connected to the following handler:
procedure TfrmDBDlg.RVSpellingCheckEvent(Sender: TCustomRichView;
const AWord: string; StyleNo: Integer; var Misspelled: Boolean);
begin
Misspelled := frmMain.dlgSpell.IsBadWord(AWord);
end;
When this handler is connected, I get the wavy lines underneath as expected for misspelled words. As long as the focus is not taken off the richviewedit, it works OK. Then, if the focus is removed to go to another control, the system freezes up. The error cannot be debugged, I only get the CPU screen with no invocation stack to troubleshoot. It freezes the process when this occurs. Removing the event handler causes the system to work correctly. In both cases, explicitly doing a spell check works fine - no hint of trouble whether the event handler is connected or not.
Interestingly, the problem as described happens when the control is created at run time dynamically. If the control is created during design time, it appears to work correctly - wavy lines appear as expected and you can change context as desired. However, when shutting down the app, I get the following error: EOSError with message 'System Error. Code: 5. Access is denied.'" Again, removing the event handler makes that problem go away.
I am using:
Version 7 of EDSS
Delphi 2005 Build 2600 Service Pack 2
RichView Version 1.9
This exact same code worked really good in Delphi 5.
jamie
I am having a problem with TRichViewEdit and EDDSpell working together nicely. It appears to be some kind of race condition.
It appears to have to do with the OnSpellingCheck event. As far as I can tell, the problem occurs when the event is connected to the following handler:
procedure TfrmDBDlg.RVSpellingCheckEvent(Sender: TCustomRichView;
const AWord: string; StyleNo: Integer; var Misspelled: Boolean);
begin
Misspelled := frmMain.dlgSpell.IsBadWord(AWord);
end;
When this handler is connected, I get the wavy lines underneath as expected for misspelled words. As long as the focus is not taken off the richviewedit, it works OK. Then, if the focus is removed to go to another control, the system freezes up. The error cannot be debugged, I only get the CPU screen with no invocation stack to troubleshoot. It freezes the process when this occurs. Removing the event handler causes the system to work correctly. In both cases, explicitly doing a spell check works fine - no hint of trouble whether the event handler is connected or not.
Interestingly, the problem as described happens when the control is created at run time dynamically. If the control is created during design time, it appears to work correctly - wavy lines appear as expected and you can change context as desired. However, when shutting down the app, I get the following error: EOSError with message 'System Error. Code: 5. Access is denied.'" Again, removing the event handler makes that problem go away.
I am using:
Version 7 of EDSS
Delphi 2005 Build 2600 Service Pack 2
RichView Version 1.9
This exact same code worked really good in Delphi 5.
jamie