菜鸟问:网络文件传输的问题?急!急!急!.........不好意思!我只有这点分

fieldsoft 2001-06-12 09:16:00
刚开始学网络编程,应用向导生成一个程序框架,在CHqtranView视图类头文件中定义两个成员变量:CInternetSession* m_pInternetSession;
CFtpConnection* m_pFtpConnection;想简单地实现网络文件传输,编译时可以通过,但运行时却提示错误:
Debug Assertion Failed!
Program:E:\dth\hqtran\Debug\hqtran.exe
File:afxwin2.inl
Line:168

For information on how your program can cause an assertion
failure,see the Visual C++ documetation on asserts;
(Press Retry to debug the application)
望高手不吝赐教,谢谢!zy_dth@163.com
原程序相关代码如下:// hqtranView.cpp : implementation of the CHqtranView class
//

#include "stdafx.h"
#include "hqtran.h"
#include "hqtranDoc.h"
#include "hqtranView.h"

CHqtranView::CHqtranView()
{
m_pInternetSession=new CInternetSession;
SetTimer(1,30000,NULL);
// TODO: add construction code here

}

CHqtranView::~CHqtranView()
{
KillTimer(1);
if(m_pInternetSession!=NULL)
delete m_pInternetSession;
}





void CHqtranView::OnTimer(UINT nIDEvent)
{
try
{
m_pFtpConnection=m_pInternetSession->GetFtpConnection("ftp.microsoft.com");
}
catch(CInternetException* pEx)
{
pEx->Delete();
m_pFtpConnection=NULL;
}
m_pFtpConnection->PutFile("test.txt","test.txt");
// TODO: Add your message handler code here and/or call default

CView::OnTimer(nIDEvent);
}
...全文
90 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
fieldsoft 2001-06-12
  • 打赏
  • 举报
回复
是不是我的问题太菜了??????。。。。
fieldsoft 2001-06-12
  • 打赏
  • 举报
回复
怎么没人理我?各位大哥请帮帮忙吧!我就这点分了

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