Spellex Windows SDK Technical Support

Using an INI file with Spellex DLL

Description: This document describes and clarifies use of an INI file with the Spellex Windows DLL.

By default, the 32-bit Spellex DLL (ssce5x32.dll) reads and writes its settings in the system registry. "Settings" include the names of dictionary files to open and options to enable. The Spellex programmer's guide generally refers to settings as "properties." Although it uses the system registry by default, the Spellex DLL will read and write its settings from an INI file instead if your application calls SSCE_SetIniFile.

The call to SSCE_SetIniFile should occur before any other SSCE_* calls, except the call to SSCE_SetKey (in other words, call SSCE_SetKey first, then SSCE_SetIniFile). Calling SSCE_SetIniFile tells the Spellex DLL two things:

  1. It should read and write its settings from/to an INI file instead of the system registry;

  2. The name of the INI file to access its settings from.

If the name of the INI file you pass to SSCE_SetIniFile contains no path (e.g., SSCE_SetIniFile("ssce.ini")), the Spellex DLL will search for the INI file as described in the programmer's guide under "How the Spellex DLL locates the INI file" in the "Using the Spellex Windows SDK chapter. Sometimes this causes problems, however:

  1. If the INI file is not located in one of the places the Spellex DLL (or Windows) searches, it will not be found.

  2. If another INI file of the same name is found first, that INI file will be used with potentially unexpected results.

Both of these situations can result in confusing and difficult-to-diagnose problems, such as failure to open dictionary (lexicon) files. Consequently, we recommend that you pass a full path to the INI file like this:

SSCE_SetIniFile("c:\Program Files\myapp\mysettings.ini")

The INI file doesn't have to be called ssce.ini. In fact, you can store Spellex settings in the same INI file used to store your application's settings. The Spellex DLL (version 5.11 and later) reads and writes settings in the [SSCE User] section of the INI file file (versions 5.10 and earlier access settings in the [SSCE] section). Here's an example INI file which shows Spellex settings coexisting with other application settings:

[Graphics]
bgcolor=ffc0ff
image=c:\myapp\images\pattern.bmp

[Music]
introsong=c:\myapp\mp3\intro.mp3

[SSCE User]
MainLexPath=c:\myapp\spelling\
MainLexFiles=ssceam.tlx,ssceam2.clx
UserLexPath=c:\myapp\users\tim
UserLexFiles=userdic.tlx,birds.tlx

Home | Order Now | Products | Upgrades | Free Trial | Partners | About Spellex | Contact Us | Site Map | Privacy Policy

Spellex Corporation © 2008. All rights reserved