NumXL SDK - Locality resources API
Configurations

SFMSG initialization , shutdown and configuration APIs. More...

Functions

int __stdcall SFMSG_Reset (unsigned int uClientToken, DWORD lcid)
 Reset the locality language, and free resources.
 
int __stdcall SFMSG_LCID (LPDWORD plcid)
 returns the LCID of the currently selected language.
 
int __stdcall SFMSG_LCID_SUPPORTED (DWORD lcid, LPBOOL pbExist)
 Examine the installation directory for the support of the LCID (or it neutral version)
 
int __stdcall SFMSG_NEUTRAL_LCID (LPDWORD pSupportedLCID)
 convert from language+culture LCID to language culture-neutral LCID
 
int __stdcall SFMSG_LCID_PATH (DWORD lcid, LPWSTR szPath, size_t *pSize)
 Lookup and retrieve a the filepath used in our locality system.
 

Initialzation/Shutdown APIs

int __stdcall SFMSG_Init (LPCWSTR szDllName, LPCWSTR szResDir, DWORD lcid, unsigned int *pClientToken)
 Initialize the locality system.
 
int __stdcall SFMSG_Shutdown (unsigned int uClientToken)
 shutdown the locality system, and free resources.
 

Detailed Description

The functions here setup the locality library to locate the proper resources.

Function Documentation

◆ SFMSG_Init()

int __stdcall SFMSG_Init ( LPCWSTR szDllName,
LPCWSTR szResDir,
DWORD lcid,
unsigned int * pClientToken )

initialize the SFMSG Library

Parameters
[in]szDllName(Required) the resource dll base file name (e.g., spiderxl)
[in]szResDir(Required) the location of the resources dll
[in]lcid(Required) MS Locality ID
[out]pClientToken(Required) a pointer to an integer variable to hold the returned token value (needed later for the locality system shutdown)
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_SKIP_INITsuccess (see remarks)
NDK_INVALID_ARGfailed (see remarks)
NDK_INVALID_VALUEfailed (see remarks)
NDK_DATAPATH_INVALIDfailed (see remarks)
NDK_INVALID_LCIDfailed (see remarks)
NDK_UNSUPPORTED_LCIDfailed (see remarks)
NDK_FAILEDfailed (see remarks)
Remarks
  1. If the locality module has already been initialized, the function will immediately skip, and return NDK_SKIP_INIT as return code.
Requirements
Requirement Value
Target Platform Windows
Header SFMSG.h (include Windows.h)
Library SFMSG.lib
DLL SFMSG.dll SFLOG.dll
See also
Examples
msg_init.cpp.

◆ SFMSG_LCID()

int __stdcall SFMSG_LCID ( LPDWORD plcid)

query the current LCID

Parameters
[out]plcid(Required) is MS Locality ID.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_UNINITIALIZEDfailed (see remarks)
NDK_INVALID_ARGfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. If the license module has not been initialized, the function will fail and return NDK_UNINITIALIZED as the return code.
Snippet
// Example 1: get the LCID
LCID dwDefLCId = 0;
nRet = SFMSG_LCID(&dwDefLCId);
Requirements
Requirement Value
Target Platform Windows
Header SFMSG.h (include Windows.h)
Library SFMSG.lib
DLL SFMSG.dll SFLOG.dll
See also
SFMSG_Init
Examples
msg_init.cpp.

◆ SFMSG_LCID_PATH()

int __stdcall SFMSG_LCID_PATH ( DWORD lcid,
LPWSTR szPath,
size_t * pSize )

Return the full path of the locale resources folder on user's filesystem

Parameters
[in]lcid(Required) is MS Locality ID
[out]szPath(Optional) is address to a buffer to hold the path.
[in,out]pSize(Required) is the size of the szPath, and upon return, holds the number of actual size of the path.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_UNINITIALIZEDfailed (see remarks)
NDK_INVALID_ARGfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. If the license module has not been initialized, the function will fail and return NDK_UNINITIALIZED as the return code.
Snippet
// get the full path of the resource directory
std::wstring szPath;
size_t nLen = 0;
nRet = SFMSG_LCID_PATH(dwlcid, NULL, &nLen);
if(nRet == NDK_SUCCESS){
nLen++;
std::vector<TCHAR> szTmp(nLen, TCHAR(0));
nRet = SFMSG_LCID_PATH(dwlcid, &szTmp[0], &nLen);
szPath = &szTmp[0];
}
std::wcout << L" SUCCESS - locality resource path: " << szPath << std::endl;
Requirements
Requirement Value
Target Platform Windows
Header SFMSG.h (include Windows.h)
Library SFMSG.lib
DLL SFMSG.dll SFLOG.dll
See also
Examples
msg_init.cpp.

