L_DocGetSelectedLanguages

#include "ltdoc.h"

L_INT EXT_FUNCTION L_DocGetSelectedLanguages(hDoc, ppLangIds, pnLangCount)

L_HDOC hDoc;

/* handle to the OCR document */

LANGIDS ** ppLangIds;

/* pointer to an array to be updated */

L_INT L_FAR * pnLangCount;

/* pointer to a variable to be updated */

Gets the current selected languages.

Parameter

Description

hDoc

Handle to the OCR document.

ppLangIds

Pointer to a LANGIDS array to be filled with the current selected languages.

pnLangCount

Pointer to an integer to be updated with the number of selected languages in ppLangIds.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Retrieves the current language selection.

To activate recognized languages, call L_DocSelectLanguages function.

This function will allocate memory for ppLangIds. To free the ppLangIds parameter, call L_DocFreeLanguages.

To get the character options for the current activated languages, call L_DocGetCharLangsOptions.

To set the character options for the current activated languages, call L_DocSetCharLangsOptions.

Required DLLs and Libraries

LTDOC

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_DocSelectLanguages, L_DocFreeLanguages, L_DocSetCharLangsOptions, L_DocGetCharLangsOptions, L_DocIsCharEnabled, L_DocGetDefaultSpellLanguages

Topics:

OCR Functions: Languages

 

Working with Languages

Example

void TestGetLangs(L_HDOC hDoc)
{
   LANGIDS * pLangIds = NULL;
   L_INT nLangCount = 0;

   L_INT nRet = L_DocGetSelectedLanguages(hDoc, &pLangIds, &nLangCount);
   if (nRet != SUCCESS)
      return;

   for (L_INT i=0; i<nLangCount; i++)
   {
      if (pLangIds[i] == LANG_ID_ENGLISH)
         MessageBox(NULL, TEXT("English is the active language."), TEXT("Notice!"), MB_OK);
   }

   L_DocFreeLanguages (hDoc, &pLangIds);

   if (L_DocIsCharEnabled(hDoc, L'a') == TRUE)
      MessageBox(NULL, TEXT("The specified character is available in the selected languages."), TEXT("Notice!"), MB_OK);
   else
      MessageBox(NULL, TEXT("The specified character is not available in the selected languages."), TEXT("Notice!"), MB_OK);
}