DataProvider.dpr 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. library DataProvider;
  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. Windows,
  15. System.SysUtils,
  16. System.Classes,
  17. Vcl.Forms,
  18. BaseDataModule in 'BaseDataModule.pas' {BaseDataModel: TDataModule},
  19. InterfaceDataProvider in 'InterfaceDataProvider.pas',
  20. AppNoticeProvicer in 'AppNoticeProvicer.pas',
  21. AppIcon in 'AppIcon.pas',
  22. BaseDataProvider in 'BaseDataProvider.pas',
  23. DataProviderImport in 'DataProviderImport.pas',
  24. MapTeamUsers in 'Team\MapTeamUsers.pas',
  25. TeamDBProvider in 'Team\TeamDBProvider.pas',
  26. DataModel in 'DataModel.pas',
  27. UsersDBProvider in 'Users\UsersDBProvider.pas',
  28. HashDBProvider in 'HashDBProvider.pas',
  29. UsersHashProvider in 'Users\UsersHashProvider.pas',
  30. DataModule in 'DataModule.pas',
  31. Config in 'Config.pas';
  32. {$R *.res}
  33. const
  34. DLL_PROCESS_DETACH = 0;
  35. DLL_PROCESS_ATTACH = 1;
  36. DLL_THREAD_ATTACH = 2;
  37. DLL_THREAD_DETACH = 3;
  38. var
  39. OldDllProc: TDLLProc;
  40. procedure ThisDllProc(Reason: Integer);
  41. begin
  42. // case Reason of
  43. // DLL_PROCESS_DETACH:OutputDebugString('---------------------DLL_PROCESS_DETACH---------------------DataProvider');
  44. // DLL_PROCESS_ATTACH:OutputDebugString('+++++++++++++++++++++DLL_PROCESS_ATTACH---------------------DataProvider');
  45. // DLL_THREAD_ATTACH:OutputDebugString('+++++++++++++++++++++DLL_THREAD_ATTACH---------------------DataProvider');
  46. // DLL_THREAD_DETACH:OutputDebugString('---------------------DLL_THREAD_DETACH---------------------DataProvider');
  47. // end;
  48. if Reason = DLL_THREAD_ATTACH then
  49. IsMultiThread := True;
  50. if Assigned(OldDllProc) then
  51. // begin
  52. OldDllProc(Reason);
  53. // OutputDebugString('ÓÐOldDllProc');
  54. // end
  55. // else
  56. // OutputDebugString('ÎÞOldDllProc');
  57. end;
  58. begin
  59. OldDllProc := DllProc;
  60. DllProc := ThisDllProc;
  61. ThisDllProc(DLL_PROCESS_ATTACH);
  62. BeanFactory.RegisterBean('DataModule', TDataModule, True);
  63. BeanFactory.RegisterBean('AppIconProvider', TAppIconProvider, True);
  64. BeanFactory.RegisterBean('UsersHashProvider', TUsersHashProvider, True);
  65. BeanFactory.RegisterBean('MapTeamUsersProvider', TMapTeamUsersProvider, True);
  66. BeanFactory.RegisterBean('ConfigProvider', TConfigProvider, True);
  67. end.