zyygood 发表于 2007-6-6 10:03:00

[求助]AcDbDictionary 不能往为写?

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