Chinese in .rc

This is a discussion on Chinese in .rc within the Windows Programming forums, part of the Platform Specific Boards category; Hi, How do you write chinese in windows (in the .rc) using Win32 APIs? Also, how do you allow users ...

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    37

    Question Chinese in .rc

    Hi,

    How do you write chinese in windows (in the .rc) using Win32 APIs? Also, how do you allow users to type in chinese in EDITTEXT and also how to store it? If it somehow matters, I'm developing using Dev-C++.

    Thanks in advance.

  2. #2
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    Unicode, but you and they have to have the Chinese simplified and/or Chinese traditional language pack installed.

    http://www.microsoft.com/downloads/d...displaylang=en
    Last edited by abachler; 08-10-2009 at 06:30 AM.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    37
    How do I use unicode? And does that mean if I can read chinese on my computer then it'll be fine, or do you mean some other packages?

    Thanks.

  4. #4
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    If you can read it on your computer, then you already have the language pack installed. Just type the Chinese into the resource file as normal. I'm not sure GCC has an actual RC application, I think it just uses a simple text editor which of course may not work with Unicode.

    Refer to these articles on MSDN which explains it better than I can.

    Using Unicode Data
    http://msdn.microsoft.com/en-us/library/cc194800.aspx
    http://msdn.microsoft.com/en-us/library/cc194801.aspx
    http://msdn.microsoft.com/en-us/library/cc194795.aspx
    http://msdn.microsoft.com/en-us/library/cc194799.aspx
    Last edited by abachler; 08-10-2009 at 07:01 AM.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    37
    But do I have to type in any commands before using unicode, like if I want to put something like this:

    Code:
    LTEXT "Some Chinese here", ID, 1, 1, 1, 1
    in my dialog, how do I do it? I tried just writing chinese there and compile it, but it just shows 2 characters like in the IDE.

  6. #6
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    You also have to use the Unicode versions of functions.

    Code:
    MessageBox(NULL , TEXT("Some Chinese Here.") , TEXT("Some More Chinese Here.") , MB_OK);
    May or may not display correctly, depending on your project settings.

    Code:
    MessageBoxA(NULL , TEXT("Some Chinese Here.") , TEXT("Some More Chinese Here.") , MB_OK);
    Will definitely NOT display properly, as you are using Unicode in an ANSII function call

    Code:
    MessageBoxW(NULL , TEXT("Some Chinese Here.") , TEXT("Some More Chinese Here.") , MB_OK);
    Will properly display the Chinese
    Last edited by abachler; 08-10-2009 at 07:09 AM.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  7. #7
    Registered User
    Join Date
    May 2009
    Posts
    37
    What about dialogs declared in .rc? Something like LTEXTW?

    Thanks.

  8. #8
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. .rc files in VC8
    By jsrig88 in forum Windows Programming
    Replies: 6
    Last Post: 05-10-2008, 07:01 PM
  2. .rc files not supported by VC++2005Express
    By bejiz in forum Windows Programming
    Replies: 2
    Last Post: 06-04-2006, 09:41 AM
  3. Making a DLL which includes an .rc file
    By Halloko in forum Windows Programming
    Replies: 2
    Last Post: 07-27-2005, 08:53 AM
  4. Chinese and C++
    By Swaine777 in forum C++ Programming
    Replies: 2
    Last Post: 03-31-2003, 03:01 PM
  5. Chinese characters
    By madmandan in forum Windows Programming
    Replies: 3
    Last Post: 07-10-2002, 07:19 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21