L_AnnSetlocale

#include "l_bitmap.h"

L_LTANN_API L_TCHAR * L_AnnSetlocale(nCategory, lpszLocale)

L_INT nCategory;

/* category affected by locale */

const L_TCHAR * lpszLocale;

/* locale name */

Sets the locale for the annotation library.

Parameter

Description

nCategory

Category affected by locale.

lpszLocale

Locale name.  Pass NULL to return the current locale.

Returns

!NULL

A pointer to the string representing the specified locale and category

NULL

Indicates that the category or locale parameter value was invalid

Comments

This function is used under rare circumstances. It is necessary only when running non-unicode applications that must display text that is not part of the ASCII character set (for example, Japanese characters). Non-ASCII text (i.e. a Japanese or Arabic character) can be stored non-ambiguously in unicode. However, for non-unicode applications, the multi-byte representation of such characters depends on the code page. In this case, you must set the code page appropriately. For example, a non-unicode annotation application can display Japanese characters only if the code page is set to a Japanese code page (like Japanese_Japan.932).

Pass NULL for the parameter pszLocale to get the current locale, leaving the current locale unchanged.

Note that in the MAIN C DLL annotation demo, you can change the locale using L_AnnSetlocale. Internally, this function calls Microsoft C DLL setlocale. For details, see the MSDN documentation.

Required DLLs and Libraries

LTANNN

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

Platforms

Windows 2000 / XP/Vista.

See Also

 

L_AnnSetText, L_AnnGetText, L_AnnSetAutoText, L_AnnGetAutoText

Topics:

Annotation Functions: Object Properties

 

Implementing Annotations

 

Implementing an Automated Annotation Program

 

Implementing a Non-automated Annotation Program

 

Altering Annotation Object Settings

 

Annotation Functions: Displaying Annotations

Example

This example shows how to set the locale of the annotation library.

#include <locale.h>
L_TCHAR* DisplayCurrentLocale()
{
   // Display the current locale
   L_TCHAR *pszMsg = L_AnnSetlocale(LC_ALL, NULL);
   if (pszMsg != NULL)
      MessageBox(NULL, pszMsg, TEXT("Current Locale"), MB_OK);
   return pszMsg;
}

 L_INT AnnSetlocaleExample() 
{   
   L_TCHAR *pszOriginalLocale = DisplayCurrentLocale();

   // Set the locale for English/United states
   L_AnnSetlocale(LC_ALL, TEXT("English"));
   DisplayCurrentLocale();


   // Set the locale for Japanese
   L_AnnSetlocale(LC_ALL, TEXT("Japanese"));
   DisplayCurrentLocale();

   // Set the locale for arabic
   L_AnnSetlocale(LC_ALL, TEXT("Arabic"));
   DisplayCurrentLocale();

   // Set to the original locale
   L_AnnSetlocale(LC_ALL, pszOriginalLocale);
   DisplayCurrentLocale();

   return SUCCESS;
}