-/*
- The global operator new used for everything apart from getting
- dynamic storage within this function itself.
-*/
+// This function is used to output the dump
+void wxDebugContext::OutputDumpLine(const wxChar *szFormat, ...)
+{
+ // a buffer of 2048 bytes should be long enough for a file name
+ // and a class name
+ wxChar buf[2048];
+ int count;
+ va_list argptr;
+ va_start(argptr, szFormat);
+ buf[sizeof(buf)/sizeof(wxChar)-1] = _T('\0');
+
+ // keep 3 bytes for a \r\n\0
+ count = wxVsnprintf(buf, sizeof(buf)/sizeof(wxChar)-3, szFormat, argptr);
+
+ if ( count < 0 )
+ count = sizeof(buf)/sizeof(wxChar)-3;
+ buf[count]=_T('\r');
+ buf[count+1]=_T('\n');
+ buf[count+2]=_T('\0');
+
+ wxMessageOutputDebug dbgout;
+ dbgout.Printf(buf);
+}