首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

internetsession类连接代码错误如何会被触发

2013-07-08 
internetsession类连接代码异常怎么会被触发?CString commandUINT ret 0command.Format(%s%d,/-wvh

internetsession类连接代码异常怎么会被触发?


        CString command;
UINT ret = 0;
command.Format("%s%d","/-wvhttp-01-/video.cgi?v=h264&duration",duration);
CInternetSession inet = CInternetSession(_T("SimpleH264DataExtract"));
CHttpConnection* pHttpCon = inet.GetHttpConnection(hostIp,CHttpConnection::HTTP_VERB_GET
,80,NULL,NULL);
CHttpFile* pFile = pHttpCon->OpenRequest(CHttpConnection::HTTP_VERB_GET,
command,NULL,1,NULL,_T("HTTP/1.1"),NULL);
try{
pFile->SendRequest();
}
catch(CInternetException* e)
{
CString err;
TCHAR buf[512];
e->GetErrorMessage(buf,512);
err.Format(_T("Error occurred:%d/ %s\n"),e->m_dwError,buf);
::AfxMessageBox(err,MB_OK|MB_ICONEXCLAMATION);
ret = -1;
goto EXIT;
}



[解决办法]
CInternetSession::GetHttpConnection 
这个也可能会触发CInternetException异常,也需要try{}catch()捕获~
[解决办法]
问的啥条件发生异常啊
引用:
CInternetSession::GetHttpConnection 
这个也可能会触发CInternetException异常,也需要try{}catch()捕获~

热点排行