LPTSTR에 해당하는 문자열이 있습니까?
문제
LPTSTR에 해당하는 문자열이 있습니까? 나는 문자열과 wstring을 알고 있습니다. tstring이 있습니까?
해결책
하나를 정의 할 수 있습니다.
typedef std::basic_string<TCHAR> mystring;
...
mystring test = _T("Hello World!");
다른 팁
다른 옵션 (필요하지 않습니다 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");
제휴하지 않습니다 StackOverflow