#define variable arguments

Since #define does not take variable arguments you have to work around using function pointers.

void __format_out(const char* fmt, ...);

typedef void (*ptr2Fn) (const char* fmt, ...) ;

ptr2Fn _storeLine(int nSeverity,int lineNumber,char* fileName);

#define CTRACE _storeLine(40,__LINE__,__FILE__)

ptr2Fn _storeLine(int nPSeverity,int nPlineNumber,char* szPfileName)

nSeverity = nPSeverity;
szfileName = (char*)szPfileName;

return __format_out;
inline void __format_out(const char * fmt, ...)

CString ___str;
va_list marker;
va_start(marker, fmt);
___str.FormatV(A2T(fmt), marker);


TRACE("nUMBER IS %d",223);


Popular posts from this blog

Long running Java process resource consumption monitoring , leak detection and GC tuning

OpenLayers Advanced Clustering and Setting dynamic images for OpenLayer Styles via Ajax

Java Script Development Guidlines