zhangyeqin 发表于 2006-12-19 18:51:00

[求助]关于打开文件的问题[/我是新手]

<p>偶是新手,各位大虾帮帮忙吧。。。。多谢了~~</p><p>在autocad2006下面,想实现打开一个dwg文件的功能。代码如下:</p><p>void openDocHelper(void *dwgpath)<br/>{<br/>&nbsp;AcApDocument* pDoc = acDocManager-&gt;curDocument();<br/>&nbsp;CString* tmp = (CString*)dwgpath;<br/>&nbsp;if(acDocManager-&gt;isApplicationContext()){<br/>&nbsp;&nbsp;Acad::ErrorStatus result = acDocManager-&gt;appContextOpenDocument((const char *)dwgpath);<br/>&nbsp;&nbsp;if(result != Acad::eOk)<br/>&nbsp;&nbsp;&nbsp;acutPrintf("\nERROR: %s\n", acadErrorStatusText(result));&nbsp;<br/>&nbsp;}else<br/>&nbsp;&nbsp;acutPrintf("\nERROR: in Document context :%s\n",acDocManager-&gt;curDocument()-&gt;fileName());<br/>}</p><p>void OpenDwg(CString dwgpath){<br/>&nbsp;if(acDocManager-&gt;isApplicationContext()){<br/>&nbsp;&nbsp;Acad::ErrorStatus result = acDocManager-&gt;appContextOpenDocument(dwgpath);<br/>&nbsp;&nbsp;if(result != Acad::eOk){<br/>&nbsp;&nbsp;&nbsp;acutPrintf("\nERROR: %s\n", acadErrorStatusText(result));<br/>&nbsp;&nbsp;}&nbsp;&nbsp;<br/>&nbsp;}else{<br/>&nbsp;&nbsp;acDocManager-&gt;executeInApplicationContext(openDocHelper, &amp;dwgpath);<br/>&nbsp;}&nbsp;<br/>}</p><p>========================================</p><p>当我调用OpenDwg(some file);时,总是返回eFilerError ,这是怎么回事啊??</p><p>静待各位大虾解答,多谢了。。。</p>
页: [1]
查看完整版本: [求助]关于打开文件的问题[/我是新手]