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 » Language Switching. Resource Loading. Collapse All
Subject Author Date
Eugene Wineblat Aug 23, 2006 - 9:08 AM

I have copied many thing from the your sample "Language Switcher" and make the same in my project. But in my project I should save state of application and Language too.
All language corresponding resources like (tooltips, dialogs, toolbars, menubar....) I load from resource DLLs (one for each language).
All resources switching correct, but I have problem when I close my application and load again. ?¬enubars and toolbars loading (I think from registry) in last-used-language... other from local project resources.

How I can load in CMainFrameOnCreate () all my resources in last-used-language (from DLL)?
P.S. if I should have next sequence of actions in this function:
1. Create all prof-uis components
2. EnableDocking
3. EnableCustomization
4. CustomizeStateLoad
5. ProfileBarStateLoad
Or may be something wrong in order of actions...

Suhai Gyorgy Aug 24, 2006 - 3:59 AM

When customization is used, the Menubar and toolbar strings are taken from the customization system and not from resource. After removing customization subsystem from your project, you will have to save the last-used language ID yourself to the registry and at next startup, load it yourself. Prof_UIS has nothing to do with that anymore (without customization).

So in your OnCreate (somewhere at the end) you will have to use ::RegQueryValueEx method to get saved value from registry and call the methods that you usually call when changing language DLLs runtime.

And in your DestroyWindow you will have to call ::RegCreateKeyEx method to save current value to registry.

Chris

Technical Support Aug 24, 2006 - 8:27 AM

You should load and apply the desired language identifier before the step Create all prof-uis components. This should be done by invoking

g_ResourceManager->AllowCustomLang( true );
g_ResourceManager->SetLangIdDesired( . . . );
Of course, the appropriate language module should also be available in scope of the running process. This will allow Prof-UIS to load and use resources of the preferred language.