Click to See Complete Forum and Search --> : Changing resources
eric33
May 5th, 1999, 08:13 AM
I have to implement multi language program.
My idea is to have several resources files with each resource duplicated with the same id (one for each language).
But how could I dynamically change the used resources file in my program ?
Paul McKenzie
May 5th, 1999, 10:28 AM
Check out LoadLibrary(), FreeLibrary()
Regards,
Paul McKenzie
I have found success by creating resource only DLLs, one for each language to be supported.
In the "static" case, load the appropriate resource DLL in your apps InitInstance method. The code would look something like:
m_hResDLL = LoadLibrary( "LanguageResource.DLL" );
AfxSetResourceHandle( m_hResDLL );
In the "dynamic" case, you could add a menu to allow the user to select the language and free the previous resource DLL and load a new one. I have never done this, so I don't know if there are any problems forcing everything to be repainted in the new language.
- Rich Bietz
eric33
May 5th, 1999, 11:47 AM
Ok fine. The solution seems to be the correct one.
But could you shortly explain how to develop a resources DLL (just the main steps to make and build one using mfc) ?
Thansk for all.
eric33
May 5th, 1999, 11:48 AM
Ok fine. The solution seems to be the correct one.
But could you shortly explain how to develop a resources DLL (just the main steps to make and build one using mfc) ?
Thansk for all.
Paul McKenzie
May 5th, 1999, 05:13 PM
Create an empty DLL project and just edit the resources by adding your strings. Make sure that the ID's you give the strings match the ID's in your other resource DLL's. Then build the DLL, and you should be Ok.
The VC on-line help has more info on how to do this.
Regards,
Paul McKenzie
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.