L
lujun
Unregistered / Unconfirmed
GUEST, unregistred user!
关于多语言的问题:程序中使用了DevExpress Bar这样的第三方控件,使用BCB自带的Langrague Trans功能进行Update Resource Dlls处理,警告说错误!(200分)<br /> 按照教父的指点,找到BCB5里面的一个关于RichEdit的多语言例子。根据这个例子
进行了相应的更改,但发现有题目中的问题。打开相应文件夹,如/ENU下的dfm文件,
发现出错的form文件被改名为xxx.ERR_dfm,打开到错误处,发现大段语法错。直接把
原始的dfm复制进去,可以编译通过,但运行时出错,说“Ancester for 'xxx' not
found”。不得要领。怎么办???
在BCB5的帮助中找到下列有关的说明:
In addition to locating a resource DLL at application startup,
it is possible to switch resource DLLs dynamically at runtime. To
add this functionality to your own applications, you need to
include the ReInit unit in your project.(ReInit is located in the
Richedit sample in the Examples directory.)
To switch languages, you should call LoadResourceModule, passing
the LCID for the new language, and then
call ReinitializeForms.
For example, the following code switches the interface language
to French:
const FRENCH = (SUBLANG_FRENCH << 10) | LANG_FRENCH;
if (LoadNewResourceModule(FRENCH))
ReinitializeForms();
The advantage of this technique is that the current instance of
the application and all of its forms are used. It is not necessary
to update the registry settings and restart the application or re-acquire
resources required by the application, such as logging in to database
servers.
When you switch resource DLLs the properties specified in the new
DLL overwrite the properties in the running instances of the forms.
Note: Any changes made to the form properties at runtime will be
lost. Once the new DLL is loaded, default values are not reset. Avoid
code that assumes that the form objects are reinitialized to the their
startup state, apart from differences due to localization.
进行了相应的更改,但发现有题目中的问题。打开相应文件夹,如/ENU下的dfm文件,
发现出错的form文件被改名为xxx.ERR_dfm,打开到错误处,发现大段语法错。直接把
原始的dfm复制进去,可以编译通过,但运行时出错,说“Ancester for 'xxx' not
found”。不得要领。怎么办???
在BCB5的帮助中找到下列有关的说明:
In addition to locating a resource DLL at application startup,
it is possible to switch resource DLLs dynamically at runtime. To
add this functionality to your own applications, you need to
include the ReInit unit in your project.(ReInit is located in the
Richedit sample in the Examples directory.)
To switch languages, you should call LoadResourceModule, passing
the LCID for the new language, and then
call ReinitializeForms.
For example, the following code switches the interface language
to French:
const FRENCH = (SUBLANG_FRENCH << 10) | LANG_FRENCH;
if (LoadNewResourceModule(FRENCH))
ReinitializeForms();
The advantage of this technique is that the current instance of
the application and all of its forms are used. It is not necessary
to update the registry settings and restart the application or re-acquire
resources required by the application, such as logging in to database
servers.
When you switch resource DLLs the properties specified in the new
DLL overwrite the properties in the running instances of the forms.
Note: Any changes made to the form properties at runtime will be
lost. Once the new DLL is loaded, default values are not reset. Avoid
code that assumes that the form objects are reinitialized to the their
startup state, apart from differences due to localization.