类 型 | MBCS | UNICODE |
TCHAR | char | char |
WCHAR | wchar_t | wchar_t |
LPSTR | char* | char* |
LPCSTR | const char* | const char* |
LPWSTR | wchar_t* | wchar_t* |
LPCWSTR | const wchar_t* | const wchar_t* |
LPTSTR | TCHAR* | TCHAR* |
LPCTSTR | const TCHAR* | const TCHAR* |
1
2
3
4
5
6
7
8
|
相互转换方法:
LPWSTR->LPTSTR: W2T();
LPTSTR->LPWSTR: T2W();
LPCWSTR->LPCSTR: W2CT();
LPCSTR->LPCWSTR: T2CW();
ANSI->UNICODE: A2W();
UNICODE->ANSI: W2A();
|