Using _T() and L"" in UNICODE Projects? [modified]
-
Hello community, have one question about L"" for unicode strings: do i have to use this L"" for strings always, even if is only one caracter length, also, if i have an single character to compare, something like this:
('H' == *lpsz) // lpsz is an LPCTSTR loaded from an CString //or to use (L'H' == *lpsz) // and ("H" == *lpsz) //or to use (L"H" == *lpsz)
to often my application breaks in this line:
// original code, my program breaks here sometimes: while( (*wcStrToAnalyse != '\0') && (*wcStrToAnalyse != ' ') ) // i want to loop through this string before i find an first space or string end
and my project is in unicode. thanks in advance break; -- modified at 6:55 Tuesday 5th December, 2006
-
Hello community, have one question about L"" for unicode strings: do i have to use this L"" for strings always, even if is only one caracter length, also, if i have an single character to compare, something like this:
('H' == *lpsz) // lpsz is an LPCTSTR loaded from an CString //or to use (L'H' == *lpsz) // and ("H" == *lpsz) //or to use (L"H" == *lpsz)
to often my application breaks in this line:
// original code, my program breaks here sometimes: while( (*wcStrToAnalyse != '\0') && (*wcStrToAnalyse != ' ') ) // i want to loop through this string before i find an first space or string end
and my project is in unicode. thanks in advance break; -- modified at 6:55 Tuesday 5th December, 2006
if you're using LPSTR (CHAR*) strings, then don't use any. if you're using LPTSTR (TCHAR*) strings, then use _T(). if you're using LPWSTR (WCHAR*) strings, then use L.
You don't know where to start ? ask a good friend
-
if you're using LPSTR (CHAR*) strings, then don't use any. if you're using LPTSTR (TCHAR*) strings, then use _T(). if you're using LPWSTR (WCHAR*) strings, then use L.
You don't know where to start ? ask a good friend
-
Hello, thanx for help, is this for single characters to, like this : 'H' or _T('H'), 'H' or L'H', "H" or L"H"? Sorry about this question, but i need help! regards break;
-
Be carefull with '' and "" ... can drive you into some problems. :)
-
Be carefull with '' and "" ... can drive you into some problems. :)
spielehelfer wrote:
Be carefull with '' and "" ... can drive you into some problems
like ? are you suspecting me to confuse characters with C-Style Strings ? :~
You don't know where to start ? ask a good friend