Solved

UNICODE X MFC

Posted on 2004-08-19
5
295 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do you programatically show and hide the Windows 10 On-Screen-Keyboard? 3 524
iSeries DB2 Query 2 90
Detect CR LF to each line 12 152
Path of Workbook 3 59
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now