![]() |
【转帖】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. |