// CEDEventReportDlg.cpp: 实现文件 // #include "pch.h" #include "EAPSimulator.h" #include "CEDEventReportDlg.h" #include "afxdialogex.h" #include // CEDEventReportDlg 对话框 IMPLEMENT_DYNAMIC(CEDEventReportDlg, CDialogEx) CEDEventReportDlg::CEDEventReportDlg(CWnd* pParent /*=nullptr*/) : CDialogEx(IDD_DIALOG_ED_EVENT_REPORT, pParent) { } CEDEventReportDlg::~CEDEventReportDlg() { } void CEDEventReportDlg::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CEDEventReportDlg, CDialogEx) ON_BN_CLICKED(IDC_BUTTON_SEND, &CEDEventReportDlg::OnBnClickedButtonSend) END_MESSAGE_MAP() // CEDEventReportDlg 消息处理程序 BOOL CEDEventReportDlg::OnInitDialog() { CDialogEx::OnInitDialog(); CButton* pButton = (CButton*)GetDlgItem(IDC_RADIO_ENABLE); pButton->SetCheck(BST_CHECKED); return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE } void CEDEventReportDlg::OnBnClickedButtonSend() { CButton* pButton = (CButton*)GetDlgItem(IDC_RADIO_ENABLE); bool bEnable = pButton->GetCheck() == BST_CHECKED; CString strText, strId; GetDlgItemText(IDC_EDIT_CEID, strText); std::vector ids; if (!strText.IsEmpty()) { int i = 0; while (1) { if (!AfxExtractSubString(strId, (LPCTSTR)strText, i++, ',')) { break; } ids.push_back(atoi(strId)); } } theApp.m_model.m_pHsmsActive->hsmsEDEventReport(bEnable, ids); }