vten100 发表于 2010-6-27 01:42:00

为什么用executeInApplicationContext()新建的文档 用pDocItr->document()遍历不

为什么用executeInApplicationContext()新建的文档 用pDocItr->document()遍历不出来?<p><font face="Verdana">为什么用executeInApplicationContext()新建的文档 用pDocItr-&gt;document()遍历不出来?</font></p>
<p>&nbsp;</p>
<p>代码如下:</p>
<p>&nbsp;</p>
<p><font face="Verdana">static char pData[]="d:\\22.dwg";<br/>acDocManager-&gt;executeInApplicationContext(createdoc,(void* )pData);</font></p>
<p><font face="Verdana">&nbsp;&nbsp;AcApDocument *pDoc=NULL;</font></p>
<p>&nbsp;</p>
<p><font face="Verdana">&nbsp;AcApDocManager *pDocMgr = acDocManagerPtr();<br/>&nbsp;AcApDocumentIterator *pDocItr;<br/>&nbsp;pDocItr = pDocMgr-&gt;newAcApDocumentIterator();<br/>// &nbsp;AcApDocument *pDoc=NULL;<br/>&nbsp;CString ThisFilename;//="d:\\22.dwg";<br/>&nbsp;<br/>&nbsp;for(;!pDocItr-&gt;done();pDocItr-&gt;step())<br/>&nbsp;{<br/>&nbsp;&nbsp;pDoc = pDocItr-&gt;document();<br/>&nbsp;&nbsp;ThisFilename = pDoc-&gt;docTitle();<br/>&nbsp;&nbsp;&nbsp;acutPrintf("\n"+ThisFilename);&nbsp;&nbsp;<br/>&nbsp;&nbsp;if(strcmp(pData,ThisFilename)==0)//pData是要关闭的文档的name<br/>&nbsp;&nbsp;{<br/>&nbsp;&nbsp;&nbsp;acutPrintf("\n 文件关闭!");<br/>&nbsp;&nbsp;&nbsp;pDocMgr-&gt;closeDocument(pDoc);<br/>&nbsp;&nbsp;}<br/>&nbsp;}</font></p>
<p>&nbsp;</p>
<p>也就是说文档并没有被遍历到?为什么?盼高手指点!!!</p>
页: [1]
查看完整版本: 为什么用executeInApplicationContext()新建的文档 用pDocItr->document()遍历