// DLG_SOS.cpp : 实现文件 // #include "stdafx.h" #include "SmsManager.h" #include "DLG_SOS.h" #include "afxdialogex.h" // DLG_SOS 对话框 IMPLEMENT_DYNAMIC(DLG_SOS, CDialogEx) DLG_SOS::DLG_SOS(CWnd* pParent /*=NULL*/) : CDialogEx(DLG_SOS::IDD, pParent) { m_bEnable1=false; m_bEnable2=false; } DLG_SOS::~DLG_SOS() { } void DLG_SOS::DoDataExchange(CDataExchange* pDX) { CDialogEx::DoDataExchange(pDX); DDX_Control(pDX, IDC_SOS, m_B_SOS); } BEGIN_MESSAGE_MAP(DLG_SOS, CDialogEx) ON_BN_CLICKED(IDOK, &DLG_SOS::OnBnClickedOk) END_MESSAGE_MAP() // DLG_SOS 消息处理程序 void DLG_SOS::OnBnClickedOk() { m_bEnable2 = m_B_SOS.GetCheck(); if ( m_bEnable2 == m_bEnable1 ) { CDialogEx::OnCancel(); return ; } if ( m_bEnable2 && !m_bEnable1 ) { int iRet = MessageBox(_T("启用SOS模式后会自动关闭本管理软件,是否继续?"),_T("提问") , MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2); if (iRet!=IDYES) { CDialogEx::OnCancel(); return ; } } CDialogEx::OnOK(); } BOOL DLG_SOS::OnInitDialog() { CDialogEx::OnInitDialog(); // TODO: 在此添加额外的初始化 m_B_SOS.SetCheck(m_bEnable1); return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE } void DLG_SOS::SetSos(bool bSos) { m_bEnable1 = bSos; } BOOL DLG_SOS::GetSOS(void) { return m_bEnable2; }