编译出错,提示cannot convert parameter 3 from 'void (__cdecl *)(void)' to 'bool *'
boolConnecToServer(void){charsourcefile[80],destfile[80];chartpsuser[]="TestProg1";ch...
bool ConnecToServer(void)
{
char sourcefile[80],destfile[80];
char tpsuser[] = "TestProg1";
char tpspassword[] = "Test08Prog";
int no = checkRandomno();
for (int k=0; k< no; k++)
{
CString radm = checkradm();
if ( radm == "1" ) continue;
else
{
sprintf(sourcefile,"/123/%s",(LPCTSTR)radm);
sprintf(destfile, "456");
CFTPClient *FTPClient;
FTPClient = new CFTPClient;
try
{
FTPClient->Login(szHost,tpsuser,tpspassword);
}
catch (CFTPException *pEx)
{
CString Except;
Except.Format("%s",pEx->m_sDesc);
AfxMessageBox(Except);
delete FTPClient;
return false;
}
Sleep(500);
try
{
FTPClient->Download(sourcefile,destfile,abort,false);
}
catch (CFTPException *pEx)
{
try
{
CString Except;
Except.Format("%s",pEx->m_sDesc);
FTPClient->Download(sourcefile,destfile,abort,false);
}
catch (CFTPException *pEx)
{
CString Except;
Except.Format("%s",pEx->m_sDesc);
delete FTPClient;
AfxMessageBox("Error Downloading Random file");
return false;
}
}
FTPClient->Logoff();
delete FTPClient;
}
}
return true;
}
编译的时候总是出现cannot convert parameter 3 from 'void (__cdecl *)(void)' to 'bool *' There is no context in which this conversion is possible。
应该如何解决?
定义的
void Download (const CString &sRemoteFiles, const CString &sLocalFolder, bool *pbAbort, bool bRecursive = true, DWORD dwTransferType = FTP_TRANSFER_TYPE_BINARY);
其他的类也有调用这个函数,但是没有什么问题 展开
{
char sourcefile[80],destfile[80];
char tpsuser[] = "TestProg1";
char tpspassword[] = "Test08Prog";
int no = checkRandomno();
for (int k=0; k< no; k++)
{
CString radm = checkradm();
if ( radm == "1" ) continue;
else
{
sprintf(sourcefile,"/123/%s",(LPCTSTR)radm);
sprintf(destfile, "456");
CFTPClient *FTPClient;
FTPClient = new CFTPClient;
try
{
FTPClient->Login(szHost,tpsuser,tpspassword);
}
catch (CFTPException *pEx)
{
CString Except;
Except.Format("%s",pEx->m_sDesc);
AfxMessageBox(Except);
delete FTPClient;
return false;
}
Sleep(500);
try
{
FTPClient->Download(sourcefile,destfile,abort,false);
}
catch (CFTPException *pEx)
{
try
{
CString Except;
Except.Format("%s",pEx->m_sDesc);
FTPClient->Download(sourcefile,destfile,abort,false);
}
catch (CFTPException *pEx)
{
CString Except;
Except.Format("%s",pEx->m_sDesc);
delete FTPClient;
AfxMessageBox("Error Downloading Random file");
return false;
}
}
FTPClient->Logoff();
delete FTPClient;
}
}
return true;
}
编译的时候总是出现cannot convert parameter 3 from 'void (__cdecl *)(void)' to 'bool *' There is no context in which this conversion is possible。
应该如何解决?
定义的
void Download (const CString &sRemoteFiles, const CString &sLocalFolder, bool *pbAbort, bool bRecursive = true, DWORD dwTransferType = FTP_TRANSFER_TYPE_BINARY);
其他的类也有调用这个函数,但是没有什么问题 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询