|
我有一端代码如下:
AcDbOle2Frame* pOleframe = new AcDbOle2Frame;
COleClientItem* item;
CDocument* pdoc = acedGetAcadDoc();
item=new COleClientItem((COleDocument*)pdoc);
item->CreateFromFile("d:\\share\\test.bmp");
pOleframe->setOleObject(item);
AcDbBlockTable* pBlockTable;
AcDbBlockTableRecord* pSpaceRecord;
AcDbObjectId objId;
acdbCurDwg()->getBlockTable(pBlockTable, AcDb::kForRead);
pBlockTable->getAt(ACDB_MODEL_SPACE, pSpaceRecord, AcDb::kForWrite);
pBlockTable->close();
pSpaceRecord->appendAcDbEntity(objId, pOleframe);
pOleframe->close();
pSpaceRecord->close();
该代码企图将一个OLE位图放入了数据库中,我调试的时候没有任何问题,当我保存这个DWG文件后,重新使用打开这个文件时,会报错"FATAL ERROR:Unhandled Access Violation Exception at 76aaadh",请教斑竹,这是什么原因呢?如能不吝告知,不胜感激!!!! |
|