m_edtdisplay_called = (CEdit*)(AfxGetMainWnd()->GetDlgItem(IDC_DISPLAY_CALLED));
std::ofstream logfile;
AfxGetMainWnd()->UpdateData(TRUE);
CString strDisplay;
m_edtdisplay_called->GetWindowText(strDisplay);
logfile.open("Log.txt", std::ios::app);
char tmpbuf[128];
_strdate(tmpbuf); //retrieve the OS date
logfile << "[" << tmpbuf << " ";
strDisplay = strDisplay + "[" + tmpbuf + " ";
_strtime(tmpbuf); //retrieve the OS time
logfile << tmpbuf << "]" << " AlarmStoreCallback::indexCleared() has been called! " << std::endl;
strDisplay = strDisplay + tmpbuf + "]" + " AlarmStoreCallback::indexCleared() has been called! " + "\r\n";
m_edtdisplay_called->SetWindowText(strDisplay);
AfxGetMainWnd()->UpdateData(TRUE); //display in the control
logfile << std::flush;
logfile.close();