Morning all,
I'm converting my windows exe into a windows service and to get some
log information I'm replacing TRACE with my own Log.
Since some of the Trace statements take a number of arguments I want to
be able to stuff any number of arguments into my log, as in sprintf.
eg Log( "%s %i Hello", "Hi", 23) gives me 122334 !£., Hello with the
following code.
void CLog::Log(LPCTSTR lpszData ...)
{
va_list ap;
va_start(ap, lpszData);
char cRtn[256];
sprintf(cRtn, lpszData, ap); //doesn't work
va_end(ap);
//do something useful with cRtn
}
Any suggestions? I'm guessing that 122334 is a pointer...