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.

97 lines
2.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 2000 - 2001.
  5. //
  6. // File: comp.cpp
  7. //
  8. // Contents: IComponent implementation
  9. //
  10. // History: 07-26-2001 Hiteshr Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #include "headers.h"
  14. DEBUG_DECLARE_INSTANCE_COUNTER(CRoleComponentObject)
  15. CRoleComponentObject::CRoleComponentObject()
  16. {
  17. TRACE_CONSTRUCTOR_EX(DEB_SNAPIN, CRoleComponentObject)
  18. DEBUG_INCREMENT_INSTANCE_COUNTER(CRoleComponentObject)
  19. }
  20. CRoleComponentObject::~CRoleComponentObject()
  21. {
  22. TRACE_DESTRUCTOR_EX(DEB_SNAPIN, CRoleComponentObject)
  23. DEBUG_DECREMENT_INSTANCE_COUNTER(CRoleComponentObject)
  24. }
  25. HRESULT CRoleComponentObject::InitializeHeaders(CContainerNode* pContainerNode)
  26. {
  27. TRACE_METHOD_EX(DEB_SNAPIN,CRoleComponentObject,InitializeHeaders)
  28. if(!pContainerNode)
  29. {
  30. ASSERT(FALSE);
  31. return E_POINTER;
  32. }
  33. HRESULT hr = S_OK;
  34. ASSERT(m_pHeader);
  35. CColumnSet* pColumnSet = pContainerNode->GetColumnSet();
  36. POSITION pos = pColumnSet->GetHeadPosition();
  37. while (pos != NULL)
  38. {
  39. CColumn* pColumn = pColumnSet->GetNext(pos);
  40. hr = m_pHeader->InsertColumn(pColumn->GetColumnNum(),
  41. pColumn->GetHeader(),
  42. pColumn->GetFormat(),
  43. AUTO_WIDTH);
  44. if (FAILED(hr))
  45. {
  46. DBG_OUT_HRESULT(hr);
  47. return hr;
  48. }
  49. hr = m_pHeader->SetColumnWidth(pColumn->GetColumnNum(), pColumn->GetWidth());
  50. if (FAILED(hr))
  51. {
  52. DBG_OUT_HRESULT(hr);
  53. return hr;
  54. }
  55. }
  56. return hr;
  57. }
  58. HRESULT CRoleComponentObject::InitializeBitmaps(CTreeNode*)
  59. {
  60. TRACE_METHOD_EX(DEB_SNAPIN,CRoleComponentObject,InitializeBitmaps)
  61. // Structure to map a Resource ID to an index of icon
  62. return LoadIcons(m_pImageResult);
  63. }
  64. //CONST INT cButtons = sizeof(g_DNSMGR_SnapinButtons)/sizeof(MMCBUTTON);
  65. HRESULT CRoleComponentObject::InitializeToolbar(IToolbar* pToolbar)
  66. {
  67. TRACE_METHOD_EX(DEB_SNAPIN,CRoleComponentDataObject, InitializeToolbar)
  68. if(!pToolbar)
  69. {
  70. ASSERT(FALSE);
  71. return E_POINTER;
  72. }
  73. return S_OK;
  74. }
  75. HRESULT
  76. CRoleComponentObject::LoadToolbarStrings(MMCBUTTON * /*Buttons*/)
  77. {
  78. return S_OK;
  79. }