Displaying caption of a control using CString and Unicode value
-
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
-
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
megha_gharote wrote:
s1 = _T(2193);
what are you expecting with this ?
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
megha_gharote wrote:
s1 = _T(2193);
what are you expecting with this ?
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
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...
-
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...
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]
-
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]
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.
-
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.
OMG, i forgot to finish my sentence ! lol. fixed now
[VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]
-
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...
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 gets1 = (2193)
; and this shouldn't ever compile. BTW UNICODE value for down arrow is0x2193
, 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.