RTFEditor::Instance* RTFEditor::CreateInstance( const std::wstring& file ) { Instance* iv = new Instance; iv->AddRef(); iv->initializeMoeChild(file); if ( !iv->load(file) ) { iv->Release(); return 0; } statusBar()->status(100); return iv; }
Hex::Instance* Hex::CreateInstance(const std::wstring& file, bool readOnly) { std::wstring p(file); if ( mol::Path::exists(p) && mol::Path::isDir(p) ) return 0; Instance* e = new Instance; e->AddRef(); statusBar()->status(30); if (!e->initialize(p,readOnly)) { e->destroy(); e->Release(); return 0; } return e; }