Sentry Spelling Checker Engine - Support |
Home Site index Contact us Catalog Shopping Cart Products Support Search |
You are here: Home > Support > Sentry Spelling Checker Engine > Differences between Core API and Windows API
Product: Sentry Spelling Checker Engine Windows SDK, all versions
The Sentry DLL contains two API "layers:" The "Core API," which contains no user-interface and is independent of any particular operating system, and the "Windows API," which is specific to Microsoft Windows. Distinctions between the two APIs is a frequent source of confusion.
If you program entirely at the Core API level, your application must take responsibility for opening a session (via SSCE_OpenSession), opening lexicons (via SSCE_OpenLex), and setting any required options (via SSCE_SetOption). Because the Core API is platform-independent, it does not read from the system registry or INI file (both of which are Windows specific).
To make integration easier for Windows developers, the Sentry DLL can automatically perform some of the basic API "housekeeping" tasks. The DLL will automatically open a session, read the system registry (or an INI file if so directed) to determine which lexicons to open and which options to set, then open those lexicons and set those options. This is described in the Sentry Programmer's guide section titled "About the Sentry DLL in the Windows environment." Because this housekeeping work is done automatically, an application can call any function in the Sentry Windows API (such as SSCE_CheckCtrlDlg) without having to perform any initialization.
An application which needs to use the Core API can take advantage of automatic housekeeping done by the Sentry DLL by using the SSCE_GetSid function. SSCE_GetSid returns the session id of the session automatically opened by the Sentry DLL. This session will have open lexicons and option settings according to the properties defined in the system registry (or INI file). This is described in the Sentry Programmer's guide section titled "How to call the Sentry APIs."
If your application calls SSCE_OpenSession itself, the opened session will initially have no lexicons open and only the default options set. You would have to call SSCE_OpenLex and SSCE_SetOption to open lexicons and set options.
If your application calls SSCE_OpenSession, it should call SSCE_CloseSession before terminating.
Your application should not call SSCE_CloseSession to close the session id returned by SSCE_GetSid. The Sentry DLL will automatically close the session when your application terminates.
See also: Do I need to call SSCE_OpenSession?
Copyright © 2015 Wintertree Software Inc.