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
Probem using the RV Edit OnSpellingCheck event
We are using different spell modules (I think)
Hi Stef:
I don't see how to do with my code what you did with yours.
My speller is EDDSpell and my code for handling the event looks like this:
procedure TfrmDBDlg.RVSpellingCheckEvent(Sender: TCustomRichView;
const AWord: string; StyleNo: Integer; var Misspelled: Boolean);
begin
Misspelled := frmMain.dlgSpell.IsBadWord(AWord);
end;
Even replacing Misspelled with a local and then setting it did not effect the behavior.
Are there any specific compiler settings that might cause this kind of a problem? I am just starting to use Delphi 2005; did not seem to have these problems in Delphi 5.
jamie
I don't see how to do with my code what you did with yours.
My speller is EDDSpell and my code for handling the event looks like this:
procedure TfrmDBDlg.RVSpellingCheckEvent(Sender: TCustomRichView;
const AWord: string; StyleNo: Integer; var Misspelled: Boolean);
begin
Misspelled := frmMain.dlgSpell.IsBadWord(AWord);
end;
Even replacing Misspelled with a local and then setting it did not effect the behavior.
Are there any specific compiler settings that might cause this kind of a problem? I am just starting to use Delphi 2005; did not seem to have these problems in Delphi 5.
jamie
apparently you've different events ???
here is my full code, (inclusive bug notice )
But I'm almost certain, Sergey will come up with a perfect solution !
here is my full code, (inclusive bug notice )
But I'm almost certain, Sergey will come up with a perfect solution !
Code: Select all
procedure Tform_rve_edit.RVESpellingCheck(Sender: TCustomRichView;
const AWord: String; StyleNo: Integer; var Misspelled: Boolean);
(*******************************************************************************
*******************************************************************************)
begin
misspelled:=false;
//due to a bug in RVE (1.9.24), it's not allowed to use combobox.itemindex !!
if (Spell_language<=0) or not(Speller_available) then exit;
if spellchecker_ignorelist.IndexOf(Aword)>=0 then exit;
misspelled:=not(spellchecker1.IsKnownWord(Aword,Spellchecker1.Language));
end;
Different spell checker
The event is the same, but my EDDSpell does not seem to have the same calls that you are making in yours.
Not to be presumptive, but if there are problems with 2 different spell modules, I think we can assume a bug in the RV code or in the Delphi generated code using it.
I don't want to count that out, mainly because this seemed to work in Delphi 5.
jamie
Not to be presumptive, but if there are problems with 2 different spell modules, I think we can assume a bug in the RV code or in the Delphi generated code using it.
I don't want to count that out, mainly because this seemed to work in Delphi 5.
jamie
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
dlgSpell.OpenDictionary
You got it. I was not opening it; tracing down the code, the rest of the spelling code worked because it automagically checked for the dictionary being opened and then opened it when it wasn't. Looking back at my old code, I did open it there.
Thanks so much.
jamie
Thanks so much.
jamie