一个pFtpConnection下,是否只能有一个CFtpFileFind?解决办法
一个pFtpConnection下,是否只能有一个CFtpFileFind?
RT
我想另建线程进行FTP文件夹的遍历下载,可是当我把pFtpConnection传递过去后,能GetFile,说明传递的是有效的,但在该下,再声明个CFtpFileFind,却总是返回0,GetLastError 12110,
如果真只能存在一个的话,该怎么做呢?
------解决方案--------------------
try
{
pSession=new CInternetSession();
pConnect=pSession-> GetFtpConnection (theApp.strServerIp,theApp.strServerUser,theApp.strServerPW);
MessageBox(L"连接成功");
m_pRemoteFinder=new CFtpFileFind(pConnect);
BrowseFolder(L"",&m_listView,m_pRemoteFinder);
}
catch(CInternetException * e)
{
e->ReportError();
pConnect = NULL;
pSession =NULL;
MessageBox(L"出现意外情况");
}
你在.h文件中定义:
CFtpFileFind *m_pRemoteFinder;
CInternetSession* pSession;
CFtpConnection* pConnect;
RT
我想另建线程进行FTP文件夹的遍历下载,可是当我把pFtpConnection传递过去后,能GetFile,说明传递的是有效的,但在该下,再声明个CFtpFileFind,却总是返回0,GetLastError 12110,
如果真只能存在一个的话,该怎么做呢?
------解决方案--------------------
try
{
pSession=new CInternetSession();
pConnect=pSession-> GetFtpConnection (theApp.strServerIp,theApp.strServerUser,theApp.strServerPW);
MessageBox(L"连接成功");
m_pRemoteFinder=new CFtpFileFind(pConnect);
BrowseFolder(L"",&m_listView,m_pRemoteFinder);
}
catch(CInternetException * e)
{
e->ReportError();
pConnect = NULL;
pSession =NULL;
MessageBox(L"出现意外情况");
}
你在.h文件中定义:
CFtpFileFind *m_pRemoteFinder;
CInternetSession* pSession;
CFtpConnection* pConnect;