?
Solved

UNICODE MFC very newbie :) VC6

Posted on 2003-10-27
8
Medium Priority
?
983 Views
Last Modified: 2013-12-03
Hi Experts

Im am thinking of writting for many languages. I know there is UNICODE.
But what about the how?


I read there are TCHAT and _T( ) and the Macro..  

How do I choose what language to display the text as?

Also are there any Turorials on the topic.

Thanks
Barry
0
Comment
Question by:barryhs
[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
8 Comments
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 1000 total points
ID: 9631936
Try these links

http://www.codeproject.com/cpp/unicode.asp - Unicode, MBCS and Generic text mappings
http://www.codeproject.com/tips/internationalization.asp - Tips on internationalization of software

Good luck
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9631960
http://www.codeproject.com/cpp/switch_languages.asp - Multilingual Application - Change Application Language
0
 
LVL 8

Expert Comment

by:_corey_
ID: 9637493
Did you install VS6 with UNICODE support? If not, reinstall.
0
 

Author Comment

by:barryhs
ID: 9647089
Hi thanks so far...

What is the reason for specifying the entry point symbol in your Project settings as wWinMainCRTStartup??

Ok the rest of the stuff I knew of..
Basicaly UNICODE is is almost a style ..
eg: _T() and changeing funtion names bla bla...

I Need a realy specific answer then..
Lets say I want the letter to be in a string, or title or in a CStatic , that is equal to the letters "yi" when I set my language to Japanese?

Please dont asume I know anything. Rather tell me everything.

Thanks
again Barry

0
 
LVL 6

Expert Comment

by:purpleblob
ID: 9663214
Basically _T and TCHAR are simply #defines which, depending upon your build will be single or double byte.

Now the point is that this means that if you build for UNICODE and deploy in a language that uses UNICODE then all your chars will actually be wchar_t in size meaning that the UNICODE strings are interpreted/displayed correctly. UNICODE is easy as is single byte character sets as each character is of uniform size. Where things get complicated is on MBCS (multi-byte character sets) whereby a character length may be char in size or wchar_t in size. With these character sets things get tricky as a character string may have a one byte character followed by a two followed by a one etc.

Okay so, the basic problem is now out of the way. if you try and use STL to store your strings, then this can only (from my recollection under VC++ 6) handle uniform character sizes and the MFC CString class, whilst able to handle MBCS has some funcitonality that doesn't work correctly - this is why I ended writing my own string class when I last did this stuff.

The problem is specifically if you wish to iterate through a "string", i.e. if you've a MBCS with different size characters, then you cannot simply go

for(int i = 0; i < _tstrlen(buf); i++)
{
  ... =  buff[i];
}

As this will expect each character to be of the same size. You need to use functions such as  _tcsnextc to get the next character (whether it be a single or double byte character).

Basically you'll need to review the tstr or _tstr type functions as these are #define'd to use either the single, multi or wide char versions of these functions.

Or if you do not need to support non-UNICODE versions of Windows then simply recompile everything for UNICODE :-)

Hope this helps
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

800 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