LPTSTRに相当する文字列はありますか?私は文字列とwstringを知っています。tstringはありますか?
2 に答える
9
次のいずれかを定義できます。
typedef std::basic_string<TCHAR> mystring;
...
mystring test = _T("Hello World!");
于 2009-12-01T06:53:28.517 に答える
4
別のオプション(必須ではありませんwindows.h
):
#if defined(_UNICODE) || defined(UNICODE)
typedef std::wstring ustring_t;
typedef wchar_t uchar_t;
#define TEXT(x) (L##x)
#else
typedef std::string ustring_t;
typedef char uchar_t;
#define TEXT(x) (x)
#endif
使用法:
ustring_t mystr = TEXT("hello world");
于 2009-12-01T07:14:00.973 に答える