| 1 |
/////////////////////////////////////////////////////////////////////////// |
| 2 |
// // |
| 3 |
// Cepstral, LLC // |
| 4 |
// Copyright (c) 2001 // |
| 5 |
// All Rights Reserved. // |
| 6 |
// // |
| 7 |
// Permission is hereby granted, free of charge, to use and distribute // |
| 8 |
// this software and its documentation without restriction, including // |
| 9 |
// without limitation the rights to use, copy, modify, merge, publish, // |
| 10 |
// distribute, sublicense, and/or sell copies of this work, and to // |
| 11 |
// permit persons to whom this work is furnished to do so, subject to // |
| 12 |
// the following conditions: // |
| 13 |
// 1. The code must retain the above copyright notice, this list of // |
| 14 |
// conditions and the following disclaimer. // |
| 15 |
// 2. Any modifications must be clearly marked as such. // |
| 16 |
// 3. Original authors' names are not deleted. // |
| 17 |
// 4. The authors' names are not used to endorse or promote products // |
| 18 |
// derived from this software without specific prior written // |
| 19 |
// permission. // |
| 20 |
// // |
| 21 |
// CEPSTRAL, LLC AND THE CONTRIBUTORS TO THIS WORK DISCLAIM ALL // |
| 22 |
// WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED // |
| 23 |
// WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL // |
| 24 |
// CEPSTRAL, LLC NOR THE CONTRIBUTORS BE LIABLE FOR ANY SPECIAL, // |
| 25 |
// INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER // |
| 26 |
// RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION // |
| 27 |
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR // |
| 28 |
// IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. // |
| 29 |
// // |
| 30 |
/////////////////////////////////////////////////////////////////////////// |
| 31 |
// Author: David Huggins-Daines ([email protected]) // |
| 32 |
// Date: November 2001 // |
| 33 |
/////////////////////////////////////////////////////////////////////////// |
| 34 |
|
| 35 |
// FliteCMUKalDiphone.cpp : Implementation of DLL Exports. |
| 36 |
|
| 37 |
|
| 38 |
// Note: Proxy/Stub Information |
| 39 |
// To build a separate proxy/stub DLL, |
| 40 |
// run nmake -f FliteCMUKalDiphoneps.mk in the project directory. |
| 41 |
|
| 42 |
#include "stdafx.h" |
| 43 |
#include "resource.h" |
| 44 |
#include <initguid.h> |
| 45 |
#include "FliteCMUKalDiphone.h" |
| 46 |
|
| 47 |
#include "FliteCMUKalDiphone_i.c" |
| 48 |
#include "FliteCMUKalDiphoneObj.h" |
| 49 |
|
| 50 |
|
| 51 |
CComModule _Module; |
| 52 |
|
| 53 |
BEGIN_OBJECT_MAP(ObjectMap) |
| 54 |
OBJECT_ENTRY(CLSID_FliteCMUKalDiphoneObj, CFliteCMUKalDiphoneObj) |
| 55 |
END_OBJECT_MAP() |
| 56 |
|
| 57 |
///////////////////////////////////////////////////////////////////////////// |
| 58 |
// DLL Entry Point |
| 59 |
|
| 60 |
extern "C" |
| 61 |
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/) |
| 62 |
{ |
| 63 |
if (dwReason == DLL_PROCESS_ATTACH) |
| 64 |
{ |
| 65 |
_Module.Init(ObjectMap, hInstance, &LIBID_FLITECMUKALDIPHONELib); |
| 66 |
DisableThreadLibraryCalls(hInstance); |
| 67 |
} |
| 68 |
else if (dwReason == DLL_PROCESS_DETACH) |
| 69 |
_Module.Term(); |
| 70 |
return TRUE; // ok |
| 71 |
} |
| 72 |
|
| 73 |
///////////////////////////////////////////////////////////////////////////// |
| 74 |
// Used to determine whether the DLL can be unloaded by OLE |
| 75 |
|
| 76 |
STDAPI DllCanUnloadNow(void) |
| 77 |
{ |
| 78 |
return (_Module.GetLockCount()==0) ? S_OK : S_FALSE; |
| 79 |
} |
| 80 |
|
| 81 |
///////////////////////////////////////////////////////////////////////////// |
| 82 |
// Returns a class factory to create an object of the requested type |
| 83 |
|
| 84 |
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) |
| 85 |
{ |
| 86 |
return _Module.GetClassObject(rclsid, riid, ppv); |
| 87 |
} |
| 88 |
|
| 89 |
///////////////////////////////////////////////////////////////////////////// |
| 90 |
// DllRegisterServer - Adds entries to the system registry |
| 91 |
|
| 92 |
STDAPI DllRegisterServer(void) |
| 93 |
{ |
| 94 |
// registers object, typelib and all interfaces in typelib |
| 95 |
return _Module.RegisterServer(TRUE); |
| 96 |
} |
| 97 |
|
| 98 |
///////////////////////////////////////////////////////////////////////////// |
| 99 |
// DllUnregisterServer - Removes entries from the system registry |
| 100 |
|
| 101 |
STDAPI DllUnregisterServer(void) |
| 102 |
{ |
| 103 |
return _Module.UnregisterServer(TRUE); |
| 104 |
} |
| 105 |
|
| 106 |
|