别晨 发表于 2006-5-17 14:11:00

求一完整的程序

刚学ObjectARX,看见用向导生成的程序框架ObjectArx2002+VC6和ObjectArx2004+Vc.net2002有所不同,手头缺少arx2004的资料,谁有这方面的资料,能否共享一下<br>,另求一个用ObjectArx2004+Vc.net2002写的关闭冻结锁定所有图层的完整程序。^_^

wzz1968 发表于 2006-5-17 17:25:00

<P>#include &lt;stdio.h&gt;<BR>#include &lt;math.h&gt;<BR>#include &lt;string.h&gt;<BR>#include &lt;windows.h&gt;<BR>#include &lt;aced.h&gt;<BR>#include &lt;rxregsvc.h&gt;<BR>#include &lt;adslib.h&gt;<BR>#include &lt;adsdlg.h&gt;<BR>#include &lt;acutmem.h&gt;</P>
<P>/***************************************************************************/</P>
<P>void initApp();<BR>void unloadApp();</P>
<P>void helloWorld();<BR>/*************************************************************************/<BR>extern "C" AcRx::AppRetCode acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;switch (msg) <BR>&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;case AcRx::kInitAppMsg:<BR>&nbsp;&nbsp; acrxDynamicLinker-&gt;unlockApplication(pkt);<BR>&nbsp;&nbsp; acrxRegisterAppMDIAware(pkt);<BR>&nbsp;&nbsp; initApp();<BR>&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;case AcRx::kUnloadAppMsg:<BR>&nbsp;&nbsp; unloadApp();<BR>&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;default:<BR>&nbsp;&nbsp;break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;return AcRx::kRetOK;<BR>}<BR>/********************************************************************************/<BR>void initApp()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;acedRegCmds-&gt;addCommand("HELLOWORLD_COMMANDS","Hello","hello",<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ACRX_CMD_TRANSPARENT,helloWorld);<BR>}<BR>/**********************************************************************************/<BR>void unloadApp()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;acedRegCmds-&gt;removeGroup("HELLOWORLD_COMMANDS");<BR>}<BR>/************************************************************************************/<BR>void helloWorld()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ads_point pt1,pt2;<BR>&nbsp;&nbsp;&nbsp;&nbsp; int i;<BR>&nbsp;&nbsp;struct resbuf rb1,rb2;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ads_getvar("osmode",&amp;rb1);<BR>&nbsp;&nbsp;rb2.restype=RTSHORT;rb2.resval.rint=(short)0;<BR>&nbsp;&nbsp;ads_setvar("osmode",&amp;rb2);<BR>&nbsp;&nbsp;pt1=0;pt2=100;<BR>&nbsp;&nbsp;pt1=pt2=0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (i=0;i&lt;100;i++) <BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp; pt1=pt2=7*i;<BR>&nbsp;&nbsp;&nbsp;&nbsp; ads_command(RTSTR,"line",RTPOINT,pt1,RTPOINT,pt2,RTSTR,"",0);<BR>&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;ads_setvar("osnap",&amp;rb1);<BR>&nbsp;&nbsp;ads_printf("\nHello World!");<BR>}</P>
页: [1]
查看完整版本: 求一完整的程序