Sorry, I'm using Win 2k Simplified Chinese version, so I don't know what the error message is in English. But I think it should be something like "0xxxxxx" instruction referenced to "xxxxxxxx" address error, the memory cannot be 'read'. Here is the content searching function: void MultiThreadSearch::IterFind( CFtpConnection *pFTP, LPCTSTR szStrToFind, LPCTSTR dircontent, int maxdepth, BOOL bOmit, int index, int depth) { MSG msg; CStringArray csDirectories; long directories=0; BOOL bFlag=FALSE; BOOL bNeedSearch=TRUE; if(maxdepth!=-1&&depth>maxdepth) return; CMyFtpFileFind finder(pFTP); bFlag=finder.FindFile(NULL,INTERNET_FLAG_DONT_CACHE| INTERNET_FLAG_RESYNCHRONIZE); while(bFlag) { if(bQuit) { return; } if(::PeekMessage(&msg,NULL,NULL,NULL,PM_REMOVE)) { ::TranslateMessage(&msg); ::DispatchMessage(&msg); } bFlag=finder.FindNextFile(); CString yytemp=szMainTitle; yytemp+=finder.MyGetFileURL(); (AfxGetApp()->GetMainWnd())->SetWindowText(yytemp); bNeedSearch=FALSE; if(finder.IsDirectory()|| finder.MatchesMask(FILE_ATTRIBUTE_REPARSE_POINT)) { BOOL bResult=FALSE; if(finder.IsDirectory()) { if(finder.IsDots()) { bResult=TRUE; } } if(bResult) { continue; } if(depth<=maxdepth) { CString xxx=finder.GetFileName(); if(dircontent==NULL) { bNeedSearch=TRUE; } else if(bOmit) { xxx.MakeUpper(); if(xxx.Find(dircontent)!=-1) { bNeedSearch=TRUE; } } else if(xxx.Find(dircontent)!=-1) { bNeedSearch=TRUE; } if(bQuit) { return; } if(bNeedSearch) { directories++; CString ttt=finder.GetFileName(); csDirectories.Add(ttt); BOOL bGotIt=FALSE; if(bOmit) { ttt.MakeUpper(); LPSTR pStr=ttt.LockBuffer(); if(regular.Search(pStr)) { bGotIt=TRUE; } ttt.UnlockBuffer(); } else { LPSTR pStr=ttt.LockBuffer(); if(regular.Search(pStr)) { bGotIt=TRUE; } ttt.UnlockBuffer(); } if(bQuit) { return; } if(bGotIt) { CString xx=finder.MyGetFilePath(); CWftp1Dlg *pDlg=(CWftp1Dlg*)CWftp1Dlg::FromHandle(hWnd); CTreeCtrl *pTree=(CTreeCtrl*)pDlg->GetDlgItem(IDC_TREE_FTPS); pTree->InsertItem(xx, *((HTREEITEM*)arAllFTPs.GetAt(index))); pTree->Expand(*((HTREEITEM*)arAllFTPs.GetAt(index)), TVE_EXPAND); } } }