我用mfc做了一个窗体,窗体加了一个按钮, 下面是按钮里面的代码, AcDbDictionary *pNOD; if(acdbHostApplicationServices()->workingDatabase()->getNamedObjectsDictionary(pNOD,AcDb::kForWrite) != Acad::eOk) { return; } AcDbObjectId id0; //AcDbDictionary *pMyDict; AcDbDictionary *pDict = new AcDbDictionary; if (pNOD->getAt(_T("Flow_Data"),id0) == Acad::eKeyNotFound) { //pNOD->upgradeOpen(); pDict = new AcDbDictionary; pNOD->setAt(_T("Flow_Data"),pDict,id0); ................ ........... } pNOD->close(); //Add a new xrecord 编译没有错误,加载运行后,就会出错,就是执行到 if(acdbHostApplicationServices()->workingDatabase()->getNamedObjectsDictionary(pNOD,AcDb::kForWrite) != Acad::eOk) 这句就退出了, 谁知道是为什么呀,怎么AdDbDicitonary 不能以写的方式带开,
注: 我创建窗口时候,用的mfc中的类,没有用 AutoCAD中扩展的mfc类
|