Source code of Windows XP (NT5)
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.

118 lines
2.6 KiB

  1. //Copyright (c) 1998 - 1999 Microsoft Corporation
  2. /*++
  3. Module Name:
  4. AddLic.cpp
  5. Abstract:
  6. This Module contains the implementation of CAddLicenses Dialog class
  7. (Dialog box used for adding licenses)
  8. Author:
  9. Arathi Kundapur (v-akunda) 22-Feb-1998
  10. Revision History:
  11. --*/
  12. #include "stdafx.h"
  13. #include "licmgr.h"
  14. #include "defines.h"
  15. #include "lsserver.h"
  16. #include "addkp.h"
  17. #include "AddLic.h"
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CAddLicenses dialog
  25. CAddLicenses::CAddLicenses(CWnd* pParent /*=NULL*/)
  26. : CDialog(CAddLicenses::IDD, pParent)
  27. {
  28. //{{AFX_DATA_INIT(CAddLicenses)
  29. m_LicensePack = _T("");
  30. m_NumLicenses = 0;
  31. m_pAddKeyPack = NULL;
  32. //}}AFX_DATA_INIT
  33. }
  34. CAddLicenses::CAddLicenses(CAddKeyPack * pAddKeyPack,CWnd* pParent /*=NULL*/)
  35. : CDialog(CAddLicenses::IDD, pParent)
  36. {
  37. //{{AFX_DATA_INIT(CAddLicenses)
  38. m_LicensePack = _T("");
  39. m_NumLicenses = 0;
  40. m_pAddKeyPack = pAddKeyPack;
  41. //}}AFX_DATA_INIT
  42. }
  43. void CAddLicenses::DoDataExchange(CDataExchange* pDX)
  44. {
  45. CDialog::DoDataExchange(pDX);
  46. //{{AFX_DATA_MAP(CAddLicenses)
  47. DDX_Control(pDX, IDC_SPIN_LICNESES, m_SpinCtrl);
  48. DDX_Control(pDX, IDC_LICNESE_PACK, m_LicenseCombo);
  49. DDX_CBString(pDX, IDC_LICNESE_PACK, m_LicensePack);
  50. DDX_Text(pDX, IDC_NUM_LICENSES, m_NumLicenses);
  51. DDV_MinMaxDWord(pDX, m_NumLicenses, 1, 9999);
  52. //}}AFX_DATA_MAP
  53. }
  54. BEGIN_MESSAGE_MAP(CAddLicenses, CDialog)
  55. //{{AFX_MSG_MAP(CAddLicenses)
  56. ON_BN_CLICKED(IDC_HELP3, OnHelp)
  57. //}}AFX_MSG_MAP
  58. END_MESSAGE_MAP()
  59. /////////////////////////////////////////////////////////////////////////////
  60. // CAddLicenses message handlers
  61. BOOL CAddLicenses::OnInitDialog()
  62. {
  63. CDialog::OnInitDialog();
  64. // TODO: Add extra initialization here
  65. CString ProdDesc;
  66. if(NULL == m_pAddKeyPack)
  67. return FALSE;
  68. int nCount = m_pAddKeyPack->m_LicenseCombo.GetCount( );
  69. for(int i = 0; i < nCount; i++)
  70. {
  71. m_pAddKeyPack->m_LicenseCombo.GetLBText(i,ProdDesc);
  72. m_LicenseCombo.AddString(ProdDesc);
  73. }
  74. m_SpinCtrl.SetBase(1);
  75. m_SpinCtrl.SetRange(1,MAX_LICENSES);
  76. m_SpinCtrl.SetPos(1);
  77. m_LicenseCombo.SetCurSel(m_pAddKeyPack->m_LicenseCombo.GetCurSel());
  78. return TRUE; // return TRUE unless you set the focus to a control
  79. // EXCEPTION: OCX Property Pages should return FALSE
  80. }
  81. void CAddLicenses::OnHelp()
  82. {
  83. // TODO: Add your control notification handler code here
  84. AfxGetApp()->WinHelp(IDC_HELP3,HELP_CONTEXT );
  85. return;
  86. }