CString用 + 追加赋值失效原因----GetPrivateProfileString
CString strValue(_T(""));
GetPrivateProfileString("保存路径", "本地", "0", strValue.GetBuffer(256), 256, iniPath);
strValue.ReleaseBuffer(256);
m_LocalPath = strValue;
这里用 CString strFolder = m_LocalPath + strDate;
strFolder 只能是 m_LocalPath 的值,除非先用 m_LocalPath.releaseBuffer之后,才可以进行追加。
所以 GetPrivateProfileString用法,应该用下面的这个。
char pathname[MAX_PATH];
GetPrivateProfileString("保存路径", "本地", "0", pathname, MAX_PATH, iniPath);
m_LocalPath = pathname;
不影响 对m_LocalPath进行的操作

浙公网安备 33010602011771号