Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Unicode Programming

Unicode Programming

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Truong D Toan
    wrote on last edited by
    #1

    I am programming with unicode.And I don't know how to send a character with the code > 0xFF.Anyone know it. Thank you very much...:)

    F D 2 Replies Last reply
    0
    • T Truong D Toan

      I am programming with unicode.And I don't know how to send a character with the code > 0xFF.Anyone know it. Thank you very much...:)

      F Offline
      F Offline
      f64
      wrote on last edited by
      #2

      Hi, I don't know what do you mean with "...how to send a character..." but if what you want is assign a UNICODE character to a variable, this is how

      TCHAR c = 0x0100;

      Now if you are talking about UNICODE strings, use BSTR or one of the classes that encapsulate it, CComBSTR or _bstr_t. Fabian

      T 1 Reply Last reply
      0
      • F f64

        Hi, I don't know what do you mean with "...how to send a character..." but if what you want is assign a UNICODE character to a variable, this is how

        TCHAR c = 0x0100;

        Now if you are talking about UNICODE strings, use BSTR or one of the classes that encapsulate it, CComBSTR or _bstr_t. Fabian

        T Offline
        T Offline
        Truong D Toan
        wrote on last edited by
        #3

        Sorry for my ambiguous question.I want to send a message WM_CHAR with a code > 0xFF but when I use the following code : wParam = 0x01ff It send a character with code = 0xff.

        F 1 Reply Last reply
        0
        • T Truong D Toan

          Sorry for my ambiguous question.I want to send a message WM_CHAR with a code > 0xFF but when I use the following code : wParam = 0x01ff It send a character with code = 0xff.

          F Offline
          F Offline
          f64
          wrote on last edited by
          #4

          Hi, Could you be more specific? If I do this

          TCHAR t = 0x01FF;
          SendMessage(WM\_CHAR, (WPARAM)t, NULL);
          

          when I process the message I get wParam == 0x000001FF Fabian

          1 Reply Last reply
          0
          • T Truong D Toan

            I am programming with unicode.And I don't know how to send a character with the code > 0xFF.Anyone know it. Thank you very much...:)

            D Offline
            D Offline
            Diddy
            wrote on last edited by
            #5

            Silly question, but do you have _UNICODE and UNICODE defined? If you don't, TCHAR will equate to char..... and: TCHAR t = 0x01FF; SendMessage(WM_CHAR, (WPARAM)t, NULL); Will truncate t to 0xFF when stored in a char varible. Try being explicte about what character set you are sending - wchar_t t = 0x01FF; SendMessage(WM_CHAR, (WPARAM)t, NULL);

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups