1.Built a new class called CreateEnts successfully.
A new function named PostToModalSpace,it made me glad ,very glad.
AcDbObjectId CCreateEnt::PostToModalSpace(AcDbEntity* pEnt)
{
AcDbBlockTable* pBlockTable;
acdbHostApplicationServices()->workingDatabase()
->getBlockTable(pBlockTable,AcDb::kForRead);
AcDbBlockTableRecord* pBlockTableRecord;
pBlockTable->getAt(ACDB_MODEL_SPACE,pBlockTableRecord,AcDb::kForWrite);
AcDbObjectId entId;
pBlockTableRecord->appendAcDbEntity(entId,pEnt);
pBlockTable->close();
pBlockTableRecord->close();
pEnt->close();
return entId;
}
There is no direct help from the book , but I did it !
2.It's a very good way to study VC like this .
I promise ,I can do it .
3.Pay more attention to ID,pointer,and functions.