Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

UNICODE X MFC

Posted on 2004-08-19
5
Medium Priority
?
317 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 300 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

972 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