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.

83 lines
2.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 1999
  6. //
  7. // File: bensvr.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. // BenefitsSvr.cpp : Implementation of DLL Exports.
  11. // Note: Proxy/Stub Information
  12. // To build a separate proxy/stub DLL,
  13. // run nmake -f BenefitsSvrps.mk in the project directory.
  14. #include "stdafx.h"
  15. #include "resource.h"
  16. #include <initguid.h>
  17. #include "BenSvr.h"
  18. #include "BenSvr_i.c"
  19. #include "Benefits.h"
  20. CComModule _Module;
  21. BEGIN_OBJECT_MAP(ObjectMap)
  22. OBJECT_ENTRY(CLSID_Benefits, CBenefits)
  23. // OBJECT_ENTRY(CLSID_BenefitsAbout, CBenefitsAbout)
  24. END_OBJECT_MAP()
  25. /////////////////////////////////////////////////////////////////////////////
  26. // DLL Entry Point
  27. extern "C"
  28. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  29. {
  30. if (dwReason == DLL_PROCESS_ATTACH)
  31. {
  32. _Module.Init(ObjectMap, hInstance, &LIBID_BENEFITSSVRLib);
  33. DisableThreadLibraryCalls(hInstance);
  34. }
  35. else if (dwReason == DLL_PROCESS_DETACH)
  36. _Module.Term();
  37. return TRUE; // ok
  38. }
  39. /////////////////////////////////////////////////////////////////////////////
  40. // Used to determine whether the DLL can be unloaded by OLE
  41. STDAPI DllCanUnloadNow(void)
  42. {
  43. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  44. }
  45. /////////////////////////////////////////////////////////////////////////////
  46. // Returns a class factory to create an object of the requested type
  47. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  48. {
  49. return _Module.GetClassObject(rclsid, riid, ppv);
  50. }
  51. /////////////////////////////////////////////////////////////////////////////
  52. // DllRegisterServer - Adds entries to the system registry
  53. STDAPI DllRegisterServer(void)
  54. {
  55. // registers object, typelib and all interfaces in typelib
  56. return _Module.RegisterServer(TRUE);
  57. }
  58. /////////////////////////////////////////////////////////////////////////////
  59. // DllUnregisterServer - Removes entries from the system registry
  60. STDAPI DllUnregisterServer(void)
  61. {
  62. return _Module.UnregisterServer(TRUE);
  63. }