|
void DspData( LPSTR FormatString, ... )
{
va_list marker;
BOOL bCr;
char *szNewBuff = new char[lstrlen(FormatString)+10];
lstrcpy( szNewBuff, FormatString );
bCr = false;
if ( szNewBuff[lstrlen(FormatString)-1] == '\n' ) {
bCr = true;
szNewBuff[lstrlen(FormatString)-1] = 0x00;
}
va_start(marker, FormatString);
vsprintf(szBuff, szNewBuff, marker);
va_end(marker);
SendMessage( hListBox,
LB_ADDSTRING,
0,
(LPARAM)(LPCSTR)szBuff
);
if ( bCr ) {
szBuff[0] = 0x00;
SendMessage( hListBox,
LB_ADDSTRING,
0,
(LPARAM)(LPCSTR)szBuff
);
}
delete [] szNewBuff;
}
| |