| 发表于:2008-01-16 16:23:42 楼主 |
我想通过chttpfile 来获取网页内容。函数代码比较简单,但是一直存在问题,请帮忙看看吧,谢谢了。 相关源代码如下: int cautobuxview::autoclixwebsite(cstring strurl) { cinternetsession mysession(null,0); chttpfile* myhttpfile=null; cstring stroneline; cstring strwebcontent; int i; myhttpfile=(chttpfile*)mysession.openurl(strurl); i=0; strwebcontent.empty(); stroneline.empty(); while (myhttpfile-> readstring(stroneline)) { i++; stroneline.makelower(); trace("%d:%s\n",i,stroneline); } myhttpfile-> close(); delete []myhttpfile; return 0; } 运行的时间弹出一个assert对话框,选择retry之后就跳到了mfc\src\dumpout.cpp 文件,并且指向 #ifdef _debug // all afxtrace output is controlled by afxtraceenabled if (!afxtraceenabled) return; #endif va_list args; va_start(args, lpszformat); int nbuf; tchar szbuffer[512]; nbuf = _vsntprintf(szbuffer, _countof(szbuffer), lpszformat, args); // was there an error? was the expanded string too long? assert(nbuf > = 0);// <--------------------------------------光标指向这一句 if ((afxtraceflags & tracemultiapp) && (afxgetapp() != null)) afxdump < < afxgetapp()-> m_pszexename < < ": "; afxdump < < szbuffer; va_end(args); } #endif //_debug 请高手看看是什么原因?如何解决?谢谢了。 |
|
|
|
|