by TimStone » Fri Jan 18, 2008 7:16 pm
The following code is used for activating the spell checker from Wintertree:
To check a memofield useing a database object, here is a call:
REDEFINE BUTTON ID 882 of oDcl ACTION( oCli:climpd := SpellOne( oCli:climpd ), oCli:save(), oDcl:update() ) ;
MESSAGE "Check the spelling on the notes"
Here is the code for functions needed in your program:
// Declare include files
#INCLUDE "fivewin.ch"
#define HKEY_LOCAL_MACHINE 2147483650
STATIC hDLL2
FUNCTION Spellone( TxtString )
LOCAL pText := TxtString
LOCAL pTextLen, pNewLen
MEMVAR oWnd
pTextLen := LEN( pText )
pText += SPACE(250)
pNewLen := LEN ( pText )
hDLL2 := LoadLibrary( "SSCE5432.dll" )
SSCE_SetKey( 9999999999 ) // User will get a license code
SSCE_SetRegTreeName( "HKEY_LOCAL_MACHINE\SOFTWARE\Wintertree\SSCE\" )
SSCE_CheckBlockDlg( oWnd, @pText, pTextLen, pNewLen )
FreeLibrary( hDLL2 )
RETURN( pText ) // TxtString )
FUNCTION SetDict // A function to set the path in the registry ... needs a calling button or menu entry
LOCAL oReg, cName, uVar, cDicPath
cDicPath := DiskName( ) + ":\" + TRIM(CurDir( ) ) + "\"
oReg := TReg32():Create( HKEY_LOCAL_MACHINE, "SOFTWARE\Wintertree\SSCE" )
// Call Set with an empty string to access the default key
oReg:Set( "MainLexPath", cDicPath )
oReg:Set( "UserLexPath", cDicPath )
oReg:Set( "MainLexFiles", "ssceam.tlx,ssceam2.clx" )
oReg:Set( "UserLexFiles", "userdic.tlx,correct.tlx,html.tlx" )
MsgStop( "Windows registry updated!" )
oReg:Close()
RETURN NIL
DLL32 FUNCTION SSCE_SetKey( pID AS LONG ) AS LONG PASCAL LIB hDLL2 // "SSCE5432.DLL"
DLL32 FUNCTION SSCE_CheckBlockDlg( pHandle AS LONG, pText AS STRING, pTextLen AS LONG, pNewLen AS LONG ) ;
AS LONG PASCAL LIB hDLL2 // "SSCE5432.DLL"
DLL32 FUNCTION SSCE_SetRegTreeName( pRegName AS STRING ) AS LONG LIB hDLL2 // "SSCE5432.DLL"