cad新学生 发表于 2009-11-27 18:04:00

[求助]文档关闭问题

<p>这几天一直在研究多文档操作问题,现在又遇到了一个新问题!文档关闭文档问题:</p><p>下面的程序怎么实现不了关闭文档!高手帮助一下,项目要提交啦!在线等待。。。。。</p><p>&nbsp;for ( int i = 0 ; !pDocItr-&gt;done(); pDocItr-&gt;step(), i++ )<br/>&nbsp; {<br/><br/>&nbsp;&nbsp; npDoc = pDocItr-&gt;document();<br/>&nbsp;&nbsp; CString filename=npDoc-&gt;docTitle();<br/>&nbsp;&nbsp; if(filename.TrimRight()!="Drawing1.dwg")//当前文档不关闭<br/>&nbsp;&nbsp; {<br/><br/>&nbsp;&nbsp;&nbsp; acDocManager-&gt;setCurDocument(npDoc);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acDocManager-&gt;activateDocument(npDoc); <br/>&nbsp;&nbsp;&nbsp; acDocManager-&gt;lockDocument(npDoc);<br/>&nbsp;&nbsp;&nbsp; acdbSetDbmod(npDoc-&gt;database(),0);&nbsp;</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;acDocManager-&gt;unlockDocument(npDoc);<br/>&nbsp;&nbsp;&nbsp;&nbsp; acDocManager-&gt;closeDocument(npDoc) ;</p><p>&nbsp;&nbsp;&nbsp; }<br/>&nbsp;&nbsp; else<br/>&nbsp;&nbsp; {<br/>&nbsp;&nbsp;&nbsp; npDocdwg1=npDoc;</p><p>&nbsp;&nbsp; }<br/>&nbsp;&nbsp;&nbsp;&nbsp; }<br/>&nbsp; acDocManager-&gt;setCurDocument(npDocdwg1);<br/>&nbsp;&nbsp;&nbsp;&nbsp; acDocManager-&gt;activateDocument(npDocdwg1); <br/>&nbsp; delete pDocItr;</p>

cad新学生 发表于 2009-11-28 10:24:00

<p>程序本身没有问题,但却不能再打开一个文件的相同命令中操作!</p><p></p>
页: [1]
查看完整版本: [求助]文档关闭问题