My application sends debug data to the Output Window in Visual Studio using the TRACE macro. Some of these output strings are built using several calls to the TRACE macro, as is shown in the following snippet of code:
BYTE i, len;
len = pMsg[APP_LEN_OFFSET] + sizeof(appPktHead_t) - APP_MSG_CODE_LEN;
TRACE(_T("%s: "), fnName);
TRACE(GetCmdIdStr( pMsg[APP_MSG_CODE_OFFSET] ));
TRACE(_T(" 0x"));
for ( i = 0; i < len; i++ )
{
TRACE(_T("%.2X "), pMsg[i]);
}
TRACE(_T("\r\n"));
How can I either lock the output to the Output Window for the duration of this function, or send the entire string in a single call to TRACE? Thanks.
Build a single string, before using the
TRACEmacro.