Solved

UNICODE X MFC

Posted on 2004-08-19
5
297 Views
Last Modified: 2013-11-20
Hello!

I have MFC 4.2 (I guess) and I would like to know if it is possible to use Unicode font encoding.
I need to show Korean characters.

In afirmative case, how difficult would it be?

Thanks in advance,

Hederglan
0
Comment
Question by:hederglan
  • 2
5 Comments
 
LVL 16

Expert Comment

by:nonubik
ID: 11839358
>I have MFC 4.2 (I guess) and I would like to know if it is possible to use Unicode font encoding.
Yes, it is possible. There is a mfc42u.dll which is the UNICODE version of mfc42.dll

>In afirmative case, how difficult would it be?
You have to define the UNICODE and _UNICODE in your project settings.
You can use an of the TCHAR derived types (LPTSTR, etc), CString too, be carefull not to use char * when trying to display Korean chars.
You can also use functions like mbstowcs(..) which transforms a nonUNICODE string into a UNICODE one, and wcstombs which does the reverse.
0
 
LVL 13

Accepted Solution

by:
SteH earned 150 total points
ID: 11839364
Some hints can be found at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_unicode_topics.asp

If you find a MFC42U.DLL in your system directory after the custom installation you can do it. (other DLLs are needed for UNICODE applications to work but this one should be there).

All strings are based on TCHAR and not CHAR. Constants can be defined as _T("This is the string") or L"This is the string". Latter is unicode only whereas the first can be compiled with ANSI or UNICODE. And for normal string operations ie strlen you need to use the wide version wstrlen.
0
 
LVL 1

Author Comment

by:hederglan
ID: 11840302
What I exactly need to do is showing Korean characters in a TextBox.
This data is read from a text file and stored in an object of the class X...
In the class X there is a member that stores the sequency of characters in a string (string MemberThatStoresTheSequencyOfCharacters)...
May I use string?
Using string do I have to define UNICODE and _UNICODE?

I guess anyway I will have to install those MFC libraries to Unicode...

Thanks.
0
 
LVL 16

Expert Comment

by:nonubik
ID: 11840337
You can use wstring.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 100
Expand macro to include alternate header placement and naming 5 71
scoreUp challenge 14 63
Not needed 13 112
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

777 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