maybe
__declspec(noinline) void EsPrint(Acad::ErrorStatus es, LPCTSTR func)
{
acutPrintf(_T("\nError: Line %ld [%s]\nIn function %s"),
__LINE__, acadErrorStatusText(es), func);
}
//returns ES
#define TRYRETES(statement) { Acad::ErrorStatus st = (statement); if (st != Acad::eOk){\
EsPrint(st,_T(__FUNCTION__));\
return st;}}
// returns void
#define TRYRETVOID(statement) { Acad::ErrorStatus st = (statement); if (st != Acad::eOk){\
EsPrint(st,_T(__FUNCTION__));\
return;}}
// only prints es message
#define TRYMSG(statement) { Acad::ErrorStatus st = (statement); if (st != Acad::eOk){\
EsPrint(st,_T(__FUNCTION__));\
}}