Alaska Software Inc. - Textcontrol and spell checker
Username: Password:
AuthorTopic: Textcontrol and spell checker
R.M. MeijerTextcontrol and spell checker
on Thu, 12 Jan 2017 13:47:56 +0100
Hi,

We use TextControl (ActiveX) for several years now and want to add spell 
checking to it.

According to the information I found there are several ways to do this:

1. Use txSpell.NET through an ActiveX wrapper (source on gitHub, can be 
compiled with Visual Studio to an ActiveX component)
2. Use any third party spell checker component and integrate this with 
textControl

I managed to compile the wrapper object (AxTXSpell.AxTXSpellChecker), 
use this object in code and call the "check" method. So far so good.

Now my problem: how to integrate this with the textControl component?

The suggested solution (for Visual Basic) is to handle the event 
"SpellCheckText", check the spelling with the used Spell checking 
component and return a value for the parameter "MisspelledWordPositions" 
(array of long values with positions of misspelled words).

Sample Visual Basic code:

[Visual Basic]
Private Sub TXTextControl1_SpellCheckText(ByVal Text As String, MisspelledWordPositions As Variant)
     TXSpell1.Check (Text)
     MisspelledWordPositions = TXSpell1.MisspelledWordPositions
End Sub

My implementation looks like this:

METHOD OwnActiveX:SpellCheckText(cText, aMisspelledWordPositions)
   ::oSpell:Check(cText)
   aMisspelledWordPositions := ::oSpell:MisspelledWordPositions
RETURN aMisspelledWordPositions

Unfortunately this approach does not work.

::oSpell:MisspelledWordPositions does contain an Array of misspelled 
word positions, but assigning this value to parameter
aMisspelledWordPositions has no effect at all.

The problem seems to be that there is no way to return a value (by 
reference) for this second parameter in Xbase++?

1. Does anyone know a solution or workaround for this problem?
2. Does anyone have a working spell checker integrated with TextControl?


With kind regards,
Rens Zwanenburg
rens[at]rmdata[dot]com