几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(C++) (http://www.dimcax.com/hust/forumdisplay.php?f=34)
-   -   【转帖】求一完整的程序 (http://www.dimcax.com/hust/showthread.php?t=7794)

yang686526 2009-04-18 04:22 PM

【转帖】求一完整的程序
 
求一完整的程序
求一完整的程序
刚学objectarx,看见用向导生成的程序框架objectarx
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <windows.h>
#include <aced.h>
#include <rxregsvc.h>
#include <adslib.h>
#include <adsdlg.h>
#include <acutmem.h>
/***************************************************************************/
void initapp();
void unloadapp();
void helloworld();
/*************************************************************************/
extern "c" acrx::appretcode acrxentrypoint(acrx::appmsgcode msg, void* pkt)
{
switch (msg)
{
case acrx::kinitappmsg:
acrxdynamiclinker->unlockapplication(pkt);
acrxregisterappmdiaware(pkt);
initapp();
break;
case acrx::kunloadappmsg:
unloadapp();
break;
default:
break;
}
return acrx::kretok;
}
/********************************************************************************/
void initapp()
{
acedregcmds->addcommand("helloworld_commands","hello","hello",
acrx_cmd_transparent,helloworld);
}
/**********************************************************************************/
void unloadapp()
{
acedregcmds->removegroup("helloworld_commands");
}
/************************************************************************************/
void helloworld()
{
ads_point pt1,pt2;
int i;
struct resbuf rb1,rb2;
ads_getvar("osmode",&rb1);
rb2.restype=rtshort;rb2.resval.rint=(short)0;
ads_setvar("osmode",&rb2);
pt1[x]=0;pt2[x]=100;
pt1[y]=pt2[y]=0;
for (i=0;i<100;i++)
{
pt1[y]=pt2[y]=7*i;
ads_command(rtstr,"line",rtpoint,pt1,rtpoint,pt2,rtstr,"",0);
}
ads_setvar("osnap",&rb1);
ads_printf("\nhello world!");
}


所有的时间均为北京时间。 现在的时间是 10:34 PM.