Solved

Unicode Strings in Resource Files

Posted on 1998-01-20
7
594 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

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

773 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