Solved

Unicode Strings in Resource Files

Posted on 1998-01-20
7
601 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

729 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