Re: concatenating mismatched wide strings

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Okay. I would just add that if they have been defined correctly,
sizeof(TCHAR) should be 2.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Steve Russell" <srussell@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:OydK4YojGHA.1640@xxxxxxxxxxxxxxxxxxxxxxx
Okay, thank you, Jonathan. I will stay with what I learned from MVP Mihai
Nita:

Or is this the same as including UNICODE,_UNICODE in the preprocessor
definitions under Settings?
Yes, is the same. Depending on what version of VS you are using, you
have to add the defines by hand as preprocessor directives ( VS6 and
older),
or just select Unicode build from a menu (VS2002/2003/2005).
---------
"Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> wrote in message
news:OwTLKTojGHA.4044@xxxxxxxxxxxxxxxxxxxxxxx
Yes, 2 versions have been released since 6.0. Both of them use the
described switch to set the character set. I don't recall 6.0--haven't
used it for many, many years.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Steve Russell" <srussell@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:uKCbOsnjGHA.3496@xxxxxxxxxxxxxxxxxxxxxxx
Are you describing something later than 6.0? I don't have such a
properties choice under Project in the menu.
-----------
"Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> wrote in message
news:OHfBvmnjGHA.3620@xxxxxxxxxxxxxxxxxxxxxxx
Project | <appname> Properties | Configuration Properties | General |
Character Set. (Set to multibyte for non-Unicode.)

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Steve Russell" <srussell@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ui%23uFumjGHA.5020@xxxxxxxxxxxxxxxxxxxxxxx
"Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> wrote in message
news:%233CaklmjGHA.1508@xxxxxxxxxxxxxxxxxxxxxxx
Steve,

My apologies -- I did neglect to mention that the line number in the
error message referred to the AfxMessageBox line.

I added ",UNICODE,_UNICODE" under Project Settings / C/C++ /
Preprocessor / Preprocessor definitions.

A trace of sizeof(TCHAR) gives me 1.

Maybe this is leading to the same place as my other thread on
Unicode. Perhaps I am lacking something in defining UNICODE, but I
thought I had it all working.

If sizeof(TCHAR) is 1, then not everything is Unicode.

You can toggle the Unicode setting in the project properties dialog
box. There is a setting for the active character set. I STRONGLY urge
you to remove all the stuff you've added manually and use that
setting.
------------
Well, the fallacy in my measure of TCHAR is that the only way I could
run the program was to remove the Unicode entries in the Preprocessor
definitions.

By "project properties dialog box" do you mean the Project Settings?
Would you mind pointing me to the "toggle switch" you are referring
to?











.



Relevant Pages

  • Re: concatenating mismatched wide strings
    ... Okay, thank you, Jonathan. ... or just select Unicode build from a menu. ... described switch to set the character set. ... By "project properties dialog box" do you mean the Project Settings? ...
    (microsoft.public.vc.mfc)
  • Re: concatenating mismatched wide strings
    ... Preprocessor / Preprocessor definitions. ... Maybe this is leading to the same place as my other thread on Unicode. ... You can toggle the Unicode setting in the project properties dialog box. ... There is a setting for the active character set. ...
    (microsoft.public.vc.mfc)
  • Re: Inserting "#undef UNICODE " at a beginning of a file is not always enough
    ... > VS 2005 defaults to Unicode. ... Character Set ... Igor Tandetnik ...
    (microsoft.public.vc.language)
  • Re: concatenating mismatched wide strings
    ... switch to set the character set. ... Maybe this is leading to the same place as my other thread on Unicode. ... By "project properties dialog box" do you mean the Project Settings? ... Would you mind pointing me to the "toggle switch" you are referring to? ...
    (microsoft.public.vc.mfc)
  • Re: Parsing serial data
    ... or you might be mis-understanding "ANSI" ... Dick. ... I agree that Chuck's data is not Unicode, and that Unicode is never used for ... that his data is in a single-byte character set. ...
    (microsoft.public.vb.general.discussion)