1

When building a program that uses the Graphics32 library (the old 1.9.1 version) with Delphi XE4 (targeting Win32, if it matters), I got the following compiler error:

[dcc32 Error] GR32_LowLevel.pas(1240): E2010 Incompatible >types: 'PPointer' and 'Pointer'

Which is produced by this line: Registry.RegisterBinding(FID_FILLLONGWORD, @@FillLongWord);

Where RegisterBinding is defined as:

procedure RegisterBinding(FunctionID: Integer; BindVariable: PPointer);

And FillLongword is defined as:

var
  FillLongword: procedure(var X; Count: Cardinal; Value: Longword);

How to resolve the compiler error? To my eyes it seems that the syntax is correct, isn't @@ means 'pointer of pointer', which is PPointer? Thanks.

Edwin Yip
  • 4,089
  • 4
  • 40
  • 86
  • `@@` means address of procedural variable. Documented here: http://docwiki.embarcadero.com/RADStudio/Rio/en/Procedural_Types_(Delphi) – David Heffernan Mar 05 '20 at 17:00
  • Which version of graphics32 are you using? Are you pulling the latest from the repo? – David Heffernan Mar 05 '20 at 17:00
  • @DavidHeffernan, updated the Q, it's the old gr32 1.9.1 version, not the latest repos. Because I'm using Angus's old `GR32_Objects` – Edwin Yip Mar 05 '20 at 18:05
  • I wonder why is it a PPointer and not a TFillLongword, or possibly a TFillValue, or perhaps TDoSomething.... – Sertac Akyuz Mar 06 '20 at 02:56
  • @SertacAkyuz, because `RegisterBinding` accepts different definitions of procedure/functions - in other words, functions passed as `BindVariable' might have different parameters. – Edwin Yip Mar 06 '20 at 05:35
  • Upgraded to the latest Grapics32 github repository and there is no such a compilation error with it. However, I guess the original question is still valid as a Delphi programming question, so I'll keep this post. – Edwin Yip Mar 09 '20 at 04:43

0 Answers0