Page10.cpp
上传用户:heseme
上传日期:2009-12-23
资源大小:228k
文件大小:2k
开发平台:

Visual C++

  1. // Page10.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "FireWall1.h"
  5. #include "global.h"
  6. #include "Page10.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. extern CDataConvert gDataConvert;
  13. extern BOOL bhaved;
  14. extern struct HostChar *phostchar;
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CPage10 property page
  17. IMPLEMENT_DYNCREATE(CPage10, CPropertyPage)
  18. CPage10::CPage10() : CPropertyPage(CPage10::IDD)
  19. {
  20. //{{AFX_DATA_INIT(CPage10)
  21. //}}AFX_DATA_INIT
  22. }
  23. CPage10::~CPage10()
  24. {
  25. }
  26. void CPage10::DoDataExchange(CDataExchange* pDX)
  27. {
  28. CPropertyPage::DoDataExchange(pDX);
  29. //{{AFX_DATA_MAP(CPage10)
  30. DDX_Control(pDX, IDC_EDIT15, m_TcpDstOut);
  31. DDX_Control(pDX, IDC_EDIT13, m_TcpSrcOut);
  32. //}}AFX_DATA_MAP
  33. }
  34. BEGIN_MESSAGE_MAP(CPage10, CPropertyPage)
  35. //{{AFX_MSG_MAP(CPage10)
  36. ON_BN_CLICKED(IDC_BUTTON3, OnOk)
  37. //}}AFX_MSG_MAP
  38. END_MESSAGE_MAP()
  39. /////////////////////////////////////////////////////////////////////////////
  40. // CPage10 message handlers
  41. void CPage10::OnOk() 
  42. {
  43. gDataConvert.SetPortList(m_TcpDstOut,TCPDSTOUT);
  44. gDataConvert.SetPortList(m_TcpSrcOut,TCPSRCOUT);
  45. gDataConvert.SaveChar(m_TcpDstOut,TRUE,TCPDSTOUT);
  46. gDataConvert.SaveChar(m_TcpSrcOut,TRUE,TCPSRCOUT);
  47. }
  48. BOOL CPage10::OnInitDialog() 
  49. {
  50. CPropertyPage::OnInitDialog();
  51.     if(bhaved)
  52. {
  53.       gDataConvert.DisplayHost(phostchar,TCPSRCOUT,m_TcpSrcOut);
  54.       gDataConvert.DisplayHost(phostchar,TCPDSTOUT,m_TcpDstOut);
  55. }
  56. return TRUE;  // return TRUE unless you set the focus to a control
  57.               // EXCEPTION: OCX Property Pages should return FALSE
  58. }
  59. BOOL CPage10::OnSetActive() 
  60. {
  61.     if(bhaved)
  62. {
  63.       gDataConvert.DisplayHost(phostchar,TCPSRCOUT,m_TcpSrcOut);
  64.       gDataConvert.DisplayHost(phostchar,TCPDSTOUT,m_TcpDstOut);
  65. }
  66. UpdateData(FALSE);
  67. return CPropertyPage::OnSetActive();
  68. }