MFC ShowLog(CString strLog)
原创
©著作权归作者所有:来自51CTO博客作者friendan的原创作品,请联系作者获取转载授权,否则将追究法律责任
VOID CShieldDomainDlgDlg::ShowLog(CString strLog)
{
SYSTEMTIME sysTime;
GetLocalTime(&sysTime );
CString strTime;
strTime.Format("%04d%02d%02d %02d:%02d:%02d:%03d", sysTime.wYear, sysTime.wMonth, sysTime.wDay, sysTime.wHour, sysTime.wMinute, sysTime.wSecond, sysTime.wMilliseconds);
CString strCurLog;
GetDlgItemText(IDC_EDIT_MSG, strCurLog);
if (strCurLog.GetLength() > 10000)
{
SetDlgItemText(IDC_EDIT_MSG, _T(""));
}
else
{
CString strTmp;
strTmp.Format("[%s] %s\r\n", strTime, strLog);
strCurLog += strTmp;
SetDlgItemText(IDC_EDIT_MSG, strCurLog);
}
}