|
发表于 2006-5-17 17:25:00
|
显示全部楼层
#include
#include
#include
#include
#include
#include
#include
#include
#include
/***************************************************************************/
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 |
|