Unicode[edit]
・CString → std::string
CString cstr;
std::string astr = static_cast(cstr);
・std::string → CString
std::string astr;
CString cstr = astr.c_str();
Windows Programing (VC++)†[edit]
- 非 Unicode の場合は マルチバイト (mb)
- Unicode の場合は ワイドキャラクター (wc)
- 先頭に t の付く関数などは自動対応.
- TCHAR, CString, LPTSTR, LPCTSTR (const) は自動対応
- CString は LPCTSTR でキャストする
- Unicode を使用している場合 CString と char* との間でキャストはできない.
- TCHAR と CString は何時でもキャスト可能
- char* と CString はUnicode 未使用時のみキャスト可能