[ARX][求助]一段简单的源代码,不知道那里错了,请大家帮我看看。
<FONT id=text1 style="FONT-SIZE: 10pt" face="宋体,verdana, arial, helvetica">今天写的画直线的程序<BR>#include <ACED.H><BR>#include <RXREGSVC.H><BR><BR>void initApp(); <BR>void unloadApp(); <BR>AcDbObjectId CreateLine(); <BR><BR>void initApp()<BR>{<BR>// 注册一个命令<BR>acedRegCmds->addCommand("CREATELINE_COMMANDS",<BR>"cline",<BR>"line",<BR>ACRX_CMD_TRANSPARENT,<BR>CreateLine);<BR>}<BR><BR>void unloadApp()<BR>{<BR>acedRegCmds->removeGroup("HELLOWORLD_COMMANDS");<BR>}<BR><BR>AcDbObjectId CreateLine()<BR>{<BR>AcGetpoint3d startPt(4.0, 2.0, 3.3);<BR>AcGetpoint3d endPt(1000.0, 1000.0, 2000.0);<BR>AcDbline *pLine=new AcDbline (startPt, endPt); <BR>AcDbBlockTable *pBlockTable<BR>acdbHoestApplicationServices()->workingDatabase()<BR>->getSymboiTable (pBlockTable, Acdb::kForRead);<BR>AcDbBlockTableRecord *pBlockTableRecord;<BR>pBlockTable=>getAt (ACDB_MODEL_SPACE.pBlockTableRcord,ACDb::kForRead);<BR>pBlockTable->clock();<BR>AcDbObjectId LineId;<BR>pBlockTableRecord->AppendAcDbEntry (LineId, pLine);<BR>pBlockTableRecord->close();<BR>pLine->close();<BR>Return lineId;<BR>}<BR><BR><BR>extern "C" AcRx::AppRetCode <BR>acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)<BR>{<BR>switch (msg) <BR>{<BR>case AcRx::kInitAppMsg:<BR>acrxDynamicLinker->unlockApplication(pkt);<BR>acrxRegisterAppMDIAware(pkt);<BR>initApp();<BR>break;<BR>case AcRx::kUnloadAppMsg:<BR>unloadApp();<BR>break;<BR>default:<BR>break;<BR>}<BR>return AcRx::kRetOK;<BR>}<BR>补充一下DEF文件如下<BR><BR>LIBRARY "Project"<BR><BR>EXPORTS<BR>acrxEntryPoint PRIVATE<BR>acrxGetApiVersion PRIVATE</FONT> <P><FONT size=2>pBlockTable=>getAt (ACDB_MODEL_SPACE.pBlockTableRcord,ACDb::kForRead);</FONT></P><P><FONT size=2></FONT> </P>
<P><FONT size=2>这里应该是kforwrite才可以新加入你画的实体</FONT></P> <P>0!原来是这样,好几个人都是这样说的,原来书上说错了 </P> 我改正了,可是还是能编译出来,应该还有误 VC6 好象只提示有错误,不像TC一样还提示你的哪一行有错误? <P><FONT size=2>pBlockTable->clock();</FONT></P>
<P><FONT size=2></FONT><BR><FONT size=2>pBlockTable->close();</FONT><BR></P> <P>真是麻烦大家了!没想到第一次写程序居然有这么多的错误!各位见笑了!</P>
<P>在失败中进步!哈哈</P> VC怎么可能只提示有错误呢?
页:
[1]