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.

98 lines
3.0 KiB

  1. /******************************************************************************
  2. * spTrueTalk.cpp *
  3. *----------------*
  4. * This module is the DLL interace for the TrueTalk SAPI5 engine
  5. *------------------------------------------------------------------------------
  6. * Copyright (C) 2000 Microsoft Corporation Date: 02/29/00
  7. * All Rights Reserved
  8. *
  9. ********************************************************************* PACOG ***/
  10. #include "stdafx.h"
  11. #include "resource.h"
  12. #include <initguid.h>
  13. #include "TrueTalk.h"
  14. const IID LIBID_SPTRUETALKLib = {0xEAAA999C,0xFCF0,0x412D,{0xAF,0xD9,0x08,0xD2,0xB5,0xE5,0x59,0xFD}};
  15. const CLSID CLSID_TrueTalk = {0x8E67289A,0x609C,0x4B68,{0x91,0x8B,0x5C,0x35,0x2D,0x9E,0x5D,0x38}};
  16. CComModule _Module;
  17. BEGIN_OBJECT_MAP(ObjectMap)
  18. OBJECT_ENTRY(CLSID_TrueTalk, CTrueTalk)
  19. END_OBJECT_MAP()
  20. /*****************************************************************************
  21. * DllMain *
  22. *---------*
  23. * Description:
  24. * DLL Entry Point
  25. ******************************************************************* PACOG ***/
  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_SPTRUETALKLib);
  32. DisableThreadLibraryCalls(hInstance);
  33. CTrueTalk::InitThreading();
  34. }
  35. else if (dwReason == DLL_PROCESS_DETACH)
  36. {
  37. _Module.Term();
  38. CTrueTalk::ReleaseThreading();
  39. }
  40. return TRUE; // ok
  41. }
  42. /*****************************************************************************
  43. * DllCanUnloadNow *
  44. *-----------------*
  45. * Description:
  46. * Used to determine whether the DLL can be unloaded by OLE
  47. ******************************************************************* PACOG ***/
  48. STDAPI DllCanUnloadNow(void)
  49. {
  50. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  51. }
  52. /*****************************************************************************
  53. * DllGetClassObject *
  54. *-------------------*
  55. * Description:
  56. * Returns a class factory to create an object of the requested type
  57. ******************************************************************* PACOG ***/
  58. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  59. {
  60. return _Module.GetClassObject(rclsid, riid, ppv);
  61. }
  62. /*****************************************************************************
  63. * DllRegisterServer *
  64. *--------------------*
  65. * Description:
  66. * Adds entries to the system registry
  67. ******************************************************************* PACOG ***/
  68. STDAPI DllRegisterServer(void)
  69. {
  70. // registers object, typelib and all interfaces in typelib
  71. return _Module.RegisterServer(FALSE);
  72. }
  73. /*****************************************************************************
  74. * DllUnregisterServer *
  75. *---------*
  76. * Description:
  77. * Removes entries from the system registry
  78. ******************************************************************* PACOG ***/
  79. STDAPI DllUnregisterServer(void)
  80. {
  81. return _Module.UnregisterServer(FALSE);
  82. }