bool MvcBook::OpenModel(MvcModel* pModel) { if(!pModel) { System::LogMessage("MvcBook::OpenModel: pModel is NULL"); return false; } if(!m_pBook) { System::LogMessage("MvcBook::OpenModel: m_pBook is NULL"); return false; } AutoPtrT<MvcView> pView; pView.reset(pModel->CreateView()); if(!pView) { System::LogMessage("MvcBook::OpenModel: pModel->CreateView return NULL"); return false; } if(!pView->OnCreated()) { System::LogMessage("MvcBook::OpenModel: pView->Create return false"); return false; } if(!AttachView(pView.get())) return false; pView.release(); return true; }
bool MvcBook::OpenModel(MvcModel* pModel) { if(!pModel) { System::LogMessage("MvcBook::OpenModel: pModel is NULL"); return false; } if(!m_pBook) { System::LogMessage("MvcBook::OpenModel: m_pBook is NULL"); return false; } LockGuard<WndUpdator> lock(WndManager::current().wup); AutoPtrT<MvcView> pView; pView.reset(pModel->CreateView()); if(!pView) { System::LogMessage("MvcBook::OpenModel: pModel->CreateView return NULL"); return false; } if(!pView->OnCreated()) { System::LogMessage("MvcBook::OpenModel: pView->Create return false"); return false; } if(!AttachView(pView.get())) return false; pView.release(); return true; }