Why in windows programming do people do this:
Instead of thisCode:TEXT("This is text")
Am I doing something wrong here?Code:"This is 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 ...
Why in windows programming do people do this:
Instead of thisCode:TEXT("This is text")
Am I doing something wrong here?Code:"This is text"
Please direct all complaints regarding this post to the nearest brick wallHave a nice day.
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.
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.