Text

This is a discussion on Text within the Windows Programming forums, part of the Platform Specific Boards category; Why in windows programming do people do this: Code: TEXT("This is text") Instead of this Code: "This is text" Am ...

  1. #1
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052

    Text

    Why in windows programming do people do this:
    Code:
    TEXT("This is text")
    Instead of this
    Code:
    "This is text"
    Am I doing something wrong here?
    Please direct all complaints regarding this post to the nearest brick wall Have a nice day.

  2. #2
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    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
    Posts
    4,831
    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, 01:59 PM
  2. struct question
    By caduardo21 in forum Windows Programming
    Replies: 5
    Last Post: 01-31-2005, 03: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, 06:35 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21