Article View: borland.public.cppbuilder.internationalization
Article #261Multi language support with RC file
From: Elena
Date: Tue, 12 Oct 2004 09:21
Date: Tue, 12 Oct 2004 09:21
61 lines
2643 bytes
2643 bytes
Hi All,
I am still new to C++ Builder.
I have used Resource DLL Wizard to create an ENU and a JPN folder for my
project. When I run my program, it will automatically translate the captions
on my forms and recognize the language of my system.
However, only the items on the forms are translated. I want the message
shown to be translated also. Below are my steps, unfortunately they do not
work:
1. I add an "str_all.rh" file to my main project folder. The file is:
#ifndef _STR_JPN_RH_
#define _STR_JPN_RH_
#define MY_DLL_STRING1 0x8001
#define MY_DLL_STRING2 0x8002
#endif
2. I add "str_jpn.rc" to my JPN folder and add to the project1.bpr under the
JPN folder. The file is:
#include "../str_all.rh"
STRINGTABLE DISCARDABLE
BEGIN
MY_DLL_STRING1 "ใใฏใใ"
MY_DLL_STRING2 "ใใใซใกใ"
END
3. I add "str_enu.rc" to my ENU folder and add to the project1.bpr under the
ENU folder. The file is:
#include "../str_all.rh"
STRINGTABLE DISCARDABLE
BEGIN
MY_DLL_STRING1 "Hello!"
MY_DLL_STRING2 "Welcom to use "
END
4. I include str_all.rh in my project under the main folder.
5. At OnClick event of my button, I add the following sentense:
HINSTANCE hRes =
(HINSTANCE)FindResourceHInstance((unsigned)HInstance);
AnsiString s = AnsiString::LoadStr(hRes,MY_DLL_STRING1);
ShowMessage(s);
6. I build all the project, however, the message shows nothing.
It seems that it did find any rc files. What shall I do to perform this? Any
help will be highly appreciated. Thank you in advance for your time.
Sincerely,
Elena
Technical Details
Message-ID:
<416ba1f3$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10297d,afc63d63b99e1071,start X-Google-Attributes: gid10297d,public X-Google-Language: Japanese,JIS Reply-To: "Elena" <yiyun@base.com> From: "Elena" <yiyun@base.com> Newsgroups: borland.public.cppbuilder.internationalization Subject: Multi language support with RC file Date: Tue, 12 Oct 2004 18:21:26 +0900 Lines: 63 Organization: Base MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-2022-jp"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 NNTP-Posting-Host: 222.146.199.190 Message-ID: <416ba1f3$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1097572851 222.146.199.190 (12 Oct 2004 02:20:51 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail