LoadResourceModule Function
Delphi automatically calls LoadResourceModule
to
load a language-specific DLL for an application. If no such DLL is
found, the function returns zero; otherwise, it loads the DLL as a
data file and returns the DLL’s instance
handle.
When Delphi loads a module (application, DLL, or package), it
automatically calls LoadResourceModule
to look for
a DLL whose name is the same as the module name, but with an
extension that specifies a locale.
LoadResourceModule
looks for the locale extension
in three places. At each step, it tries to load the locale-specific
DLL, and if it fails, it tries the next step in the sequence:
First, it checks the registry. It looks for the application’s full pathname under two registry keys:
HKEY_CURRENT_USERSoftwareBorlandDelphiLocales
HKEY_CURRENT_USERSoftwareBorlandLocales
If the application has an entry under either key, the value of that entry is the locale extension. If the application does not have an entry, but the key has a default value, the default value is the locale extension.
Next, it looks for a DLL whose extension is the local language and country code.
Finally, it looks for a DLL whose extension is just a language code.
If LoadResourceModule
finds a DLL with the locale
extension, it loads the DLL and returns the resource DLL’s
instance handle. It also saves the instance handle so
FindResourceHInstance
will look for resources in
the localized DLL.
LoadResourceModule
is a real function.