Re: MFC(VC6) Application Localization from French to Chinese(RPC)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On May 28, 3:45 pm, "Tom Serface" <tom.nos...@xxxxxxxxxxxxx> wrote:
Yes those kinds of problems are often maddening since they can happen in so
many ways and that's the reason many people are just going to Unicode for
multi-language applications. I didn't think you could do a Unicode .RC file
with VC6, but it could be that the data is getting corrupted even before
your program runs. I remember in VC6 if I were to ever edit any of the
Asian content without first switching to the Asian code page the whole file
would get messed up. There maybe another library function in MFC too that
is reading your data as ANSI. You could trace through in the debugger to
get to the button routine and see what actual string is being assigned.

Tom

"kewei" <KeweiSh...@xxxxxxxxx> wrote in message

news:764b8d39-3f3a-493d-b227-ba30efc29fb1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I am using VC6.
and I "have theChinesecode page loaded for the characters to work
correctly." by setting the control panel. I am quite sure I did this
step accurately. I even tried the application in Chinese OS.
Actually, the application i am in charge of in non-unicode, but
the .rc file is saved in unicode I believe.

Actually, as far as I know. of course, a .lib file can't not
contain .rc, but actually, the application add the .rc as an external
dependencies, so the application can use the .rc file and .lib, that's
what my company did and it was working well with other language, like
german, english, french.

The thing that is wired is that, even in the same dialog, some of the
static strings or buttons show in "??" or messy form, but some other
static string or buttons shows successfully in Chinese form.
It's in the same dialog...!
So I couldn't understand why.

I solved this problem finally.
Actually, the reason is because I am using mutiple .rc files in one
project.
So for the First .rc file, the Chinese character surely displayed
correctly, but for the 2nd, 3rd... .rc files, the vc compile them not
as Chinese codepage(936) but as French codepage(1252).
My solution for this is that, for the project that cannot displayed
chinese correctly, click "view" -> "resource includes", and set the
language as well as the codepage for the next .rc file as following:

#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES

#if defined(AFX_TARG_CHS)
#ifdef _WIN32
LANGUAGE 4, 2
#pragma code_page(936)
#endif //_WIN32
#include "l.chs\afxres.rc" // Standard components
#include "l.chs\afxprint.rc" // printing/print preview
resources
#include "2ndResource.rc"
#include "3rdResource.rc"
#endif

this part of code will be written at the end of .rc file of this
project, consequently, it's also working on the 2ndResource.rc.

but you will find still, the Chinese Character in the 3rdResource.rc
display like "??".
So you could change the "view" -> "resource includes" for the
2ndResource.rc in the same way.
.



Relevant Pages

  • Changing part program to display UNICODE strings
    ... the English and Chinese strings, ... display it with the Arial Unicode MS font. ... wWinMAinCRTStartup settings) which reads ...
    (microsoft.public.vc.language)
  • Re: Grid Components (like QuantumGrid)
    ... > I am japanese developer.registerd user for devexpress. ... > unicode must use situation is display complex language. ... > ex japanese and chinese are display same window. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Intl. Herald Tribune story re: Shanghai
    ... Hey, may be the USBF drafted this with the Chinese in mind, trying ... intake from sponsoring private organizations. ... this is outrageous beyond belief, and the reason they ... No one is saying that rights ...
    (rec.games.bridge)
  • Re: UNICODE to MBCS
    ... a conversion internally from Unicode encoding to ANSI encoding. ... INI = UNICODE containing code points for English and Chinese ... Chinese characters where all unresolved and appearing as '?'. ...
    (microsoft.public.vc.language)
  • Re: OT: Guns in Space
    ... Chinese and you'll see that they are not habittually confrontational. ... as benefits China. ... The reason I say I don't think it'll get that far is that I think ... and we won't be able to put up a fight when they collapse our economy ...
    (sci.electronics.design)