查看单个帖子
旧 2009-04-18, 04:22 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】求一完整的程序

求一完整的程序
求一完整的程序
刚学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!");
}
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)