[How to convert CString to std::string]
In Visual Studio 6.0
One used to:
string mystring;
CString myCString("this is a CString");
mystring=(LPCTSTR)myCString;
However, it is not available anymore in Visual Studio 2005.
One should use "CT2CA" do like this:
string mystring;
CString myCString("this is a CString");
CT2CA myCT2CA(myCString);
mystring=myCString;
Saturday, March 27, 2010
Subscribe to:
Comments (Atom)
-
Aftter adding this line, in 'head' of the blogger template editor in html mode, you can use MathJax expressions. For a new ...
-
-. A-priori reference variable has no unit (unitless). It is typically 1.0 or can be a different value for scaling. -. Weight is determ...
-
Multi-byte Unicode char TCHAR strcat_s() _tcscaft_s() strcpy_s() _tcscpy_s() strncpy_s() _tcsncpy_s() strien() _tcsien() sprinif_s()...