我想遍历打开文件中的实体,程序如下:es =pBlockTableRecord4->newIterator(pIter); 运行到这句就报错,unhandled exception 之类的,这段代码我原来在2002上用没问题的。大家有遇到这种问题吗?我的编程环境:vs2005+AutoCAD2007+objectarx2007.而且我把代码中的遍历类型换成层遍历,又可以正常运行,挺奇怪的。 AcDbDatabase *pCurDb = NULL; Acad::ErrorStatus es; int i; AcDbBlockTable *pBlockTable4; acDocManager->lockDocument( acDocManager->curDocument(), AcAp::kWrite, NULL, NULL,true) ; pCurDb = acdbHostApplicationServices()->workingDatabase(); es =pCurDb->getSymbolTable(pBlockTable4, AcDb::kForRead);// if (es != Acad::eOk) { acutPrintf(_T("\ngetSymbolTable!")); } acutPrintf(_T("\n2!")); AcDbBlockTableRecord *pBlockTableRecord4; es =pBlockTable4->getAt(ACDB_MODEL_SPACE, pBlockTableRecord4,AcDb::kForWrite); if (es != Acad::eOk) { acutPrintf(_T("\ngetAt!")); } acutPrintf(_T("\n3!")); AcDbBlockTableRecordIterator *pIter; //AcDbBlockTableRecordPointer pBTR(ACDB_MODEL_SPACE,acdbHostApplicationServices()->workingDatabase(),AcDb::kForRead); es =pBlockTableRecord4->newIterator(pIter); //获得遍历指针,true,true acutPrintf(_T("\n5!")); if (es != Acad::eOk) { acutPrintf(_T("\ngetAt!")); } |