PeeperSetDlg.cpp
上传用户:xztxsm
上传日期:2007-02-12
资源大小:150k
文件大小:1k
源码类别:

远程控制编程

开发平台:

Visual C++

  1. #include "stdafx.h"
  2. #include "peeperclient.h"
  3. #include "PeeperSetDlg.h"
  4. #include "../peeperlib.h"
  5. #ifdef _DEBUG
  6. #define new DEBUG_NEW
  7. #undef THIS_FILE
  8. static char THIS_FILE[] = __FILE__;
  9. #endif
  10. CPeeperSetDlg::CPeeperSetDlg(CWnd* pParent /*=NULL*/)
  11. : CDialog(CPeeperSetDlg::IDD, pParent)
  12. {
  13. //{{AFX_DATA_INIT(CPeeperSetDlg)
  14. //}}AFX_DATA_INIT
  15. }
  16. void CPeeperSetDlg::DoDataExchange(CDataExchange* pDX)
  17. {
  18. CDialog::DoDataExchange(pDX);
  19. //{{AFX_DATA_MAP(CPeeperSetDlg)
  20. //}}AFX_DATA_MAP
  21. }
  22. BEGIN_MESSAGE_MAP(CPeeperSetDlg, CDialog)
  23. //{{AFX_MSG_MAP(CPeeperSetDlg)
  24. //}}AFX_MSG_MAP
  25. END_MESSAGE_MAP()
  26. void CPeeperSetDlg::OnOK() 
  27. {
  28. GetDlgItemText(IDC_EDIT_IP, m_strIP);
  29. m_uPort = GetDlgItemInt(IDC_EDIT_PORT);
  30. m_nBits = GetDlgItemInt(IDC_EDIT_BITS);
  31. m_nSpeed = GetDlgItemInt(IDC_EDIT_SPEED);
  32. CDialog::OnOK();
  33. }
  34. BOOL CPeeperSetDlg::OnInitDialog() 
  35. {
  36. CDialog::OnInitDialog();
  37. SetDlgItemText(IDC_EDIT_IP, _T("127.0.0.1"));
  38. SetDlgItemInt(IDC_EDIT_PORT, PL_PEEPER_PORT);
  39. SetDlgItemText(IDC_EDIT_BITS, _T("4"));
  40. SetDlgItemInt(IDC_EDIT_SPEED, 1000);
  41. ((CEdit *)GetDlgItem(IDC_EDIT_SPEED))->SetLimitText(6);
  42. ((CEdit *)GetDlgItem(IDC_EDIT_BITS))->SetLimitText(2);
  43. return TRUE;
  44. }