Article View: borland.public.cppbuilder.internationalization
Article #244Re: syntax problem with resourcestring in C++ builder
From: Dennis Jones
Date: Sun, 15 May 2005 05:44
Date: Sun, 15 May 2005 05:44
45 lines
2043 bytes
2043 bytes
"Fred Hebert" <fhebert@hotmail.com> wrote in message
news:Xns9654A0A934D2Cfheberthotmailcom@207.105.83.66...
> I am a Delphi programmer making some changes to a C++ builder application.
> I am trying to implement resource strings, but I keep getting a syntax
> declaration error.
>
> The documentation says it supports it, but all examples are in Pascal.
>
> Can anyone give me a quick example of a resourcestring declaration.
>
> Just so I am not asking a follow up question tomorrow, are there any
tricks
> to using them?
>
> In Delphi they are basically treated like string constants...
Fred,
In C/C++, you should create both a resource file (with the strings'
definitions) and a resource header file (with the string constants'
definitions). For example:
In "MyResourceStrings.rh":
#define IDS_Welcome 30001
In "MyResourceStrings.rc":
#include "MyResourceStrings.rh"
STRINGTABLE
BEGIN
IDS_Welcome "Welcome"
END
Then, in a C/C++ file, "MySourceFile.cpp":
#include "MyResourceStrings.rh"
ShowMessage( LoadStr(IDS_Welcome) );
Hope this helps,
- Dennis
Technical Details
Message-ID:
<4286e1cc$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<Xns9654A0A934D2Cfheberthotmailcom@207.105.83.66>Show Full Headers
Complete Article Headers
X-Google-Thread: 10297d,e4cd25c74a33fb20 X-Google-Attributes: gid10297d,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Dennis Jones" <nospam@nospam.com> Newsgroups: borland.public.cppbuilder.internationalization References: <Xns9654A0A934D2Cfheberthotmailcom@207.105.83.66> Subject: Re: syntax problem with resourcestring in C++ builder Date: Sat, 14 May 2005 22:44:44 -0700 Lines: 48 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 204.200.27.7 Message-ID: <4286e1cc$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1116135884 204.200.27.7 (14 May 2005 22:44:44 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!news-in.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail