异常查看部分代码

try
{
........................
}
catch(_com_error
&e)
{   
  CString strErrDescribe;
  strErrDescribe.Format("Exception thrown
for classes generated by #import"
            "\tCode
=%81x\n"
            "\tCode meaning
=%s\n"
            "\tSource
=%s\n"
            "\tDescription
=%s\n",
            e.Error(),
            e.ErrorMessage(),
            (LPCTSTR)(e.Source()),
            (LPCTSTR)(e.Description()));
        TRACE("
%%s\r\n", (LPCTSTR)e.Source(),(LPCSTR)e.Description());
       
       
char sLog[1024]= {0};
        sprintf(sLog, "
%%s %s",  e.ErrorMessage(),(LPCTSTR)e.Source(), (LPCSTR)e.Description());
............
}
catch(...)
{
.......
}

posted on 2012-09-04 15:25  默默地  阅读(155)  评论(0编辑  收藏  举报

导航