evc创建以系统时间命名的txt文件
想创建一个以系统时间命名的txt文件用来保存当天数据
if(m_bSaveAuto)
{
/
CString m_strFolderPath = "\\ResidentFlash\\HistoryData";
///////////////////////////////////////////////////////////////////////////
UpdateData(TRUE);
nS = m_SaveInterSecEdit;
SetTimer(3, 1000 * nS, NULL); //保存间隔S
TCHAR strTime[50];
CTime curtime=CTime::GetCurrentTime();
swprintf(strTime,_T("%04d-%02d-%02d"),curtime.GetYear(),curtime.GetMonth(),curtime.GetDay());
CString nTime=(CString)strTime;
CString strPath;
strPath.Format(_T("\\ResidentFlash\\HistoryData\\%s.txt"), nTime);
FILE* pF = fopen("strPath", "a");
fprintf(pF, "%s\n时间\t\t度(%RH)\n", strTime);
fclose(pF);
这样的方法建立的文件名是strPath,不知道该怎么办,如果把fopen那一句改为FILE* pF = fopen(strPath, "a")运行错误,我是新手 ,请高手指导指导