Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Unicode Strings in Resource Files

Posted on 1998-01-20
7
Medium Priority
?
607 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

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…
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 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 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.

704 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