关于CFtpFileFind的问题
我的代码如下:
int CLHFtp::ListServerFiles(CString condition, CComboBox *pBox)
{
int filecount = 0;
CString FtpPath = condition;
bool show = false;
if(pBox != NULL)
show = true;
if(show)
{
pBox->ResetContent();
}
if(m_pFtpConnection==NULL)
return filecount;
CFtpFileFind ftpfind(m_pFtpConnection);
BOOL bfind=ftpfind.FindFile(FtpPath);
while(bfind)
{
bfind=ftpfind.FindNextFile();
CString strpath=ftpfind.GetFileTitle();
if(ftpfind.IsDirectory() )
{
}
else
{
if(show)
pBox->AddString(strpath);
filecount++;
}
}
return filecount;
}
奇怪的是假如有找到文件(数目和文件名都正确),在最后return filecount执行后,程序就死掉了。在某些机器上会,某些又不会。
请问哪位有碰到过,很头疼!