🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #7498

Re: LoadString fails in Win2k / Win XP

#7498
From: Vladimir Afanasyev
Date: Tue, 25 Jan 2005 12:41
42 lines
2027 bytes
Hi,

"Thorsten Kettner" <QUESTIONBYthorsten.kettner@otto.de> wrote:
>
>Hi all,
>my program is being used in UK and in Germany. To get a string 
>in the appropriate language, I use
>
>  MyAnsiString.LoadString(HInstance, MYRESID);
>
>This works fine in Win NT and Win 98, but in Win XP and Win 2000
>I always get the German string.
>
>My resource file contains two string tables:
>
>STRINGTABLE DISCARDABLE
>LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
>BEGIN
>MYRESID "Some text in English."
>END
>
>STRINGTABLE DISCARDABLE
>LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
>BEGIN
>MYRESID "Ein Text in deutsch."
>END

I think that problem is Unicode.
Unicode is native for Win2000/XP but ANSI is
native for Win98/NT.

When you use LoadString(HInstance, MYRESID) you really use 
Win32 Api function LoadString that really has versions - 
LoadStringA (for ANSI) and LoadStringW (for Unicode).
Compiler decides what function will be used.

May be you solve your problem if will use corresponding WIN32 
API function. 
I hope it help you.

Vladimir.
Technical Details
Message-ID: <41f63e74$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41f5ffbc$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,26d4ad2d5662e41d
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Vladimir Afanasyev" <avv@systema.kiev.ua>
Sender: "Vladimir Afanasyev" <avv@systema.kiev.ua>
Reply-To: "Vladimir Afanasyev" <avv@systema.kiev.ua>
Subject: Re: LoadString fails in Win2k / Win XP
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 83.218.237.46     
X-Forwarded-For: unknown
References:  <41f5ffbc$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <41f63e74$1@newsgroups.borland.com>
Date: 25 Jan 2005 04:41:24 -0800
X-Trace: newsgroups.borland.com 1106656884 207.105.83.66 (25 Jan 2005 04:41:24 -0800)
Lines: 42
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail