How to call Spellcheck dll function in C# can be called in Clarion?

   C# code :
   using Sentry;
   private uint RTB1Options = (uint)SpellingCheckerEngine.backgroundOptions.MARK_COLOR;
    private System.Drawing.Color RTB1MarkColor = System.Drawing.Color.Red;

    private uint RTB2Options = (uint)SpellingCheckerEngine.backgroundOptions.MARK_STRIKETHROUGH;
    private System.Drawing.Color RTB2MarkColor = System.Drawing.Color.Transparent;
    private void ClickSpaceKey(IntPtr Handle)
    {
      //Handle=> textbox handle
      MessageBox.Show("came here for spellcheck");
       SpellingCheckerEngine.CheckCtrlBackgroundNotify(Handle,RTB1Options, RTB1MarkColor);	
    }

How to call this in clarion and how textbox can be passed as parameter in Calrion?
Anyone please help?

I don’t know about calling c# but there are other spell checkers available for clarion. Including the free hunspell one

You can use C# functions in Clarion by using UnmanagedExports (https://sites.google.com/site/robertgiesecke/Home/uploads/unmanagedexports). After exporting with UnmanagedExports, the exported functions can be used like a C function would be used from Clarion.

It might be possible to even use the textbox handle as a parameter, though Clarion uses its own window components so I have my doubts. But for sure you can make a C# function that takes a CSTRING pointer or BSTRING pointer from Clarion and changes the content of the string. For example embedding the call to the Accepted-event of the Clarion-textbox and passing the use-variable of the textbox you can change the content of use-variable and then call DISPLAY() to show the changed value in textbox.

1 Like

It looks like a WinterTree call. We have Clarion wrapper for this spellchecker
http://klarisoft.com/KSNews_137.htm

This url you mentioned shows a dialogbox but we want as you type spellcheck.

You don’t have many options with “as you type” spell check for the standard Clarion TEXT control. It doesn’t support multiple colors for the text. You can either use RTF control and change color of the misspelled text or TX Text Control which supports wiggly line under misspelled word. We have wrapper for the dll version of the spellchecker with support for the BackgroundNotify messaging

HI Ichudakov, thanks for the input. I had to show suggested words while right click. I used one function of spellchecked like SSCE_CheckCtrlBackgroundMenu but th eproblem is I am passing the x and y coordinates using MOUSEX() AND MOUSEY(), but the cursor goes back to some other word and showing the suggested words. Is it issuw with spellchecker dll or Clarion?

back# = SSCE_CheckCtrlBackgroundMenu( hRED,MOUSEX(), MOUSEY(),1, COLOR:black )

try
0{PROP:Pixels} = TRUE
back# = SSCE_CheckCtrlBackgroundMenu( hRED,MOUSEX(), MOUSEY(),1, COLOR:black )
0{PROP:Pixels} = FALSE