I\'m writing a DLL and want to be able to switch between the unicode and multibyte setting in MSVC++2010. For example, I use _T(\"string\")
and LPCTSTR
Why not do like the Win32 API does: Use wide characters internally, and provide a character-converting facade of DoSomethingA
functions which simply convert their input to Unicode.
That said, you could define a tstring
type like so:
#ifdef _UNICODE
typedef std::wstring tstring;
#else
typedef std::string tstring;
#endif
or possibly:
typedef std::basic_string<TCHAR> tstring;