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. Displaying caption of a control using CString and Unicode value

Displaying caption of a control using CString and Unicode value

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
7 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.
  • M Offline
    M Offline
    megha_gharote
    wrote on last edited by
    #1

    Dear Friends, I m working VC++ where UNICODE is not defined for tht particular application. I want to display "Name (DownArrow)" as a caption on a control. here Downarrow means the picture of downarrow. I tried in a following way. CString s1, s2; s1 = _T(2193); s2 = "PickUp" + s1; But for S1 it is giving me the character with value as 255. Can anybody help me out?/ I can use painting tht control but i don't want to do that.. Thanks in advance Megha

    T 1 Reply Last reply
    0
    • M megha_gharote

      Dear Friends, I m working VC++ where UNICODE is not defined for tht particular application. I want to display "Name (DownArrow)" as a caption on a control. here Downarrow means the picture of downarrow. I tried in a following way. CString s1, s2; s1 = _T(2193); s2 = "PickUp" + s1; But for S1 it is giving me the character with value as 255. Can anybody help me out?/ I can use painting tht control but i don't want to do that.. Thanks in advance Megha

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      megha_gharote wrote:

      s1 = _T(2193);

      what are you expecting with this ?


      [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

      M 1 Reply Last reply
      0
      • T toxcct

        megha_gharote wrote:

        s1 = _T(2193);

        what are you expecting with this ?


        [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

        M Offline
        M Offline
        megha_gharote
        wrote on last edited by
        #3

        in character map this value corresponds to downarrow.. so i thought by doing s1 = _T(2193); i m ay get tht value as CString in s1...

        T CPalliniC 2 Replies Last reply
        0
        • M megha_gharote

          in character map this value corresponds to downarrow.. so i thought by doing s1 = _T(2193); i m ay get tht value as CString in s1...

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          do you know what the _T() macro does ? it simply prepends a L in front of the string (because you're supposed to pass it a literal string, not an integer) if UNICODE is defined, and does nothing otherwise.


          [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

          CPalliniC 1 Reply Last reply
          0
          • T toxcct

            do you know what the _T() macro does ? it simply prepends a L in front of the string (because you're supposed to pass it a literal string, not an integer) if UNICODE is defined, and does nothing otherwise.


            [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

            CPalliniC Offline
            CPalliniC Offline
            CPallini
            wrote on last edited by
            #5

            toxcct wrote:

            it simply prepends a L in front of the string (because you're supposed to pass it a literal string, not an integer).

            Oh no. Prepends nothing in his case. :)

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

            In testa che avete, signor di Ceprano?

            T 1 Reply Last reply
            0
            • CPalliniC CPallini

              toxcct wrote:

              it simply prepends a L in front of the string (because you're supposed to pass it a literal string, not an integer).

              Oh no. Prepends nothing in his case. :)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

              T Offline
              T Offline
              toxcct
              wrote on last edited by
              #6

              OMG, i forgot to finish my sentence ! lol. fixed now


              [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

              1 Reply Last reply
              0
              • M megha_gharote

                in character map this value corresponds to downarrow.. so i thought by doing s1 = _T(2193); i m ay get tht value as CString in s1...

                CPalliniC Offline
                CPalliniC Offline
                CPallini
                wrote on last edited by
                #7

                You're trying to do a pretty weird thing. Since your application is not set as a UNICODE build, the macro _T expands to nothing and you'll get s1 = (2193); and this shouldn't ever compile. BTW UNICODE value for down arrow is 0x2193, i.e. 8595. :)

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

                In testa che avete, signor di Ceprano?

                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