classes.pp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. {$IF FPC_FULLVERSION>=30301}
  14. {$modeswitch FUNCTIONREFERENCES}
  15. {$define FPC_HAS_REFERENCE_PROCEDURE}
  16. {$endif}
  17. { determine the type of the resource/form file }
  18. { $define Win16Res}
  19. unit Classes;
  20. interface
  21. uses
  22. rtlconsts,
  23. sysutils,
  24. types,
  25. sortbase,
  26. {$ifdef FPC_TESTGENERICS}
  27. fgl,
  28. {$endif}
  29. typinfo,
  30. windows;
  31. type
  32. TWndMethod = procedure(var msg : TMessage) of object;
  33. function MakeObjectInstance(Method: TWndMethod): Pointer;
  34. procedure FreeObjectInstance(ObjectInstance: Pointer);
  35. function AllocateHWnd(Method: TWndMethod): HWND;
  36. procedure DeallocateHWnd(Wnd: HWND);
  37. {$i classesh.inc}
  38. implementation
  39. uses
  40. sysconst;
  41. { OS - independent class implementations are in /inc directory. }
  42. {$i classes.inc}
  43. function MakeObjectInstance(Method: TWndMethod): Pointer;
  44. begin
  45. runerror(211);
  46. MakeObjectInstance:=nil;
  47. end;
  48. procedure FreeObjectInstance(ObjectInstance: Pointer);
  49. begin
  50. runerror(211);
  51. end;
  52. function AllocateHWnd(Method: TWndMethod): HWND;
  53. begin
  54. runerror(211);
  55. AllocateHWnd:=0;
  56. end;
  57. procedure DeallocateHWnd(Wnd: HWND);
  58. begin
  59. runerror(211);
  60. end;
  61. initialization
  62. CommonInit;
  63. finalization
  64. CommonCleanup;
  65. end.