void CDlgCfgAnalogAlarm::OnCfgAnalogalarmBtnEventhandler() { // TODO: Add your control notification handler code here CSubDlgCfgEventHandler* dlgEventHandler = new CSubDlgCfgEventHandler; if (dlgEventHandler != NULL) { dlgEventHandler->SetEventHandler(m_stuInfo.stuEventHandler); dlgEventHandler->SetTimeSection(&m_stuInfo.stuTimeSection[0][0]); if (IDOK == dlgEventHandler->DoModal()) { const CFG_ALARM_MSG_HANDLE stuEventHandler = dlgEventHandler->GetEventHandler(); memcpy(&m_stuInfo.stuEventHandler, &stuEventHandler, sizeof(CFG_ALARM_MSG_HANDLE)); for (int i = 0; i < WEEK_DAY_NUM; i++) { for (int j = 0; j < MAX_REC_TSECT; j++) { const CFG_TIME_SECTION* pstuTimeSection = dlgEventHandler->GetTimeSection(i, j); if (pstuTimeSection) { memcpy(&m_stuInfo.stuTimeSection[i][j], pstuTimeSection, sizeof(CFG_TIME_SECTION)); } } } } } }
void CDlgCfgAlarm::OnCfgAlarmBtnEventhandler() { // TODO: Add your control notification handler code here CSubDlgCfgEventHandler* pdlgEventHandler = new CSubDlgCfgEventHandler; if (pdlgEventHandler != NULL) { pdlgEventHandler->SetEventHandler(m_stuInfo.stuEventHandler); pdlgEventHandler->SetTimeSection(&m_stuInfo.stuTimeSection[0][0]); if (IDOK == pdlgEventHandler->DoModal()) { m_bNeedResetWaittime = pdlgEventHandler->GetTiemChangeFlag(); const CFG_ALARM_MSG_HANDLE& stuEventHandler = pdlgEventHandler->GetEventHandler(); memcpy(&m_stuInfo.stuEventHandler, &stuEventHandler, sizeof(CFG_ALARM_MSG_HANDLE)); for (int i = 0; i < WEEK_DAY_NUM; i++) { for (int j = 0; j < MAX_REC_TSECT; j++) { const CFG_TIME_SECTION* pstuTimeSection = pdlgEventHandler->GetTimeSection(i, j); if (pstuTimeSection) { memcpy(&m_stuInfo.stuTimeSection[i][j], pstuTimeSection, sizeof(CFG_TIME_SECTION)); } } } } delete pdlgEventHandler; pdlgEventHandler = NULL; } else { MessageBox(ConvertString("new handler dialog error!", DLG_CFG_ALARM), ConvertString("Prompt")); } }