Thread: Text

  1. #1
    Refugee face_master's Avatar
    Join Date
    Aug 2001


    Why in windows programming do people do this:
    TEXT("This is text")
    Instead of this
    "This is text"
    Am I doing something wrong here?

  2. #2
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    TEXT is a macro that is used to identify a string that's unicode. If UNICODE isn't defined then it just sets the string as an ANSI string.

    I program in Window's exclusively and I've never had a need for it. If you want more info on it (though there isn't much) look it out on MSDN.

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Yes, if you use the _T() macro, (or any of the other similar ones), it sorts ASCII/UNICODE problems out for you, (in most cases - there are some holes to fall into if you're not careful).

    It is worth remembering that UNICODE is increasingly being used, and that NT and the NT derivitives of the OS use UNICODE internally, therefore, you get a performance hit using the 8 bit character set on these OS's, (as the string/character is internally changed to 16 bit).
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A bunch of Linker Errors...
    By Junior89 in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2006, 02:59 PM
  2. struct question
    By caduardo21 in forum Windows Programming
    Replies: 5
    Last Post: 01-31-2005, 04:49 PM
  3. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  4. Ok, Structs, I need help I am not familiar with them
    By incognito in forum C++ Programming
    Replies: 7
    Last Post: 06-29-2002, 09:45 PM
  5. Outputting String arrays in windows
    By Xterria in forum Game Programming
    Replies: 11
    Last Post: 11-13-2001, 07:35 PM