AppCentre.dpr 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. library AppCentre;
  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. SysUtils,
  14. Classes,
  15. Windows,
  16. mybean.core.beanFactory,
  17. AppCentreForm in 'AppCentreForm.pas' {AppCentreFrm},
  18. UAppCentre in 'UAppCentre.pas',
  19. XXTEA in 'XXTEA.pas',
  20. AppsLayout in 'AppsLayout.pas',
  21. IdHttpEx in 'IdHttpEx.pas',
  22. FlatForm in 'FlatForm.pas',
  23. UIHandler in '..\Interfaces\UIHandler.pas',
  24. IconRequest in 'IconRequest.pas',
  25. MessageCentre in 'MessageCentre.pas' {MessageCentreForm},
  26. ChromeDebug in 'ChromeDebug.pas' {ChromeDebugForm},
  27. UApp in 'UApp.pas',
  28. AppCentreImport in '..\Interfaces\AppCentreImport.pas',
  29. InterfaceAppCentre in '..\Interfaces\InterfaceAppCentre.pas';
  30. {$R *.res}
  31. const
  32. DLL_PROCESS_DETACH = 0;
  33. DLL_PROCESS_ATTACH = 1;
  34. DLL_THREAD_ATTACH = 2;
  35. DLL_THREAD_DETACH = 3;
  36. var
  37. OldDllProc: TDLLProc;
  38. procedure ThisDllProc(Reason: Integer);
  39. begin
  40. case Reason of
  41. DLL_PROCESS_DETACH:OutputDebugString('---------------------DLL_PROCESS_DETACH---------------------AppCentre');
  42. DLL_PROCESS_ATTACH:OutputDebugString('+++++++++++++++++++++DLL_PROCESS_ATTACH---------------------AppCentre');
  43. DLL_THREAD_ATTACH:OutputDebugString('+++++++++++++++++++++DLL_THREAD_ATTACH---------------------AppCentre');
  44. DLL_THREAD_DETACH:OutputDebugString('---------------------DLL_THREAD_DETACH---------------------AppCentre');
  45. end;
  46. if Reason = DLL_THREAD_ATTACH then
  47. IsMultiThread := True;
  48. if Assigned(OldDllProc) then
  49. OldDllProc(Reason);
  50. end;
  51. begin
  52. OldDllProc := DllProc;
  53. DllProc := ThisDllProc;
  54. ThisDllProc(DLL_PROCESS_ATTACH);
  55. BeanFactory.RegisterBean(APPCENTRE_BEANNAME, TAppCentre);
  56. BeanFactory.RegisterBean(APPCENTRE_UIHANDLER, TUIHandler);
  57. end.