Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.1 KiB

  1. // TrusterDlg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "TrstDlg.h"
  5. #ifdef _DEBUG
  6. #define new DEBUG_NEW
  7. #undef THIS_FILE
  8. static char THIS_FILE[] = __FILE__;
  9. #endif
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CTrusterDlg dialog
  12. CTrusterDlg::CTrusterDlg(CWnd* pParent /*=NULL*/)
  13. : CDialog(CTrusterDlg::IDD, pParent)
  14. {
  15. //{{AFX_DATA_INIT(CTrusterDlg)
  16. // NOTE: the ClassWizard will add member initialization here
  17. //}}AFX_DATA_INIT
  18. }
  19. void CTrusterDlg::DoDataExchange(CDataExchange* pDX)
  20. {
  21. CDialog::DoDataExchange(pDX);
  22. DDX_Text(pDX, IDC_USERNAME, m_strUser);
  23. DDX_Text(pDX, IDC_PASSWORD, m_strPassword);
  24. DDX_Text(pDX, IDC_DOMAINNAME, m_strDomain);
  25. //{{AFX_DATA_MAP(CTrusterDlg)
  26. // NOTE: the ClassWizard will add DDX and DDV calls here
  27. //}}AFX_DATA_MAP
  28. }
  29. BEGIN_MESSAGE_MAP(CTrusterDlg, CDialog)
  30. //{{AFX_MSG_MAP(CTrusterDlg)
  31. ON_BN_CLICKED(IDC_OK, OnOK)
  32. ON_BN_CLICKED(IDC_CANCEL, OnCancel)
  33. //}}AFX_MSG_MAP
  34. END_MESSAGE_MAP()
  35. /////////////////////////////////////////////////////////////////////////////
  36. // CTrusterDlg message handlers
  37. void CTrusterDlg::OnOK()
  38. {
  39. toreturn =false;
  40. UpdateData(TRUE);
  41. m_strUser.TrimLeft();m_strUser.TrimRight();
  42. m_strDomain.TrimLeft();m_strDomain.TrimRight();
  43. m_strPassword.TrimLeft();m_strPassword.TrimRight();
  44. if (m_strUser.IsEmpty() || m_strDomain.IsEmpty())
  45. {
  46. CString c;
  47. c.LoadString(IDS_MSG_DOMAIN);
  48. CString d;
  49. d.LoadString(IDS_MSG_INPUT);
  50. MessageBox(c,d,MB_OK);
  51. toreturn =false;
  52. }
  53. else
  54. {
  55. toreturn =true;
  56. }
  57. CDialog::OnOK();
  58. }
  59. void CTrusterDlg::OnCancel()
  60. {
  61. toreturn=false;
  62. // TODO: Add your control notification handler code here
  63. CDialog::OnCancel();
  64. }
  65. BOOL CTrusterDlg::OnInitDialog()
  66. {
  67. CDialog::OnInitDialog();
  68. toreturn =false;
  69. if ( m_strDomain.IsEmpty() )
  70. return TRUE;
  71. else
  72. UpdateData(FALSE);
  73. // TODO: Add extra initialization here
  74. return TRUE; // return TRUE unless you set the focus to a control
  75. // EXCEPTION: OCX Property Pages should return FALSE
  76. }