PageRenderTime 28ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/native/external/espeak/platforms/windows/windows_sapi/ttseng.cpp

http://eyes-free.googlecode.com/
C++ | 77 lines | 40 code | 21 blank | 16 comment | 5 complexity | 348df7b76e82d70181c1f1d68c6d5c62 MD5 | raw file
 1// TtsEng.cpp : Implementation of DLL Exports.
 2//Copyright (c) Microsoft Corporation. All rights reserved.
 3
 4
 5// Note: Proxy/Stub Information
 6//      To build a separate proxy/stub DLL, 
 7//      run nmake -f msttsdrvps.mk in the project directory.
 8
 9#include "stdafx.h"
10#include "resource.h"
11#include <initguid.h>
12#include "TtsEng.h"
13#include "TtsEng_i.c"
14#include "TtsEngObj.h"
15
16
17
18CComModule _Module;
19
20BEGIN_OBJECT_MAP(ObjectMap)
21    OBJECT_ENTRY( CLSID_SampleTTSEngine   , CTTSEngObj    )
22END_OBJECT_MAP()
23
24/////////////////////////////////////////////////////////////////////////////
25// DLL Entry Point
26
27#ifdef _WIN32_WCE
28extern "C" BOOL WINAPI DllMain(HANDLE hInstance, ULONG dwReason, LPVOID)
29#else
30extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
31#endif
32{
33    if (dwReason == DLL_PROCESS_ATTACH)
34    {
35        _Module.Init(ObjectMap, (HINSTANCE)hInstance, &LIBID_SAMPLETTSENGLib);
36    }
37    else if (dwReason == DLL_PROCESS_DETACH)
38        _Module.Term();
39    return TRUE;    // ok
40}
41
42/////////////////////////////////////////////////////////////////////////////
43// Used to determine whether the DLL can be unloaded by OLE
44
45STDAPI DllCanUnloadNow(void)
46{
47    return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
48}
49
50/////////////////////////////////////////////////////////////////////////////
51// Returns a class factory to create an object of the requested type
52
53STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
54{
55    return _Module.GetClassObject(rclsid, riid, ppv);
56}
57
58/////////////////////////////////////////////////////////////////////////////
59// DllRegisterServer - Adds entries to the system registry
60
61STDAPI DllRegisterServer(void)
62{
63    // registers object, typelib and all interfaces in typelib
64    return _Module.RegisterServer(TRUE);
65}
66
67/////////////////////////////////////////////////////////////////////////////
68// DllUnregisterServer - Removes entries from the system registry
69
70STDAPI DllUnregisterServer(void)
71{
72    return _Module.UnregisterServer(TRUE);
73}
74
75
76
77