几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】error trapping for saving dwg files (http://www.dimcax.com/hust/showthread.php?t=16114)

yang686526 2009-05-05 09:47 AM

【转帖】error trapping for saving dwg files
 
error trapping for saving dwg files.
error trapping for saving dwg files.
i currently use this code:
code:
// actually write the file
pdb->writefile( pfile, etype, eversion, true, pssettings->idecimalplaces );
bsaved = true;
}
catch( oderror& )
{
afxmessagebox(_t("error saving drawing!"), mb_iconerror|mb_ok);
}
catch(...)
{
}
i would like it to be a bit better, for example, telling the user why it failed to save. eg: the file is open in autocad or something.
it is not clear to me the correct syntax/methods i should be using here to ascertain this information.
thanks for your help.
andrew
look into odamfcapp sample. odamfcappdoc.cpp
code:
bool codamfcappdoc::onsavedocument(lpctstr lpszpathname)
{
....
catch(oderror& e)
{
theapp.reporterror("error saving document...", e);
...
oderror has code() and description() methods. the last one returns a message in text form.
sergey slezkin


所有的时间均为北京时间。 现在的时间是 07:26 PM.