By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

How to search the files in the directory with CFTPFileFind.filefind?

P: 1
Friends,
I am not able to search the files in the directory as the CFTPFileFind.filefind is returning 0 please correct in OnDblclkList1() function
Expand|Select|Wrap|Line Numbers
  1. void CFtp_sample1Dlg::OnOK() 
  2. {
  3.  
  4.     CString str1;
  5.  
  6.  
  7.     try
  8.     {
  9.  
  10.  
  11.         ctp1->GetCurrentDirectory(str1);
  12.  
  13.         ctp1->SetCurrentDirectory("pub/software");
  14.  
  15.  
  16.     //    ctp1->PutFile("draw.exe","draw1.exe");
  17.     //    WaitForSingleObject(ctp1,INFINITE);
  18.  
  19.     //    ctp1->GetFile("freenet_navigatorBB8100.zip","mm1.zip",TRUE);
  20.     //    WaitForSingleObject(ctp1,INFINITE);
  21.  
  22.     //    ctp1->SetCurrentDirectory("software");      
  23.  
  24.  
  25.         CFtpFileFind find(ctp1);       
  26.         BOOL bloop = find.FindFile("*");
  27.  
  28.  
  29.         while (bloop)
  30.         {
  31.             bloop = find.FindNextFile();
  32.  
  33.             m_list1.AddString(find.GetFileName());
  34.  
  35.             UpdateData(FALSE);
  36.             m_list1.SetFocus();                
  37.         }
  38.  
  39.  
  40.     }
  41.     catch(CInternetException e)
  42.     {
  43.         AfxMessageBox("Unable to establish the connection");
  44.     }
  45.  
  46.  
  47.  
  48. }
  49.  
  50. void CFtp_sample1Dlg::OnDblclkList1() 
  51. {    
  52.     CString str3;
  53.     m_list1.GetText(m_list1.GetCurSel(),str3);
  54.     //ctp1->GetFile(str3,"man1.zip");
  55.     ctp1->SetCurrentDirectory(str3);
  56.     CFtpFileFind file2(ctp1);
  57.     BOOL loop = file2.FindFile("*");
  58.     while(loop)
  59.     {
  60.     }
  61.  
Dec 8 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.