Spellex Windows SDK Technical Support

Causes of return code -13

Problem: Some functions in the Spellex API return -13 (SSCE_UNSUPPORTED_ACTION_ERR). This document describes some of the reasons for this return code.

Discussion

When a function in the Spellex API returns -13 (SSCE_UNSUPPORTED_ACTION_ERR), check the following:

  • Make sure your application calls SSCE_SetKey before any other Spellex functions (not just the one that returned -13). SSCE_SetKey should be the first Spellex function called by your application.

  • Make sure the license key you pass to SSCE_SetKey is valid:

  • If you are evaluating the Spellex Windows SDK, your license key may have expired.

  • The license key is provided as a hexadecimal constant. When you use hexadecimal constants, you must encode them correctly for the programming language you are using:

    • C, C++, and C#: Prefix with "0x", as in 0xABCD1234

    • Visual Basic and VB.NET: Prefix with "&H", as in &HABCD1234

      Delphi: Prefix with "$", as in $ABCD1234

  • If a SSCE_xxxDlgTmplt function (e.g., SSCE_CheckCtrlDlgTmplt) returns -13, the problem may be caused by your dialog box template or the instance handle you pass to the function. The Spellex DLL calls the DialogBox function in the Windows API to display the dialog using the template you pass. If DialogBox returns -1, the SSCE_xxxDlgTmplt function will return -13. One common cause of DialogBox failure is passing the dialog template's numeric resource id rather than the template name. Dialog templates can be referenced using a name (string) or a number. When they are referenced using numbers, typically a preprocessor symbol such as IDD_MYDIALOG is assigned by the resource editor. Passing "IDD_MYDIALOG" as the template-name parameter to SSCE_xxxDlgTmplt will fail, because there is no dialog template named "IDD_MYDIALOG"; rather, there is a dialog template with a number assigned to it, such as 123, and the resource editor creates an include file which maps IDD_MYDIALOG to 123. The solution is to assign names to your dialog templates which are passed to SSCE_xxxDlgTmplt functions. This is usually done in resource editors by surrounding the resource id with quotation marks: "MYDIALOG".

  • Other situations in which the Spellex DLL will return -13:

    • Calling SSCE_CompressLexEnd or SSCE_CompressLexFile without having called SSCE_CompressLexInit first;


    • Passing an unrecognized character set id to SSCE_SetCharSet;


    • Passing an action code other than SSCE_IGNORE_ACTION to SSCE_AddToLex when the lexicon being modified was not created by the Spellex engine;


    • Attempting to open a compressed lexicon containing Unicode characters (i.e., a lexicon compressed using the Unicode spelling engine);


    • Calling SSCE_CheckCtrlBackground on a control which is not a rich edit control or the type of which cannot be determined;


    • Calling SSCE_AddToLex, SSCE_DelFromLex, SSCE_ClearLex, SSCE_GetLex, or SSCE_SyncLex on a compressed lexicon.

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

Spellex Corporation © 2008. All rights reserved