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.1 KiB

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