XLL+ Class Library (6.3)

::ResFindLanguageForResource

Searches a resource file for a resource whose language best matches the language requested

LANGID ResFindLanguageForResource(
   HINSTANCE hinst,
   LPTSTR lpszType,
   LPTSTR lpszName,
   LANGID langidUser
);

Parameters

hinst

Module handle of a resource file.

lpszType

Resource type string, e.g. RT_STRING.

lpszName

Resource name. This may be constructed from an integer ID using the MAKEINTRESOURCE(...) macro.

langidUser

The language ID of the desired language. This can be formed using the MAKELANGID(...) macro, or found using LANGIDFROMLCID(GetThreadLocale()).

Return Value

The language ID of a particular resource in a language which best matches the language requested, if found. If no such resource is found, then the next best matching language ID is returned. If no match is found, then MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL) is returned.

Remarks

This function iterates through all the resources, of the specified type and name, in the resource file until it finds a resource in a language exactly matching langidUser. If no exact match is found then the first partial match (same language but a different sub-language) is returned.

This function is used by XllLoadString() and ResLoadString() to locate language-specific resources.

Requirements

Header: xllres.h

See Also

Global resource functions