you shouldn't reuse a global like
m_editvalue
inside your recursive function like that, it will build up the wrong string. Instead, try to pass in the value of
m_editvalue
when calling the function and then have the function create new paths based on the input rather than the members of the surrounding class.
Something like this might work for you;
void CListfilesDlg::recursion(CString sPath)
{
HANDLE hFind;
WIN32_FIND_DATA fdFind;
UpdateData(true);
CString ren = sPath + "\\*.*";
hFind = FindFirstFile( ren, &fdFind );
do
{
if( fdFind.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY )
{
if(IsDots(fdFind.cFileName))
continue;
FtpCreateDirectory(hIConnect,fdFind.cFileName);
UpdateData(true);
UpdateData(false);
CString newPath = sPath + "\\" + fdFind.cFileName;
recursion(newPath);
}
if(fdFind.dwFileAttributes == FILE_ATTRIBUTE_ARCHIVE)
continue;
}
while(FindNextFile( hFind, &fdFind ) );
}
Call the function like this;
recursion(m_editvalue);
and it should work.
Hope this helps,
Fredrik