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.

84 lines
2.7 KiB

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