//*********************************************************************************************** void CParticleWorkspace::save() throw(NLMISC::EStream) { NLMISC::COFile stream; stream.open(_Filename); NLMISC::COXml xmlStream; xmlStream.init(&stream); this->serial(xmlStream); clearModifiedFlag(); }
void CWaterPoolEditor::OnSavePool() { static char BASED_CODE szFilter[] = "NeL Water Pool Files (*.wpf)|*.wpf||"; CFileDialog fileDlg( TRUE, ".wpf", "*.wpf", OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFilter); if (fileDlg.DoModal()==IDOK) { try { NLMISC::COXml oXml; NLMISC::COFile oF; if (oF.open((LPCTSTR) fileDlg.GetPathName())) { if (oXml.init (&oF)) { _Wpm->serial(oXml); oXml.flush(); oF.close(); } else { oF.close(); MessageBox (("Unable to init xml stream from file : " + std::string((LPCTSTR) fileDlg.GetPathName())).c_str(), "NeL object viewer", MB_OK|MB_ICONEXCLAMATION); } } else { MessageBox (("Unable to open file : " + std::string((LPCTSTR) fileDlg.GetPathName())).c_str(), "NeL object viewer", MB_OK|MB_ICONEXCLAMATION); } } catch (NLMISC::Exception& e) { MessageBox (e.what(), "NeL object viewer", MB_OK|MB_ICONEXCLAMATION); } } }