Config.dpr 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. library Config;
  2. { Important note about DLL memory management: ShareMem must be the
  3. first unit in your library's USES clause AND your project's (select
  4. Project-View Source) USES clause if your DLL exports any procedures or
  5. functions that pass strings as parameters or function results. This
  6. applies to all strings passed to and from your DLL--even those that
  7. are nested in records and classes. ShareMem is the interface unit to
  8. the BORLNDMM.DLL shared memory manager, which must be deployed along
  9. with your DLL. To avoid using BORLNDMM.DLL, pass string information
  10. using PChar or ShortString parameters. }
  11. uses
  12. FastMM4,
  13. mybean.core.beanFactory,
  14. SysUtils,
  15. Classes,
  16. Windows,
  17. UIViewConfig in 'UIViewConfig.pas',
  18. BaseConfig in 'BaseConfig.pas',
  19. TestConfig in 'TestConfig.pas',
  20. InterfaceConfig in '..\Interfaces\InterfaceConfig.pas',
  21. ConfigImport in '..\Interfaces\ConfigImport.pas',
  22. HotKeyConfig in 'HotKeyConfig.pas',
  23. FaceConfig in 'FaceConfig.pas',
  24. FontConfig in 'FontConfig.pas',
  25. NetConfig in 'NetConfig.pas',
  26. ClientConfig in 'ClientConfig.pas',
  27. GroupConfig in 'GroupConfig.pas',
  28. GroupShareConfig in 'GroupShareConfig.pas',
  29. OfflineFileConfig in 'OfflineFileConfig.pas',
  30. AppCentreConfig in 'AppCentreConfig.pas',
  31. CaConfig in 'CaConfig.pas',
  32. BehaviorConfig in 'BehaviorConfig.pas';
  33. {$R *.res}
  34. const
  35. DLL_PROCESS_DETACH = 0;
  36. DLL_PROCESS_ATTACH = 1;
  37. DLL_THREAD_ATTACH = 2;
  38. DLL_THREAD_DETACH = 3;
  39. var
  40. OldDllProc: TDLLProc;
  41. procedure ThisDllProc(Reason: Integer);
  42. begin
  43. case Reason of
  44. DLL_PROCESS_DETACH:OutputDebugString('---------------------DLL_PROCESS_DETACH---------------------Config');
  45. DLL_PROCESS_ATTACH:OutputDebugString('+++++++++++++++++++++DLL_PROCESS_ATTACH---------------------Config');
  46. DLL_THREAD_ATTACH:OutputDebugString('+++++++++++++++++++++DLL_THREAD_ATTACH---------------------Config');
  47. DLL_THREAD_DETACH:OutputDebugString('---------------------DLL_THREAD_DETACH---------------------Config');
  48. end;
  49. if Reason = DLL_THREAD_ATTACH then
  50. IsMultiThread := True;
  51. if Assigned(OldDllProc) then
  52. OldDllProc(Reason);
  53. end;
  54. begin
  55. OldDllProc := DllProc;
  56. DllProc := ThisDllProc;
  57. ThisDllProc(DLL_PROCESS_ATTACH);
  58. BeanFactory.RegisterBean(CONFIG_APPCENTRE, TAppCentreConfig, True);
  59. BeanFactory.RegisterBean(CONFIG_CLIENT, TClientConfig, True);
  60. BeanFactory.RegisterBean(CONFIG_FONT, TFontConfig, True);
  61. BeanFactory.RegisterBean(CONFIG_GROUP, TGroupConfig, True);
  62. BeanFactory.RegisterBean(CONFIG_GROUPSHARE, TGroupShareConfig, True);
  63. BeanFactory.RegisterBean(CONFIG_HOTKEY, THotkeyConfig, True);
  64. BeanFactory.RegisterBean(CONFIG_FACE, TFaceConfig, True);
  65. BeanFactory.RegisterBean(CONFIG_OFFLINEFILE, TOfflineFileConfig, True);
  66. BeanFactory.RegisterBean(CONFIG_NET, TNetConfig, True);
  67. BeanFactory.RegisterBean(CONFIG_UIVIEW, TUIViewConfig, True);
  68. BeanFactory.RegisterBean(CONFIG_CA, TCaConfig, True);
  69. BeanFactory.RegisterBean(CONFIG_BEHAVIOR, TBehaviorConfig, True);
  70. BeanFactory.RegisterBean(CONFIG_TEST, TTestConfig, True);
  71. end.