can anyone explain to me what is: 'T', 'L', 'wchar_t', 'LPCWSTR' and 'LPCTSTR'?
how can i convert strings\char* to these types?
(i understand these isn't a tutorial, but i realy need these introdution)
or you can give me just a nice link.
cambalinho 142 Practically a Posting Shark
Recommended Answers
Jump to Post_T() is the same as _TEXT(), which converts a string literal to UNICODE, for example _TEXT("Hello World"); Those two macros do nothing for character arrays. These macros are translated at compile time as either wide characters (wchar_t*) or normal ascii characters (char *).
L is not a macro but forces …
Jump to PostYou can't. Those are macros that work only on string literals -- text within quotes such as "Hello World". You have to call a conversion function to convert char* to wchar_t*. Study the link I gave you.
Jump to Postwindows.h should be sufficient. There are a lot of other macros in tchar.h. My preference is to (almost) never use L because L is not portable between UNICODE and non-UNICODE programs, while the _T() and _TEXT() macros are. If you use _T() you can turn UNICODE on and off without …
Jump to Postwhat is "argument"? It has to be a string literal, can not be the name of a variable. And did you include tchar.h? For edxample
#include <Windows.h> #include <tchar.h> #include <iostream> int _tmain(int argc, _TCHAR* argv[]) { std::cout << _T("Hello World\n"); return 0; }
All 13 Replies
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
cambalinho 142 Practically a Posting Shark
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
cambalinho 142 Practically a Posting Shark
Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
cambalinho 142 Practically a Posting Shark
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
cambalinho 142 Practically a Posting Shark
cambalinho 142 Practically a Posting Shark
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
cambalinho 142 Practically a Posting Shark
cambalinho 142 Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.