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.

98 lines
2.9 KiB

  1. // AccntWiz.cpp : Implementation of CAddUser_AccntWiz
  2. #include "stdafx.h"
  3. #include "AU_Accnt.h"
  4. #include "AccntWiz.h"
  5. // ----------------------------------------------------------------------------
  6. // Constructor
  7. // ----------------------------------------------------------------------------
  8. CAddUser_AccntWiz::CAddUser_AccntWiz() :
  9. m_AcctP(this),
  10. m_PasswdP(this)
  11. {
  12. m_bFirstTime = TRUE;
  13. }
  14. // ----------------------------------------------------------------------------
  15. // Destructor
  16. // ----------------------------------------------------------------------------
  17. CAddUser_AccntWiz::~CAddUser_AccntWiz()
  18. {
  19. }
  20. // ----------------------------------------------------------------------------
  21. // EnumPropertySheets()
  22. // ----------------------------------------------------------------------------
  23. HRESULT CAddUser_AccntWiz::EnumPropertySheets( IAddPropertySheet* pADS )
  24. {
  25. HRESULT hr;
  26. // Add the User Account Information page.
  27. hr = pADS->AddPage( m_AcctP );
  28. if( FAILED(hr) )
  29. return hr;
  30. // Add the Password Generation page.
  31. hr = pADS->AddPage( m_PasswdP );
  32. if( FAILED(hr) )
  33. return hr;
  34. return S_FALSE;
  35. }
  36. // ----------------------------------------------------------------------------
  37. // ProvideFinishText()
  38. // ----------------------------------------------------------------------------
  39. HRESULT CAddUser_AccntWiz::ProvideFinishText( LPOLESTR* lpolestrString, LPOLESTR* lpMoreInfoText )
  40. {
  41. CWaitCursor cWaitCur;
  42. *lpolestrString = NULL;
  43. CString str = _T("");
  44. str.LoadString( IDS_FIN_TEXT );
  45. m_AcctP.ProvideFinishText ( str );
  46. if( !(*lpolestrString = (LPOLESTR)CoTaskMemAlloc( (str.GetLength() + 1) * sizeof(OLECHAR) )) )
  47. return E_OUTOFMEMORY;
  48. wcscpy( *lpolestrString, str );
  49. *lpMoreInfoText = NULL;
  50. return S_OK;
  51. }
  52. // ----------------------------------------------------------------------------
  53. // ReadProperties()
  54. // ----------------------------------------------------------------------------
  55. HRESULT CAddUser_AccntWiz::ReadProperties( IPropertyPagePropertyBag* pPPPBag )
  56. {
  57. if( m_bFirstTime == TRUE )
  58. {
  59. CWaitCursor cWaitCur;
  60. m_bFirstTime = FALSE; // only once.
  61. // Let the pages read the property bag.
  62. m_AcctP.ReadProperties ( pPPPBag );
  63. m_PasswdP.ReadProperties( pPPPBag );
  64. }
  65. return S_OK;
  66. }
  67. // ----------------------------------------------------------------------------
  68. // WriteProperties()
  69. // ----------------------------------------------------------------------------
  70. HRESULT CAddUser_AccntWiz::WriteProperties( IPropertyPagePropertyBag* pPPPBag )
  71. {
  72. CWaitCursor cWaitCur;
  73. // Have the pages write out their values into the property bag.
  74. m_AcctP.WriteProperties ( pPPPBag );
  75. m_PasswdP.WriteProperties( pPPPBag );
  76. return S_OK;
  77. }