🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internationalization
Article #162

Re: Resurce DLLs in a subfolder

#162
From: amber
Date: Tue, 07 Feb 2006 04:00
63 lines
2956 bytes
I have the similar problem, in my test application I orgnize error messages 
as stringtable resource in a .rc file(errormsg.rc) which is add  to the 
project.

STRINGTABLE
BEGIN
    1, "??1"
END

My project's active language is Chinese(OS is Chinese version ,CB6 
enterprise is English version) ,
and I add a English language to it through Project->Language->Add . I 
translated the message via translation manager as follows

1 , "Message 1"

When I complier the project group the final outputs are:

test.exe
test.ENU

As to the resources I conside like this:
the Chinese version of  resources are linked into test.exe ,and English 
version is isolated into test.ENU

In the program I code like this:

char buffer[100];
memset(buffer,0,100);
int size = LoadString(NULL,1,buffer,100);
if (size > 0 && size < 99)
{
buffer[size + 1] = '\0';
}
Button1->Caption = AnsiString(buffer);

As the platform sdk 
says(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/resources/strings/stringreference/stringfunctions/loadstring.asp) 
,

if the first parameter of LoadString is null ,the module of the image witch 
is used  to creat the current process is used.

When I use the chinese version all works well,but when I change to load the 
English version
( set HKEY_CURRENT_USER\Software\Borland\Locales\F:test.exe to ENU)
the message is still the chinese version , I think because I didn't provide 
the wright HANDLE of the module witch contains
the resource ,in this example I should provide the HANDLE of test.ENU.

The question is How can I get Such HANDLES


>I can see ways to switch which resource DLL is used on the fly, but not 
>where
> to go for them.
Do you mean the CB6 online help code like this:

const  FRENCH = (SUBLANG_FRENCH << 10) | LANG_FRENCH;
if (LoadNewResourceModule(FRENCH))
    ReinitializeForms();

Thanks. 
Technical Details
Message-ID: <43e81a80@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <437780fe@newsgroups.borland.com> <43789416$1@newsgroups.borland.com> <4378c0f0@newsgroups.borland.com> <4378c3fa$1@newsgroups.borland.com> <bfjhn15ljo4kp5bc63fg5g8h2mg01vf9pm@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10297d,85baf43614268ac1
X-Google-Attributes: gid10297d,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "amber" <guxiaobo1982@163.com>
Newsgroups: borland.public.cppbuilder.internationalization
References: <437780fe@newsgroups.borland.com> <43789416$1@newsgroups.borland.com> <4378c0f0@newsgroups.borland.com> <4378c3fa$1@newsgroups.borland.com> <bfjhn15ljo4kp5bc63fg5g8h2mg01vf9pm@4ax.com>
Subject: Re: Resurce DLLs in a subfolder
Date: Tue, 7 Feb 2006 12:00:09 +0800
Lines: 65
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
NNTP-Posting-Host: 218.18.91.90
Message-ID: <43e81a80@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1139284608 218.18.91.90 (6 Feb 2006 19:56:48 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail