Here is an image that shows the structure of my folder:
So, I basically want to copy and paste all the jpg. files in ID1. As shown in the image, there are two ID1 sub folders (highlighted yellow) that contains the jpg. files that I want.
I have a few struggles:
1) I only know how to copy one image specifically from one path
CFileStatus status;
CString strFileName = m_Values.LotID + _T(".jpg");
CString strFilePath = m_strImagePath + _T("\\") + strFileName;
CString strCopyPath = m_strCopyPath + _T("\\") + strFileName;
if(CFile::GetStatus(strFilePath, status))
{
CopyFile(strFilePath, strCopyPath, FALSE);
}
2) I do not know how to iterate through all the sub folders to look for ID1 & its contents. (Because I don't know, I've no example codes to start with)
Output:
Let's say, I'm able to extract all the .jpg files from ID1 & paste into Folder2, the folder structure should look a little like this:
Since I did not provide much of code, I don't expect a full code to solve the problem. Any explanation or insights would be adequate. Do help me out & thank you in advance.