SetDlg.cpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // SetDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "cphotoftpsend.h"
  5. #include "SetDlg.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // SetDlg dialog
  13. extern BOOL g_check1;
  14. extern int g_num;
  15. SetDlg::SetDlg(CWnd* pParent /*=NULL*/)
  16. : CDialog(SetDlg::IDD, pParent)
  17. {
  18. //{{AFX_DATA_INIT(SetDlg)
  19. m_check1 = 1;
  20. m_num = 5;
  21. CString version = _T ("Version 1.0");
  22. m_check1=AfxGetApp()->GetProfileInt (version, "bcontinue", 1);
  23. m_num=min(10, AfxGetApp()->GetProfileInt (version, "nthreadcount", 5));
  24. //}}AFX_DATA_INIT
  25. }
  26. void SetDlg::DoDataExchange(CDataExchange* pDX)
  27. {
  28. CDialog::DoDataExchange(pDX);
  29. //{{AFX_DATA_MAP(SetDlg)
  30. DDX_Control(pDX, IDC_SPIN1, m_spin1);
  31. DDX_Check(pDX, IDC_CHECK1, m_check1);
  32. DDX_Text(pDX, IDC_EDIT1, m_num);
  33. DDV_MinMaxUInt(pDX, m_num, 1, 10);
  34. //}}AFX_DATA_MAP
  35. }
  36. BEGIN_MESSAGE_MAP(SetDlg, CDialog)
  37. //{{AFX_MSG_MAP(SetDlg)
  38. //}}AFX_MSG_MAP
  39. END_MESSAGE_MAP()
  40. /////////////////////////////////////////////////////////////////////////////
  41. // SetDlg message handlers
  42. void SetDlg::OnOK()
  43. {
  44. // TODO: Add extra validation here
  45. UpdateData();
  46. CString version = _T ("Version 1.0");
  47. AfxGetApp()->WriteProfileInt (version, "bcontinue", m_check1);
  48. AfxGetApp()->WriteProfileInt (version, "nthreadcount", m_num);
  49. g_check1=m_check1;
  50. // g_num=min(10, m_num);
  51. CDialog::OnOK();
  52. }
  53. BOOL SetDlg::OnInitDialog()
  54. {
  55. CDialog::OnInitDialog();
  56. // TODO: Add extra initialization here
  57. m_spin1.SetRange (1, 10);
  58. return TRUE; // return TRUE unless you set the focus to a control
  59. // EXCEPTION: OCX Property Pages should return FALSE
  60. }