注册扩展属性

Acad::ErrorStatus RegisterApp(AcDbDatabase* pDb, const TCHAR * pAppName)

{

AcDbRegAppTable* pAppTable;

Acad::ErrorStatus es;
// get the RegAppTable

if((es = pDb->getRegAppTable(pAppTable,AcDb::kForWrite)) != Acad::eOk)

return es;
// if RegAppTable has application already – fine

if(pAppTable->has(pAppName))

{

pAppTable->close();

return Acad::eOk;

}
AcDbRegAppTableRecord* pAppTableRecord = new AcDbRegAppTableRecord();

pAppTableRecord->setName(pAppName);
if((es = pAppTable->add(pAppTableRecord)) != Acad::eOk)

{

delete pAppTableRecord;

pAppTable->close();

return es;

}

pAppTableRecord->close();

pAppTable->close();

return es;

}

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

发表评论