PageRenderTime 15ms CodeModel.GetById 1ms app.highlight 9ms RepoModel.GetById 2ms app.codeStats 0ms

/Visual Studio 2008/CppOfficeManagedCOMAddInShim/CppOfficeManagedCOMAddInShim.cpp

#
C++ | 45 lines | 30 code | 8 blank | 7 comment | 0 complexity | 3343cf91aab911e27d9a94c8e8490c26 MD5 | raw file
 1// CppOfficeManagedCOMAddInShim.cpp : Implementation of DLL Exports.
 2
 3#include "stdafx.h"
 4#include "resource.h"
 5
 6class CCppOfficeManagedCOMAddInShimModule : 
 7	public CAtlDllModuleT< CCppOfficeManagedCOMAddInShimModule >
 8{
 9public :
10	DECLARE_NO_REGISTRY()
11};
12
13CCppOfficeManagedCOMAddInShimModule _AtlModule;
14
15// DLL Entry Point.
16extern "C" BOOL WINAPI DllMain(
17	HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
18{
19    return _AtlModule.DllMain(dwReason, lpReserved); 
20}
21
22// Used to determine whether the DLL can be unloaded by OLE.
23STDAPI DllCanUnloadNow(void)
24{
25    return _AtlModule.DllCanUnloadNow();
26}
27
28// Returns a class factory to create an object of the requested type.
29STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
30{
31    return _AtlModule.DllGetClassObject(rclsid, riid, ppv);
32}
33
34// DllRegisterServer - Adds entries to the system registry.
35STDAPI DllRegisterServer(void)
36{
37    // Registers object, typelib and all interfaces in typelib.
38    return _AtlModule.DllRegisterServer(FALSE);
39}
40
41// DllUnregisterServer - Removes entries from the system registry.
42STDAPI DllUnregisterServer(void)
43{
44	return _AtlModule.DllUnregisterServer(FALSE);
45}