PageRenderTime 51ms CodeModel.GetById 21ms RepoModel.GetById 0ms 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. #include "stdafx.h"
  3. #include "resource.h"
  4. class CCppOfficeManagedCOMAddInShimModule :
  5. public CAtlDllModuleT< CCppOfficeManagedCOMAddInShimModule >
  6. {
  7. public :
  8. DECLARE_NO_REGISTRY()
  9. };
  10. CCppOfficeManagedCOMAddInShimModule _AtlModule;
  11. // DLL Entry Point.
  12. extern "C" BOOL WINAPI DllMain(
  13. HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
  14. {
  15. return _AtlModule.DllMain(dwReason, lpReserved);
  16. }
  17. // Used to determine whether the DLL can be unloaded by OLE.
  18. STDAPI DllCanUnloadNow(void)
  19. {
  20. return _AtlModule.DllCanUnloadNow();
  21. }
  22. // Returns a class factory to create an object of the requested type.
  23. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  24. {
  25. return _AtlModule.DllGetClassObject(rclsid, riid, ppv);
  26. }
  27. // DllRegisterServer - Adds entries to the system registry.
  28. STDAPI DllRegisterServer(void)
  29. {
  30. // Registers object, typelib and all interfaces in typelib.
  31. return _AtlModule.DllRegisterServer(FALSE);
  32. }
  33. // DllUnregisterServer - Removes entries from the system registry.
  34. STDAPI DllUnregisterServer(void)
  35. {
  36. return _AtlModule.DllUnregisterServer(FALSE);
  37. }