I finished an old pet project of making a very common unit floating around for GDIPLUS to work with older fpc.
The compiler in question is 3.0.4. 64bit, windows 10.
I've done IInterface objects before and they worked find but this GDIPLUS or the compiler has a problem with something.
procedure TForm1.Button1Click(Sender: TObject);
var
I:TGDiPlusStartUpInPut;
Token:ULong;
G:TGPGraphics;
P:TGPPen;
C:TGPCOlor;
S:TGPStatus;
begin
I.Intialize;
S:=GDiPlusStartUP(Token,@I,Nil);
G:=TGPGraphics.DCCreate(Canvas.Handle);
P:=TGPPen.Create(TGPCOlor.BurlyWood,2);
G.DrawLine(P,0,0,200,100); //<<<<<< Compiler can't find any members of the Interface.
P.Free;
G.Free;
GDIPlusShutdown(Token);
end;
The code above works basically because up to that line I pointed out, it's calling non interface members.
but when it gets to the DRAWLINE or any interface member of G, the graphics interface, the compiler has gone brain dead.
unit1.pas(46,5) Error: identifier idents no member "DrawLine"
or any member that happens to be an interface method.
procedure DrawLine(const Pen: IGPPen; const Pt1, Pt2: TGPPointF); overload;
procedure DrawLine(const Pen: IGPPen; const X1, Y1, X2, Y2: Single); overload;
procedure DrawLine(const Pen: IGPPen; const Pt1, Pt2: TGPPoint); overload;
procedure DrawLine(const Pen: IGPPen; const X1, Y1, X2, Y2: Integer); overload;
As you can see, there are plenty of DrawLine methods there.
Does anyone know why the compiler can't find these methods at compile time?
EDIT:
Attached is a project and I hope the GDIPLUS came with it.