锁定文档

//GLockDocument.h

#pragma once
#include “acdocman.h”

 

class GLockDocument
{
public:
GLockDocument()
{
pDoc=NULL;
if(acDocManager != NULL)
{
try
{
pDoc = acDocManager->curDocument();
if ((pDoc != NULL) && (acDocManager->lockDocument(pDoc) != Acad::eOk))
{
pDoc=NULL;
}
}
catch(…)
{}
}
}

~GLockDocument()
{
if ((acDocManager != NULL) && (pDoc != NULL))
{
try
{
acDocManager->unlockDocument(pDoc);
}
catch(…)
{}
}
}

private:
AcApDocument* pDoc;
};

此条目发表在ObjectArx分类目录,贴了, , 标签。将固定链接加入收藏夹。

发表评论