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.

75 lines
2.0 KiB

  1. // HjDict.cpp : Implementation of DLL Exports.
  2. //
  3. // History:
  4. // 17-MAY-2000 bhshin removed unused method/interface for CICERO
  5. // 02-FEB-2000 bhshin created
  6. // Note: Proxy/Stub Information
  7. // To build a separate proxy/stub DLL,
  8. // run nmake -f HjDictps.mk in the project directory.
  9. #include "private.h"
  10. #include "resource.h"
  11. #include <initguid.h>
  12. #include "HjDict.h"
  13. #include "HjDict_i.c"
  14. #include "IHJDict.h"
  15. CComModule _Module;
  16. BEGIN_OBJECT_MAP(ObjectMap)
  17. OBJECT_ENTRY(CLSID_HJDict, CHJDict)
  18. END_OBJECT_MAP()
  19. /////////////////////////////////////////////////////////////////////////////
  20. // DLL Entry Point
  21. extern "C"
  22. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  23. {
  24. if (dwReason == DLL_PROCESS_ATTACH)
  25. {
  26. _Module.Init(ObjectMap, hInstance, &LIBID_HJDICTLib);
  27. DisableThreadLibraryCalls(hInstance);
  28. }
  29. else if (dwReason == DLL_PROCESS_DETACH)
  30. _Module.Term();
  31. return TRUE; // ok
  32. }
  33. /////////////////////////////////////////////////////////////////////////////
  34. // Used to determine whether the DLL can be unloaded by OLE
  35. STDAPI DllCanUnloadNow(void)
  36. {
  37. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  38. }
  39. /////////////////////////////////////////////////////////////////////////////
  40. // Returns a class factory to create an object of the requested type
  41. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  42. {
  43. return _Module.GetClassObject(rclsid, riid, ppv);
  44. }
  45. /////////////////////////////////////////////////////////////////////////////
  46. // DllRegisterServer - Adds entries to the system registry
  47. STDAPI DllRegisterServer(void)
  48. {
  49. // registers object, typelib and all interfaces in typelib
  50. return _Module.RegisterServer(TRUE);
  51. }
  52. /////////////////////////////////////////////////////////////////////////////
  53. // DllUnregisterServer - Removes entries from the system registry
  54. STDAPI DllUnregisterServer(void)
  55. {
  56. return _Module.UnregisterServer(TRUE);
  57. }