• Advertisement
Sign in to follow this  

run time resource loading

This topic is 4708 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i currently have a few tools developed as dialog based apps in MFC. The tools are all currently displaying in english, meaning the save/load buttons are in english, the title bar is in english etc... The problem is that i need to be able to swap between an english version of the tool and an arabic one. I need to have all the text in the tool written in both arabic and english. I have been trying to do it by editing the .rc file but i'm not sure how i can unload and then reload a new .rc file at run time. Is there a way to do this, or is there a C style solution that i can implement into the .rc file? i tried using a #if #else #endif block but wasn't having any luck...any help would really be appreciated.

Share this post


Link to post
Share on other sites
Advertisement
Have a look into Windows application string tables. I don't think you can switch from rc-files because those will be compiled into your exe. However, you can switch between different string tables and have one English and one Arabic table.

Greetz

Illco

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Move your resources into a seperate project (you'll need one for each locale), and build them as seperate dlls.

In your top level Frame use AfxSetResourceHandle(xxxxxx.DLL) to load the resources you require (i.e. resource_arabic.dll, or resource_english.dll).

Note that you cannot do this dynamically as the top frame needs to be reloaded, but it will allow you to have many locales set up and have the user select the language, rather than have many language specific builds/apps.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement