Dlg_SystemCfg.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Dlg_SystemCfg.cpp : 实现文件
  2. //
  3. #include "stdafx.h"
  4. #include "StoneU_HW_OCX.h"
  5. #include "Dlg_SystemCfg.h"
  6. #include ".\dlg_systemcfg.h"
  7. #include "Dlg_AddDvr.h"
  8. #include "Global.h"
  9. // CDlg_SystemCfg 对话框
  10. IMPLEMENT_DYNAMIC(CDlg_SystemCfg, CDialog)
  11. CDlg_SystemCfg::CDlg_SystemCfg(CWnd* pParent /*=NULL*/)
  12. : CDialog(CDlg_SystemCfg::IDD, pParent)
  13. {
  14. }
  15. CDlg_SystemCfg::~CDlg_SystemCfg()
  16. {
  17. }
  18. void CDlg_SystemCfg::DoDataExchange(CDataExchange* pDX)
  19. {
  20. CDialog::DoDataExchange(pDX);
  21. DDX_Control(pDX, IDC_TREE1, m_treeall);
  22. DDX_Control(pDX, IDC_TREE2, m_treesel);
  23. }
  24. BEGIN_MESSAGE_MAP(CDlg_SystemCfg, CDialog)
  25. ON_BN_CLICKED(IDC_LOGIN, OnBnClickedLogin)
  26. END_MESSAGE_MAP()
  27. // CDlg_SystemCfg 消息处理程序
  28. BOOL CDlg_SystemCfg::OnInitDialog()
  29. {
  30. CDialog::OnInitDialog();
  31. // TODO: 在此添加额外的初始化
  32. return TRUE; // return TRUE unless you set the focus to a control
  33. // 异常: OCX 属性页应返回 FALSE
  34. }
  35. void CDlg_SystemCfg::OnBnClickedLogin()
  36. {
  37. for(int i = 0; i < MAXIPNUMBER; i++)
  38. {
  39. if(g_Serverinfo[i].m_iServerChannelNumber == -1)
  40. {
  41. CDlg_AddDvr dlg;
  42. dlg.m_iServerNum = i;
  43. dlg.DoModal();
  44. if(dlg.m_bChanged)
  45. {
  46. //F_IniTreeall();
  47. }
  48. return;
  49. }
  50. }
  51. MessageBox("超过最大服务器数,请先删除再添加!", "温馨提示", MB_ICONINFORMATION);
  52. }