#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!"); } |