◆ SFMSG_LCID_SUPPORTED()

int __stdcall SFMSG_LCID_SUPPORTED ( DWORD lcid,
LPBOOL pbExist )

examine whether the given LCID is installed

Parameters
[in]lcid(Required) is MS Locality ID
[out]pbExist(Required) is a pointer to a BOOLEAN flag to return the status of locality presence in the locality folder.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_UNINITIALIZEDfailed (see remarks)
NDK_INVALID_LCIDfailed (see remarks)
NDK_INVALID_ARGfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. If the license module has not been initialized, the function will fail and return NDK_UNINITIALIZED as the return code.
Requirements
Requirement Value
Target Platform Windows
Header SFMSG.h (include Windows.h)
Library SFMSG.lib
DLL SFMSG.dll SFLOG.dll
See also

◆ SFMSG_NEUTRAL_LCID()

int __stdcall SFMSG_NEUTRAL_LCID ( LPDWORD pSupportedLCID)

convert the given LCID to neutral LCID (no sub-language or sort order)

Parameters
[in,out]pSupportedLCID(Required) is a pointer to a LCID holding the input and the return value.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The operation of this function does not rely on the initialization of the locality module.
Requirements
Requirement Value
Target Platform Windows
Header SFMSG.h (include Windows.h)
Library SFMSG.lib
DLL SFMSG.dll SFLOG.dll
See also

◆ SFMSG_Reset()

int __stdcall SFMSG_Reset ( unsigned int uClientToken,
DWORD lcid )

Switch the language library to a different one

Parameters
[in]uClientToken(Required) Is the locality system token id (acquired during initialization).
[in]lcid(Required) is the new MS Locality ID
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_UNINITIALIZEDfailed (see remarks)
NDK_INVALID_TOKENfailed (see remarks)
NDK_INVALID_LCIDfailed (see remarks)
NDK_UNSUPPORTED_LCIDfailed (see remarks)
NDK_FAILEDfailed (see remarks)
Remarks
  1. If the license module has not been initialized, the function will fail and return NDK_UNINITIALIZED as the return code.
  2. If the value of uClientToken argument is invalid, the function will fail and return NDK_INVALID_TOKEN as a return code.
  3. If the value of lcid is zero(0), the function will revert to its default value of 1033 (en-US).
  4. If the value of lcid is not zero, but does not correspond to valid locality, the function will fail and return NDK_INVALID_LCID as a return code.
  5. If the value of lcid corresponds to a valid locality, but the installation does not have this locality, then the function will fail and return NDK_UNSUPPORTED_LCID as a return code.
Requirements
Requirement Value
Target Platform Windows
Header SFMSG.h (include Windows.h)
Library SFMSG.lib
DLL SFMSG.dll SFLOG.dll
See also

◆ SFMSG_Shutdown()

int __stdcall SFMSG_Shutdown ( unsigned int uClientToken)

Shutdown and cleanup any resources used by the SFMSG Library

Parameters
[in]uClientToken(Required) the locality system token id (acquired during initialization).
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_UNINITIALIZEDfailed (see remarks)
NDK_INVALID_TOKENfailed (see remarks)
NDK_FAILEDfailed (see remarks)
Remarks
  1. If the license module has not been initialized, the function will fail and return NDK_UNINITIALIZED as the return code.
  2. If the value of uClientToken argument is invalid, the function will fail and return NDK_INVALID_TOKEN as a return code.
Requirements
Requirement Value
Target Platform Windows
Header SFMSG.h (include Windows.h)
Library SFMSG.lib
DLL SFMSG.dll SFLOG.dll
See also
Examples
msg_init.cpp.