XLL+ Class Library (6.3)

::ResLoadString

Gets a string from a resource file using a preferred language

BOOL ResLoadString(
   HINSTANCE hinst,
   UINT uStringID,
   LANGID langid,
   CString& res
);
BOOL ResLoadString(
   HINSTANCE hinst,
   UINT uStringID,
   CString& res
);

Parameters

hinst

Module handle of a resource file.

uStringID

Numeric resource string identifier.

langid

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

res

If the function succeeds, the string will be loaded into this variable.

hinst
uStringID
res

Return Value

TRUE if the function succeeds, FALSE if it fails. It will fail if the resource file handle is invalid, or if the resource cannot be found.

Remarks

This function looks for a resource string in a specified language and sub-language. If an exact match cannot be found, then the first resource with a matching language (but not matching sub-language) is loaded. If no such match can be found, then the language neutral resource is loaded.

The second variant uses the user's current setting (from GetThreadLocale()) to create a language ID.

Requirements

Header: xllres.h

See Also

Global resource functions