How to convert ANSI string to UNICODE string and vice versa?

Well quite simple,  but still quite frequently asked in forums… 🙂 There are two macros that does this for us. They are as follows. Note: You must include atlconv.h A2W – ANSI to UNICODE W2A – UNICODE to ANSI Before using these two macros you have to use this macro too… USES_CONVERSION Here is a […]
Continue reading…

 

A TCHAR version of std stream and string classes

Quite simple… [sourcecode language=’cpp’]// A TCHAR based std::string typedef std::basic_string tstring; // A TCHAR based std::ifstream; typedef std::basic_ifstream tstream; // A TCHAR based std::stringstream typedef std::basic_stringstream tstringstream;[/sourcecode] So now no need to worry about UNICODE and ANSI, should work as CString, since TCHAR becomes char/wchar_t based on _UNICODE macro definition. Also note that stl has […]
Continue reading…