|
我得到数据字典类时,出现异常,不知道为什么,谢谢,下面是代码.
AcDbDictionary *pNamedobj;
acdbHostApplicationServices()->workingDatabase()
->getNamedObjectsDictionary(pNamedobj, AcDb::kForRead);
// Get a pointer to the ASDK_DICT dictionary.
//
AcDbDictionary *pDict;
pNamedobj->getAt("SCALE_DICT", (AcDbObject*&)pDict,
AcDb::kForRead);
pNamedobj->close();
// Get an iterator for the ASDK_DICT dictionary.
//
if (pDict == NULL) {//pDict不为空
ASSERT(0);
return;
}
AcDbDictionaryIterator* pDictIter= pDict->newIterator();//在这句后出现异常
BSCScaleClass *pMyCl;
for (; !pDictIter->done(); pDictIter->next()) {
// Get the current record, open it for read, and
// print its data.
//
pDictIter->getObject((AcDbObject*&)pMyCl,
AcDb::kForRead);
pMyCl->gethScale(hs);
pMyCl->getvScale(vs);
pMyCl->close();
acutPrintf("\nintval is: %d", hs);
}
delete pDictIter;
pDict->close(); |
|