Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Unicode Strings in Resource Files

Posted on 1998-01-20
7
Medium Priority
?
613 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

916 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