CString转换为LPSTR和LPSTR转化为CString
一、CString转换为LPSTR
方法一:
CString strFileName
LPSTR lpstr - strFileName.GetBuffer();
strFileName.Releasebuffer();
方法二:
强制转化
CString strFileName;
LPSTR lpstr = (LPSTR)(LPCSTR)strFileName;
二、LPSTR转化为CString
LPSTR lpstr = _T("TestStr");
CString str(lpstr);