473,748 Members | 2,540 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to change the interface language using resource.rc?


Hi, at first time I want to apologize for my English.

I need to change the language of my app and I like to do it changin
the caption of the controls in the resource.rc file, or having on
resource.rc file for each language, but then I need to use resource.r
file in the execution and not in the compile time, can I do it? How ca
I do it?.

Thank you
-
Kawor
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
-----------------------------------------------------------------------

Nov 17 '05 #1
1 3175
> Hi, at first time I want to apologize for my English.
No need to :-)
I need to change the language of my app and I like to do it changing
the caption of the controls in the resource.rc file, or having one
resource.rc file for each language, but then I need to use resource.rc
file in the execution and not in the compile time, can I do it? How can
I do it?.

You do not use the .rc at runtime, you use the resources compiled in a DLL.

How to to it:

1. Create a resource only dll (a DLL with no code)
1.1 Compile your .RC file using rc.exe. You will get a .res file
1.2 Link you .res in a dll uing link /dll /noentry

2. In the application, load the resources from the external DLL
2.1 Load the dll using LoadLibraryEx with the LOAD_LIBRARY_AS _DATAFILE flag.
You have to do this before you create the first window or load the first
string, or image, or whatever.
2.2 Save somewhere the library's HMODULE and use it for any resource
All API using resources ask for a hInstance. Use the hLibModule.
If you use MFC, call AfxSetResourceH andle( hLibModule )

A good way to store your localized files is to have a folder for all
languages (MS calls it MUI) and subfolders for each language
(MS uses the LCID as decimal or hex).
There you can put your localized .dll, help, readme, templates, etc.

Example:
<Program Files>
<Company>
<Product
<MUI>
<409>
MainApp.dll
MainApp.chm
<Templates>
SomeTemplate.x
AnotherTemplate .x
MoreTemplates.x
<411>
MainApp.dll
MainApp.chm
<Templates>
SomeTemplate.x
AnotherTemplate .x
MoreTemplates.x
<40C>
MainApp.dll
MainApp.chm
<Templates>
SomeTemplate.x
AnotherTemplate .x
MoreTemplates.x
Important: consider English to be just another language.
This way the code does not need to be different for English,
you can allways use <ApplicationPat h>/MUI/<langCode>/... to
access your files.

--
Mihai Nita [Microsoft MVP, Windows - SDK]
------------------------------------------
Replace _year_ with _ to get the real email
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2924
by: Bj?rn | last post by:
HY, my problem is the following: I want to give a very big application the ability, to change the language at runtime. It's written in Visual C++ 6.0. All language depending strings and so on, are already stored in different resource-dll's. The way, I understand it, there is a list of resources, which the application goes through, searching for strings. For example my string is in stringa.dll in english. But I want to have
5
1219
by: Steven T. Hatton | last post by:
I'm forking this from a reply to John Nagle in the smart_ptr<> thread. To address some of the problems handled by the runtime environments of C# and Java, it may be necessary to look beyond the C++ Standard. I believe Microsoft post-DOS OSs are capable of detecting a null pointer access, and throwing an exception to the program that attempted it. I've raised this issues on the GCC mailing list (or newsgroup - I don't recall which), and...
4
2635
by: Richard Cornford | last post by:
For the last couple of months I have been trying to get the next round of updates to the FAQ underway and been being thwarted by a heavy workload (the project I am working on has to be finished an QA tested for a new year release. I don't think that going to prove practical, but there is no harm in trying :) and some serious family commitments. But it has to be done soon so this is stage one. Mike Winter provided an extensive list of...
3
12219
by: Xiaopeng Qu | last post by:
Hi, I installed DB2 8.1 Express with multiple language: English and Chinese, but the interface like: Control Center, CLP, etc alway display Chinese, is there a way to change the display language to English? Thanks! Sean
3
4140
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability. The User Experience, or how the user experiences the end product, is the key to acceptance. And that is where User Interface Design enters the design process. While product engineers focus on the technology, usability specialists focus on the user...
21
13843
by: Helge Jensen | last post by:
I've got some data that has Set structure, that is membership, insert and delete is fast (O(1), hashing). I can't find a System.Collections interface that matches the operations naturally offered by Sets. - ICollection cannot decide containment - IList promises indexability by the natural numbers, which is not achievable (since i hash elements, not sort them). - IDictionary is definatly not setlike. Although I can, of course, define...
2
3059
by: Gwl | last post by:
I'm writing an application in which the user can change the default ouput language while the program is running. I have no problem to do it when there is only a form opened, but if I have a situation like a second form opened I don't know how I could change the otuput language in the main form and in all the background forms. Any advice? Thanks, G.
0
306
by: Kaworu | last post by:
Mihai N. wrote: > You do not use the .rc at runtime, you use the resources compiled in > a DLL. > > Hi, DLL system is running ok, thanks, but I'd like that the strings > for language interface where in a txt file, or some file like > resource.rc that I can change automatically with a parser in a second > app. > > If I can change the language by this way, users may change the
3
2958
by: Olivier Verdin | last post by:
Hi, I am developing a multi-language application in ASP.NET in c#. I am using a file field html control to upload an image. I would like to change the text on the button "browse" that comes with the control. I need to change the text to have the correct text for the language chosen.
6
4967
by: Sharon | last post by:
Hi gurus, I have a Form with some controls, some of them are my own. The GUI text is shown in English US. This application is for our customer in Japan that ask to change the application GUI language to Japanese. I have never done such a thing, but I have heard that in .NET/C# over WinXP it relatively simple. Can anyone show me how to change the GUI language?
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8252
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.