void CMOVEDlg::CopyFile(CString destdir)//destinaton directoty is E { CFileFind tempFind; CString tempFileFind; tempFileFind.Format("%s\\*.doc",destdir); BOOL IsFinded=(BOOL)tempFind.FindFile(tempFileFind); while(IsFinded)://when no word file(*.doc) in the based directoty in D, bWorking is wrong and can't come into the while loop.But I want to find and copy all doc file in D.What should I do? { IsFinded=(BOOL)tempFind.FindNextFile(); if(!tempFind.IsDots()) { CString foundFileName; foundFileName=tempFind.GetFileName(); if(tempFind.IsDirectory()) { CString tempDir; tempDir.Format("%s\\%s",destdir,foundFileName); CopyFile(tempDir); } else { CString tempFileName1,tempFileName2; tempFileName1.Format("%s\\%s",dir,foundFileName); tempFileName2.Format("%s\\%s",m_Path,foundFileName); ::CopyFile(tempFileName1,tempFileName2,FALSE); } } } tempFind.Close(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)