Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Any instructions on realizing language with dialog based system? Collapse All
Subject Author Date
Bangjun Lei Oct 14, 2007 - 5:40 AM

Dear Sir./Madam.,

I’m building a dialog-based application with menu support. But I couldn’t find any information on how to add language switch support to it. The LanguageSwitch sample you provided is working with frame-based system and is a bit complicate to read.

Thank you very much!

Technical Support Oct 15, 2007 - 1:49 PM

In Prof-UIS there is a CExtResourceManager class (that is accessible via the g_ResourceManager global smart pointer variable) and this class is used for loading resources of any type instead using Win32 APIs and methods of MFC classes. This makes possible to specify the preferred language identifier for loading resources using the following code:

g_ResourceManager->AllowCustomLang( true );
g_ResourceManager->SetLangIdDesired( nLangID );
with nLangID set to one of the __EXT_MFC_LANG_ID_*** constants defined in the ../Prof-UIS/Include/ExtCmdManager.h file. After invoking the code lines above, all the resource loading invocations will be searching for and loading the resources of the specified language. That means you should re-initialize the entire UI in your application: re-load toolbars, menus, cached string variables and re-create dialogs. To re-create dialogs is essential because dialog template resources can be different for different languages.