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.

89 lines
2.4 KiB

  1. //Copyright (c) 1998 - 1999 Microsoft Corporation
  2. // TempLic.cpp : implementation file
  3. //
  4. #include "stdafx.h"
  5. #include "licmgr.h"
  6. #include "defines.h"
  7. #include "LSServer.h"
  8. #include "TempLic.h"
  9. #include "MainFrm.h"
  10. #ifdef _DEBUG
  11. #define new DEBUG_NEW
  12. #undef THIS_FILE
  13. static char THIS_FILE[] = __FILE__;
  14. #endif
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CTempLicenses dialog
  17. CTempLicenses::CTempLicenses(CWnd* pParent /*=NULL*/)
  18. : CDialog(CTempLicenses::IDD, pParent)
  19. {
  20. m_pKeyPackList = NULL;
  21. //{{AFX_DATA_INIT(CTempLicenses)
  22. // NOTE: the ClassWizard will add member initialization here
  23. //}}AFX_DATA_INIT
  24. }
  25. CTempLicenses::CTempLicenses(KeyPackList * pKeyPackList,CWnd* pParent/*=NULL*/)
  26. : CDialog(CTempLicenses::IDD, pParent)
  27. {
  28. m_pKeyPackList = pKeyPackList;
  29. }
  30. void CTempLicenses::DoDataExchange(CDataExchange* pDX)
  31. {
  32. CDialog::DoDataExchange(pDX);
  33. //{{AFX_DATA_MAP(CTempLicenses)
  34. DDX_Control(pDX, IDC_TEMP_LICENSES, m_TempLic);
  35. //}}AFX_DATA_MAP
  36. }
  37. BEGIN_MESSAGE_MAP(CTempLicenses, CDialog)
  38. //{{AFX_MSG_MAP(CTempLicenses)
  39. //}}AFX_MSG_MAP
  40. END_MESSAGE_MAP()
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CTempLicenses message handlers
  43. BOOL CTempLicenses::OnInitDialog()
  44. {
  45. CDialog::OnInitDialog();
  46. // TODO: Add extra initialization here
  47. if(m_pKeyPackList == NULL)
  48. return TRUE;
  49. m_TempLic.ModifyStyle(LVS_LIST|LVS_ICON | LVS_SMALLICON,LVS_REPORT,0);
  50. LV_COLUMN lvC;
  51. CString ColumnText;
  52. lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM ;
  53. lvC.fmt = LVCFMT_LEFT;
  54. lvC.cx = 125;
  55. for(int index = 0; index < NUM_LICENSE_COLUMNS; index ++)
  56. {
  57. lvC.iSubItem = index;
  58. ColumnText.LoadString(IDS_LICENSE_COLUMN1 + index);
  59. lvC.pszText = ColumnText.GetBuffer(ColumnText.GetLength());
  60. m_TempLic.InsertColumn(index, &lvC);
  61. }
  62. CLicMgrApp *pApp = (CLicMgrApp*)AfxGetApp();
  63. ASSERT(pApp);
  64. CMainFrame * pWnd = (CMainFrame *)pApp->m_pMainWnd ;
  65. ASSERT(pWnd);
  66. POSITION pos = m_pKeyPackList->GetHeadPosition();
  67. while(pos)
  68. {
  69. CKeyPack *pKeyPack = m_pKeyPackList->GetNext(pos);
  70. ASSERT(pKeyPack);
  71. pWnd->AddLicensestoList(pKeyPack,&m_TempLic);
  72. }
  73. return TRUE; // return TRUE unless you set the focus to a control
  74. // EXCEPTION: OCX Property Pages should return FALSE
  75. }