Solved

Unicode Strings in Resource Files

Posted on 1998-01-20
7
591 Views
Last Modified: 2008-02-01
I was trying to use Unicode ("wide character") constant strings in a resource (.rc) file. The resource compiler refuses to load the file when it contains unicode strings,
and at some point even reported "rc4213: Unicode is not supported". Is it really impossible to work directly with
true Unicode data in my .rc files?
0
Comment
Question by:FNORD0
7 Comments
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1178552
Which compiler are you using?

Ultimately if your compiler does not support Unicode, you can always use custom resources to store your Unicode strings and retrieve them using LoadResource().


0
 

Author Comment

by:FNORD0
ID: 1178553
Sorry, I forgot to mention some basic details. I am using
MS-Visual C++ v5.0 (from VStudio 97) with SP3, on Windows
NT 4.0 with SP3. As far as I know, this compiler should by
all means support Unicode, since it converts everything to
Unicode internally anyway (by the NT GDI), which makes it
all the more strange that the Resource Compiler does not
support resource files with Unicode strings in them. Anyone?
0
 

Accepted Solution

by:
Hungry earned 200 total points
ID: 1178554
Maybe You should change the Compile Swithes, such as
/D "UNICODE". VC++ certainly supports UNICODE. Have a
try and good luck!
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 23

Expert Comment

by:chensu
ID: 1178555
FYI, the documentation says:

String Resources
Windows 32-bit resources in binary form are stored in Unicode format. When loading resources, applications can use the Unicode version of the resource functions (LoadStringW, for example) to obtain resources as Unicode data.

0
 

Author Comment

by:FNORD0
ID: 1178556
Thanks for everyone's answers. The problem, as I mentioned, was not how to use Unicode data in my program, but how to make the resource compiler use strings which are in Unicode inside the .rc file. I have managed to resolve this problem myself, by using the Uconvert sample program (supplied with VStudio) and converting the entire resource file to Unicode, instead of just embedding Unicode strings in it. Thanks again for all your efforts!
0
 
LVL 1

Expert Comment

by:Mensana
ID: 2266005
Sorry for adding a comment so late. A better option is to work with two different resource files. A normal one that can be edited with the resource editor that comes with the Visual C++ IDE and a second resource file saved in Unicode text format that will contain only a string table. I have created my own editor (that can be customized for whatever the language is to be used) for this second file and now I still can move or resize a button at any moment in time.
0
 

Author Comment

by:FNORD0
ID: 2267812
Thanks for the answer.  The problem was solved months ago, and frankly I don't even remember what the exact solution was, since we're talking about two years back.  Still, I appreciate the effort!

FNORD0
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now