//-----------------------------------------------------------------------------
//----- acrxEntryPoint.cpp
//-----------------------------------------------------------------------------
#include "StdAfx.h"
#include "resource.h"
//-----------------------------------------------------------------------------
//----- ObjectARX EntryPoint
class CTestLispApp : public AcRxArxApp {
public:
CTestLispApp () : AcRxArxApp () {}
virtual AcRx::AppRetCode On_kInitAppMsg (void *pkt) {
AcRx::AppRetCode retCode =AcRxArxApp::On_kInitAppMsg (pkt) ;
return (retCode) ;
}
virtual AcRx::AppRetCode On_kUnloadAppMsg (void *pkt) {
AcRx::AppRetCode retCode =AcRxArxApp::On_kUnloadAppMsg (pkt) ;
return (retCode) ;
}
virtual void RegisterServerComponents () { }
//////////////////////////////////////////////////////////////////////////
// (SummArgs a1 a2 ... an)
// Суммируем все переданные аргументы. Возвращаем сумму
//////////////////////////////////////////////////////////////////////////
static int ads_SummArgs () {
double summ = 0.0;
resbuf *args = acedGetArgs();
resbuf *rb = args;
for (; rb; rb = rb->rbnext) {
if (rb->restype == RTREAL || rb->restype == RTANG) {
summ += rb->resval.rreal;
} else if (rb->restype == RTSHORT) {
summ += rb->resval.rint;
}
}
acedRetReal(summ);
acutRelRb (args) ;
return (RTNORM) ;
}
} ;
//-----------------------------------------------------------------------------
IMPLEMENT_ARX_ENTRYPOINT(CTestLispApp)
ACED_ADSSYMBOL_ENTRY_AUTO(CTestLispApp, SummArgs, false)