try{
if (m_pArchiveOut != NULL)//这个地方老是出错~产生的异常用下面来捕捉,但是运行到这里就出错,异常无法捕捉~~~那位大哥以前遇到这种问题啊~~~~
{
pMsg->Serialize(*m_pArchiveOut);
m_pArchiveOut->Flush();
}
}
catch (CArchiveException* e)
{
e->ReportError();
e->Delete();
if(e->m_cause == CArchiveException::endOfFile)
{
AfxMessageBox("已读到文件尾");
}
else if(e->m_cause == CArchiveException::badIndex)
{
AfxMessageBox("文件格式错");
}
else if(e->m_cause == CArchiveException::readOnly)
{
AfxMessageBox("文件只能是读");
}
else if(e->m_cause == CArchiveException::writeOnly)
{
AfxMessageBox("文件只能是写");
}
else if(e->m_cause == CArchiveException::badClass)
{
AfxMessageBox("文件只能是读");
}
else if(e->m_cause == CArchiveException::readOnly)
{
AfxMessageBox("Tried to read an object into an object of the wrong type");
}
else if(e->m_cause == CArchiveException::badSchema)
{
AfxMessageBox("Tried to read an object with a different version of the class");
}
else
AfxMessageBox("CArchiveException::generic");
}
if (m_pArchiveOut != NULL)//这个地方老是出错~产生的异常用下面来捕捉,但是运行到这里就出错,异常无法捕捉~~~那位大哥以前遇到这种问题啊~~~~
{
pMsg->Serialize(*m_pArchiveOut);
m_pArchiveOut->Flush();
}
}
catch (CArchiveException* e)
{
e->ReportError();
e->Delete();
if(e->m_cause == CArchiveException::endOfFile)
{
AfxMessageBox("已读到文件尾");
}
else if(e->m_cause == CArchiveException::badIndex)
{
AfxMessageBox("文件格式错");
}
else if(e->m_cause == CArchiveException::readOnly)
{
AfxMessageBox("文件只能是读");
}
else if(e->m_cause == CArchiveException::writeOnly)
{
AfxMessageBox("文件只能是写");
}
else if(e->m_cause == CArchiveException::badClass)
{
AfxMessageBox("文件只能是读");
}
else if(e->m_cause == CArchiveException::readOnly)
{
AfxMessageBox("Tried to read an object into an object of the wrong type");
}
else if(e->m_cause == CArchiveException::badSchema)
{
AfxMessageBox("Tried to read an object with a different version of the class");
}
else
AfxMessageBox("CArchiveException::generic");
}
解决方案 »
- 监听accept后加入接收线程RecvProc,可以得到接收数据,不过用PostMessage投递回去失败
- 帮我看下CArchive的问题
- SDI中如何使用CTabCtrl?
- 请教:如何使用CTreeCtrl实现类似资源管理器的树形目录?
- 为对话框的一个Button空间加了一个CButton类型的变量,点击这个按钮,结果就出现了Wincore.cpp文件Line 980: 出错误.怎么回事?
- 163上的两条新闻
- 我现在要关闭掉输入法中的拼字窗口和选字窗口,只是让他不显示出来,但他的功能还是要和显示出来时一样,
- VC.Net使用DataGrid时出现了design-time license的问题怎么解决?
- 有谁在WINDOWSxp中用过add-in Visual Assist,我打开一段时间,他好象就不起作用那,最后退出VC时,还出现BUG.
- VC的picture控件中图像的重叠显示问题
- Dll關於new CDynLinkLibrary(ExtDllDLL);的問題
- 一个基于对话框程序中,多线程应写到哪里去呢?
~~~