// AfxMessageBox(_T("将文件从n1复制到n2(new)"));
if(finder1.IsDirectory()&&!finder1.IsDots())
{
SHFILEOPSTRUCT fileop;
fileop.hwnd = 0;
fileop.wFunc = FO_COPY;
fileop.pFrom = filestr1+finder1.GetFileName()+"\0";
fileop.pTo = filestr2+finder1.GetFileName()+"\0";
fileop.fFlags = FOF_SILENT|FOF_NOCONFIRMATION;
if (SHFileOperation(&fileop) != 0)
{ AfxMessageBox(_T("失败!")); }
//AfxMessageBox(finder1.GetFileName());
//n1FileCopy(fi1,fi2);
}filestr1,filestr2都是CString类型
不知错在哪?fileop.hwnd 这个值有问题吗?
if(finder1.IsDirectory()&&!finder1.IsDots())
{
SHFILEOPSTRUCT fileop;
fileop.hwnd = 0;
fileop.wFunc = FO_COPY;
fileop.pFrom = filestr1+finder1.GetFileName()+"\0";
fileop.pTo = filestr2+finder1.GetFileName()+"\0";
fileop.fFlags = FOF_SILENT|FOF_NOCONFIRMATION;
if (SHFileOperation(&fileop) != 0)
{ AfxMessageBox(_T("失败!")); }
//AfxMessageBox(finder1.GetFileName());
//n1FileCopy(fi1,fi2);
}filestr1,filestr2都是CString类型
不知错在哪?fileop.hwnd 这个值有问题吗?
{
CString tmp1=filestr1+finder1.GetFileName()+"\0";
CString tmp2=filestr2+finder1.GetFileName()+"\0";
SHFILEOPSTRUCT fileop;
fileop.hwnd = NULL;
fileop.wFunc = FO_COPY;
fileop.pFrom = tmp1;
fileop.pTo = tmp2;
fileop.fFlags = FOF_SILENT|FOF_NOCONFIRMATION;
if (SHFileOperation(&fileop) != 0)
{ AfxMessageBox(_T("失败!")); }
//AfxMessageBox(finder1.GetFileName());
//n1FileCopy(fi1,fi2);
}