查看单个帖子
旧 2009-05-05, 09:47 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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:nsavedocument(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
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)