#include "stdafx.h" #include "TReactorAssociate.h" #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif TReactorAssociate::TReactorAssociate(AcDbDatabase* pOwnerDb, AcDbDatabaseReactor* pReactor) { m_pOwnerDb = pOwnerDb; m_pReactor = pReactor; if (m_pOwnerDb != NULL && m_pReactor != NULL) { m_pOwnerDb->removeReactor(m_pReactor); } } TReactorAssociate::~TReactorAssociate() { if (m_pOwnerDb != NULL && m_pReactor != NULL) { m_pOwnerDb->addReactor(m_pReactor); } } //TCurDocumentLock ////////////////////////////////////////////////////////////////////////// TCurDocumentLock::TCurDocumentLock() { m_pDoc = acDocManager->curDocument(); if (acDocManager->lockDocument(m_pDoc, AcAp::kWrite) != Acad::eOk) { // Ëø¶¨Ê§°Ü m_pDoc = NULL; } } TCurDocumentLock::~TCurDocumentLock() { if (m_pDoc != NULL) { acDocManager->unlockDocument(m_pDoc); } }