CString to CHAR *
-
I know this has to be simple, but when compiling...I get this error: cannot convert from 'class CString' to 'char *' How do I convert a CString to 'char *'? Thanks! Frank
-
I need to convert from CString to LPSTR. The conversion from CString to Constant CHAR* doesnt work for this function. Any other ideas? :) Frank
The CString provides operator LPCTSTR to perform the conversion to const char*. This conversion is implicit if you call a method taking a const char * with a CString. I find this a bit clunky, but you can use it explicitly and cast away the const like so: (LPTSTR)(LPCTSTR)str
-
I need to convert from CString to LPSTR. The conversion from CString to Constant CHAR* doesnt work for this function. Any other ideas? :) Frank
-
I need to convert from CString to LPSTR. The conversion from CString to Constant CHAR* doesnt work for this function. Any other ideas? :) Frank
-
I need to convert from CString to LPSTR. The conversion from CString to Constant CHAR* doesnt work for this function. Any other ideas? :) Frank
-
CString str = _T("fluff");
LPTSTR psz = str.GetBuffer(0);// use psz here...
str.ReleaseBuffer();