Leaked source code of windows server 2003
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.

78 lines
2.1 KiB

  1. // SAFRCFileDlg.cpp : Implementation of DLL Exports.
  2. // Note: Proxy/Stub Information
  3. // To build a separate proxy/stub DLL,
  4. // run nmake -f SAFRCFileDlgps.mk in the project directory.
  5. #include "stdafx.h"
  6. #include "resource.h"
  7. #include <initguid.h>
  8. #include "SAFRCFileDlg.h"
  9. #include "SAFRCFileDlg_i.c"
  10. #include "FileSave.h"
  11. #include "FileOpen.h"
  12. #include "Panic.h"
  13. #include "Setting.h"
  14. CComModule _Module;
  15. BEGIN_OBJECT_MAP(ObjectMap)
  16. OBJECT_ENTRY(CLSID_FileSave, CFileSave)
  17. OBJECT_ENTRY(CLSID_FileOpen, CFileOpen)
  18. OBJECT_ENTRY(CLSID_Panic, CPanic)
  19. OBJECT_ENTRY(CLSID_RASetting, CSetting)
  20. END_OBJECT_MAP()
  21. /////////////////////////////////////////////////////////////////////////////
  22. // DLL Entry Point
  23. extern "C"
  24. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  25. {
  26. if (dwReason == DLL_PROCESS_ATTACH)
  27. {
  28. _Module.Init(ObjectMap, hInstance, &LIBID_SAFRCFILEDLGLib);
  29. DisableThreadLibraryCalls(hInstance);
  30. }
  31. else if (dwReason == DLL_PROCESS_DETACH)
  32. _Module.Term();
  33. return TRUE; // ok
  34. }
  35. /////////////////////////////////////////////////////////////////////////////
  36. // Used to determine whether the DLL can be unloaded by OLE
  37. STDAPI DllCanUnloadNow(void)
  38. {
  39. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  40. }
  41. /////////////////////////////////////////////////////////////////////////////
  42. // Returns a class factory to create an object of the requested type
  43. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  44. {
  45. return _Module.GetClassObject(rclsid, riid, ppv);
  46. }
  47. /////////////////////////////////////////////////////////////////////////////
  48. // DllRegisterServer - Adds entries to the system registry
  49. STDAPI DllRegisterServer(void)
  50. {
  51. // registers object, typelib and all interfaces in typelib
  52. return _Module.RegisterServer(TRUE);
  53. }
  54. /////////////////////////////////////////////////////////////////////////////
  55. // DllUnregisterServer - Removes entries from the system registry
  56. STDAPI DllUnregisterServer(void)
  57. {
  58. return _Module.UnregisterServer(TRUE);
  59. }