qq_40139681
古董house
2018-12-17 10:53

MFC编写FTP客户端程序,出现filefind.cpp逻辑错误。debug assertion failed

  • c++

如题,通过了编译,但是在执行时出现了debug assertion failed错误,定位到了这里

```BOOL CFTP_ClientDlg::GetFile(CString fname, CString pname)
{
CInternetSession *psession;
CFtpConnection *pconnection;
pconnection=NULL;
//建立internet会话
psession=new CInternetSession(AfxGetAppName(),1,PRE_CONFIG_INTERNET_ACCESS);
try
{
pconnection=psession->GetFtpConnection(m_dname,m_user,m_psw);
}
catch(CInternetException *e)
{
e->Delete();
pconnection=NULL;
return FALSE;
}
if(pconnection!=NULL)
{
if(!pconnection->GetFile(fname,pname))
{
pconnection->Close();
delete pconnection;
delete psession;
return FALSE;
}
}
if(pconnection!=NULL)
{
pconnection->Close();
delete pconnection;
}
delete psession;
return TRUE;
}

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

0条回答

为你推荐

换一换