void getNewerFile( const string& filePath , CTime comparedTime , vector<string>& fileNameList , 
  CTime& newestTime )
{
// 检查文件日期需要的API参考下面
WIN32_FIND_DATA fd;
FILETIME endtime;
CTime timeFormat;
HANDLE handle; 
CString SeekPath,strRst,tmp;// SeekPath = "h:\\Binfo\\trends\\";/*测试用例*/
SeekPath = filePath.c_str();
strRst = "*.*";
tmp = "old\\";
handle = FindFirstFile(SeekPath+strRst,&fd);
if (handle!=INVALID_HANDLE_VALUE)
{
endtime = fd.ftLastWriteTime;
timeFormat = CTime(endtime);
if(timeFormat>newestTime)
{
newestTime = timeFormat;
}
if(timeFormat<=comparedTime)
{
//将filePath目录下查到的第一个日期早于(包括等于)comparedTime的文件移动到filePath\old目录下
MoveFileEx(SeekPath+fd.cFileName,SeekPath+tmp+fd.cFileName,MOVEFILE_WRITE_THROUGH);
DeleteFile(SeekPath+fd.cFileName);
}
else
{
//若第一个文件的最后修改时间比比较基准时间早,则放入fileNameList字符串型数组队列中
fileNameList.push_back( filePath + fd.cFileName );
}
while (FindNextFile(handle,&fd))
{
if(timeFormat>newestTime)
{
newestTime = timeFormat;
}
endtime = fd.ftLastWriteTime;
timeFormat = CTime(endtime);
if(timeFormat<=comparedTime)
{
//将filePath目录下日期早于(包括等于)comparedTime的文件移动到filePath\old目录下
MoveFileEx(SeekPath+fd.cFileName,SeekPath+tmp+fd.cFileName,MOVEFILE_WRITE_THROUGH);
DeleteFile(SeekPath+fd.cFileName);
}//end if
else
{
//剩下的文件都是比comparedTime新的,文件名都放入fileNameList
fileNameList.push_back(filePath + fd.cFileName);
}//end else
}//end while
}//end if
else
return ;
//如果文件handle错误,直接返回
}主要来自那个函数,可是不知道怎么回事,内存没有回收,初步觉得是win32_find_data 对象fd问题,可是不知道怎么回收.急救.......