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.

94 lines
2.0 KiB

  1. // This is a part of the Microsoft Management Console.
  2. // Copyright (C) Microsoft Corporation, 1995 - 1999
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Management Console and related
  7. // electronic documentation provided with the interfaces.
  8. #include <stdafx.h>
  9. #include "Service.h"
  10. #include "CSnapin.h"
  11. #ifdef _DEBUG
  12. #define new DEBUG_NEW
  13. #undef THIS_FILE
  14. static char THIS_FILE[] = __FILE__;
  15. #endif
  16. CSnapinAboutImpl::CSnapinAboutImpl()
  17. {
  18. }
  19. CSnapinAboutImpl::~CSnapinAboutImpl()
  20. {
  21. }
  22. HRESULT CSnapinAboutImpl::AboutHelper(UINT nID, LPOLESTR* lpPtr)
  23. {
  24. if (lpPtr == NULL)
  25. return E_POINTER;
  26. CString s;
  27. // Needed for Loadstring
  28. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  29. s.LoadString(nID);
  30. *lpPtr = reinterpret_cast<LPOLESTR>
  31. (CoTaskMemAlloc((s.GetLength() + 1)* sizeof(wchar_t)));
  32. if (*lpPtr == NULL)
  33. return E_OUTOFMEMORY;
  34. USES_CONVERSION;
  35. wcscpy(*lpPtr, T2OLE((LPTSTR)(LPCTSTR)s));
  36. return S_OK;
  37. }
  38. STDMETHODIMP CSnapinAboutImpl::GetSnapinDescription(LPOLESTR* lpDescription)
  39. {
  40. return AboutHelper(IDS_DESCRIPTION, lpDescription);
  41. }
  42. STDMETHODIMP CSnapinAboutImpl::GetProvider(LPOLESTR* lpName)
  43. {
  44. return AboutHelper(IDS_COMPANY, lpName);
  45. }
  46. STDMETHODIMP CSnapinAboutImpl::GetSnapinVersion(LPOLESTR* lpVersion)
  47. {
  48. return AboutHelper(IDS_VERSION, lpVersion);
  49. }
  50. STDMETHODIMP CSnapinAboutImpl::GetSnapinImage(HICON* hAppIcon)
  51. {
  52. if (hAppIcon == NULL)
  53. return E_POINTER;
  54. AFX_MANAGE_STATE(AfxGetStaticModuleState());
  55. *hAppIcon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_APPICON));
  56. ASSERT(*hAppIcon != NULL);
  57. return (*hAppIcon != NULL) ? S_OK : E_FAIL;
  58. }
  59. STDMETHODIMP CSnapinAboutImpl::GetStaticFolderImage(HBITMAP* hSmallImage,
  60. HBITMAP* hSmallImageOpen,
  61. HBITMAP* hLargeImage,
  62. COLORREF* cLargeMask)
  63. {
  64. return S_OK;
  65. }