delphi-10.1-berlin

How to access a private field from a class helper in Delphi 10.1 Berlin?

﹥>﹥吖頭↗ 提交于 2019-11-27 03:23:14
问题 I would like to use Gabriel Corneanu's jpegex, a class helper for jpeg.TJPEGImage. Reading this and this I've learned that beyond Delphi Seattle you cannot access private fields anymore like jpegex does (FData in the example below). Poking around with the VMT like David Heffernan proposed is far beyond me. Is there any easier way to get this done? type // helper to access TJPEGData fields TJPEGDataHelper = class helper for TJPEGData function Data: TCustomMemoryStream; inline; procedure

How to access private methods without helpers?

天涯浪子 提交于 2019-11-26 22:11:09
In Delphi 10 Seattle I could use the following code to work around overly strict visibility restrictions. How do I get access to private variables? type TBase = class(TObject) private FMemberVar: integer; end; And how do I get access to plain or virtual private methods? type TBase2 = class(TObject) private procedure UsefullButHidden; procedure VirtualHidden; virtual; procedure PreviouslyProtected; override; end; Previously I would use a class helper to break open the base class. type TBaseHelper = class helper for TBase function GetMemberVar: integer; In Delphi 10.1 Berlin, class helpers no