1)TCHAR* 转string
TCHAR exePathAndName[MAX_PATH];
GetModuleFileName(NULL, exePathAndName, MAX_PATH);
(_tcsrchr(exePathAndName,'//'))[1]=0;
USES_CONVERSION;
string filepath = T2A(exePathAndName);
g_strDataDirecory = filepath + "data//";
2) CString转string
CString m_cstrInputStr = L"Hello";
USES_CONVERSION;
string parens = W2A(m_cstrInputStr.LockBuffer());
m_cstrInputStr.UnlockBuffer();