classes.pp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. {
  2. This file is part of the Free Component Library (FCL)
  3. Copyright (c) 1998-2006 by Michael Van Canneyt and Florian Klaempfl
  4. Classes unit for winx64
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {$mode objfpc}
  12. {$H+}
  13. {$modeswitch advancedrecords}
  14. {$IF FPC_FULLVERSION>=30301}
  15. {$modeswitch FUNCTIONREFERENCES}
  16. {$define FPC_HAS_REFERENCE_PROCEDURE}
  17. {$endif}
  18. { determine the type of the resource/form file }
  19. { $define Win16Res}
  20. {$IFNDEF FPC_DOTTEDUNITS}
  21. unit Classes;
  22. {$ENDIF FPC_DOTTEDUNITS}
  23. interface
  24. {$IFDEF FPC_DOTTEDUNITS}
  25. uses
  26. System.RtlConsts,
  27. System.SysUtils,
  28. System.Types,
  29. System.SortBase,
  30. {$ifdef FPC_TESTGENERICS}
  31. System.FGL,
  32. {$endif}
  33. System.TypInfo,
  34. WinApi.Windows;
  35. {$ELSE FPC_DOTTEDUNITS}
  36. uses
  37. rtlconsts,
  38. sysutils,
  39. types,
  40. sortbase,
  41. {$ifdef FPC_TESTGENERICS}
  42. fgl,
  43. {$endif}
  44. typinfo,
  45. windows;
  46. {$ENDIF FPC_DOTTEDUNITS}
  47. type
  48. TWndMethod = procedure(var msg : TMessage) of object;
  49. function MakeObjectInstance(Method: TWndMethod): Pointer;
  50. procedure FreeObjectInstance(ObjectInstance: Pointer);
  51. function AllocateHWnd(Method: TWndMethod): HWND;
  52. procedure DeallocateHWnd(Wnd: HWND);
  53. {$i classesh.inc}
  54. implementation
  55. {$IFDEF FPC_DOTTEDUNITS}
  56. uses
  57. System.SysConst;
  58. {$ELSE FPC_DOTTEDUNITS}
  59. uses
  60. sysconst;
  61. {$ENDIF FPC_DOTTEDUNITS}
  62. { OS - independent class implementations are in /inc directory. }
  63. {$i classes.inc}
  64. function MakeObjectInstance(Method: TWndMethod): Pointer;
  65. begin
  66. runerror(211);
  67. MakeObjectInstance:=nil;
  68. end;
  69. procedure FreeObjectInstance(ObjectInstance: Pointer);
  70. begin
  71. runerror(211);
  72. end;
  73. function AllocateHWnd(Method: TWndMethod): HWND;
  74. begin
  75. runerror(211);
  76. AllocateHWnd:=0;
  77. end;
  78. procedure DeallocateHWnd(Wnd: HWND);
  79. begin
  80. runerror(211);
  81. end;
  82. initialization
  83. CommonInit;
  84. finalization
  85. CommonCleanup;
  86. end.