📄 subject_52997.htm
字号:
<p>
序号:52997 发表者:Rikcuo Akira 发表日期:2003-09-16 15:33:27
<br>主题:delete pFtpConnection;執行這一行會出現Warning
<br>内容:delete pFtpConnection;執行這一行會出現Warning<BR>Warning: Disconnecting CInternetConnection handle 00CC0008 in context 00000000 at destruction.<BR><BR>private:// var<BR> CInternetSession *pInternetSession;<BR> CFtpConnection *pFtpConnection;<BR><BR>CFtpGet::CFtpGet()<BR>{<BR> // create an internet session<BR> pInternetSession = new CInternetSession(strAppName,<BR> INTERNET_OPEN_TYPE_PRECONFIG);<BR><BR> pFtpConnection = pInternetSession->GetFtpConnection(strServerName,<BR> strUser,<BR> strPass,<BR> 6001,<BR> TRUE);<BR><BR> <BR>}<BR><BR>CFtpGet::~CFtpGet()<BR>{ <BR> if(pFtpConnection != NULL)<BR> {<BR> delete pFtpConnection; //<BR> pFtpConnection=NULL;<BR> }<BR><BR> // delete the session<BR> if(pInternetSession != NULL)<BR> {<BR> // close the internet session<BR> pInternetSession->Close();<BR><BR> delete pInternetSession;<BR> pInternetSession=NULL;<BR> }<BR> <BR>}<BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:iwill 回复日期:2003-09-16 15:42:16
<br>内容:很正常啊,你没有手工关闭连接的话,该类的析构函数自动关闭.你在delete之前调用一下close就可以了
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:Rikcuo Akira 回复日期:2003-09-16 19:51:44
<br>内容:多謝
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -