KERNEL32! 7c812afb()
MSVCRTD! _CxxThrowException@8 + 57 bytes
AfxThrowInternetException(unsigned long 1, unsigned long 12002) line 2751
CInternetFile::ReadString(char * 0x044ab8f4, unsigned int 15) line 1178
CInternetFile::ReadString(CString & {"href="http://list.mp3.baidu.com/list/bangping(070208).html" target="_blank">2007-02-08</A><A href="http://list.mmp3.baidu.com/list/bangping(070301).html" target="_blank">2007-03-01</A><A "}) line 1220 + 20 bytes
DownloadFile(void * 0x00f86f08) line 400 + 20 bytes
_AfxThreadEntry(void * 0x0388fd1c) line 112 + 13 bytes
_threadstartex(void * 0x01028100) line 212 + 13 bytes
KERNEL32! 7c80b729()
catch(CInternetException *pEx)
{
if(pServer!=NULL)
{
pServer->Close();
delete pServer;
}
if(pHttpFile!=NULL)
{
pHttpFile->Close();
delete pHttpFile;
}
pEx->Delete();
MyConnect.Close();
if (ptr!=NULL)
{
ptr->mm_DownLoadData.DeleThread();
ptr->AddString(URL+"\r\nDownload failed!\r\n",0);
}
return 0;
}
MSVCRTD! _CxxThrowException@8 + 57 bytes
AfxThrowInternetException(unsigned long 1, unsigned long 12002) line 2751
CInternetFile::ReadString(char * 0x044ab8f4, unsigned int 15) line 1178
CInternetFile::ReadString(CString & {"href="http://list.mp3.baidu.com/list/bangping(070208).html" target="_blank">2007-02-08</A><A href="http://list.mmp3.baidu.com/list/bangping(070301).html" target="_blank">2007-03-01</A><A "}) line 1220 + 20 bytes
DownloadFile(void * 0x00f86f08) line 400 + 20 bytes
_AfxThreadEntry(void * 0x0388fd1c) line 112 + 13 bytes
_threadstartex(void * 0x01028100) line 212 + 13 bytes
KERNEL32! 7c80b729()
catch(CInternetException *pEx)
{
if(pServer!=NULL)
{
pServer->Close();
delete pServer;
}
if(pHttpFile!=NULL)
{
pHttpFile->Close();
delete pHttpFile;
}
pEx->Delete();
MyConnect.Close();
if (ptr!=NULL)
{
ptr->mm_DownLoadData.DeleThread();
ptr->AddString(URL+"\r\nDownload failed!\r\n",0);
}
return 0;
}
解决方案 »
- 散分,
- 模拟CONTROL+ALT可以吗?
- 请问大家是如何搜索WPARAM wparam,LPARAM lparam两个参数对于不同的Windows消息或回调函数的意义呢?
- 小鸟提问:用CBlush Ellipse画红色圆,有黑色边界,如何去掉黑色边界。在线等
- 如何让一个类中的两个方法共享大家的局部变量,但其他方法却不能访问这些变量?
- 请问如何获得窗口类型?
- 高分求socks5代理方面得资料,大家快来抢分呀
- 急需解决:如何给对话框,或者FormView加上一个分隔条?高手指点呀!!!!!
- 想散分,糊里糊涂结贴了,可还有问题不清楚。
- 抓取网页之后改如何处理字符集问题?
- 关于画图
- 怎么修改基于对话框程序的外观
[/Quote try
{
if (!AfxParseURL(URL, dwServiceType, strServerName, strObject, nPort) ||dwServiceType != INTERNET_SERVICE_HTTP)
{
THROW(new CInternetException(dwServiceType));
}
pServer=MyConnect.GetHttpConnection(strServerName, nPort);
if (pServer!=NULL)
{
pHttpFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_GET,
strObject, NULL, 1, NULL, NULL);
if (pHttpFile!=NULL)
{
pHttpFile->AddRequestHeaders(_T("Accept: text/*\r\nUser-Agent: MFC\r\n"));
pHttpFile->SendRequest();
DWORD StatusCode;
pHttpFile->QueryInfoStatusCode(StatusCode);
//file isn't there or is redirected
if (StatusCode == HTTP_STATUS_MOVED ||StatusCode == HTTP_STATUS_REDIRECT ||StatusCode == HTTP_STATUS_REDIRECT_METHOD)
{
CString strNewLocation;
pHttpFile->QueryInfo(HTTP_QUERY_RAW_HEADERS_CRLF, strNewLocation);
int nPlace = strNewLocation.Find(_T("Location: "));
if (nPlace == -1)
{
THROW(new CInternetException(StatusCode));
}
strNewLocation = strNewLocation.Mid(nPlace + 10);
nPlace = strNewLocation.Find('\n');
if (nPlace > 0)
strNewLocation = strNewLocation.Left(nPlace);
// close up the redirected site
pHttpFile->Close();
delete pHttpFile;
pServer->Close();
delete pServer;
// figure out what the old place was
if (!AfxParseURL(strNewLocation, dwServiceType, strServerName, strObject, nPort))
{
THROW(new CInternetException(StatusCode));
}
if (dwServiceType != INTERNET_SERVICE_HTTP)
{
THROW(new CInternetException(StatusCode));
}
// try again at the new location
pServer = MyConnect.GetHttpConnection(strServerName, nPort);
if (pServer!=NULL)
{
pHttpFile = pServer->OpenRequest(CHttpConnection::HTTP_VERB_GET,
strObject, NULL, 1, NULL, NULL);
if (pHttpFile!=NULL)
{
pHttpFile->AddRequestHeaders(_T("Accept: text/*\r\nUser-Agent: MFC\r\n"));
pHttpFile->SendRequest();
pHttpFile->QueryInfoStatusCode(StatusCode);
}
}
}
if (StatusCode != HTTP_STATUS_OK)
{
THROW(new CInternetException(StatusCode));
}
}
}
}
]