Forum > Graphics
GR32 GR_Bindings problem
(1/1)
staratel20:
Hi everyone!
I am encountering this problem when trying to compile my project, that uses GR32. It always breaks at this line:
P := @(TFunctionBindingListCracker(FBindings).FItems);
with Invalid typecast error. This is unit GR32_Bindings, initialization section of proc:
procedure TFunctionRegistry.RebindAll(PriorityCallback: TFunctionPriority);
I successfully run GR32 examples, which uses this module and this line goes just fine. I've checked all checkboxes in the example compiler options to be assured that they are identical to my project, but problem still exist.
Does anyone know how to fix this?
marcov:
That part of code changed 6 months ago (https://github.com/graphics32/graphics32/blame/master/Source/GR32_Bindings.pas) when they mandatory required generics (no more pre unicode delphi?)
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$IFNDEF FPC} Info := @FItems.List[i];{$ELSE} Info := @(TFunctionInfoListCracker(FItems).FItems[i]);{$ENDIF}
Try to combine the delphi part of the ifdef with the FPC code.
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- Info := @(TFunctionInfoListCracker(FItems).list[i]);
and similar for the p:= occurance.
Note the "list" instead of a second fitems.
staratel20:
I've tried to modify code like this:
{$IFNDEF FPC}
P := @FBindings.List;
{$ELSE}
// next line was modified to eliminate error
P := @(TFunctionBindingListCracker(FBindings).List);
{$ENDIF}
but now I have:
GR32_Bindings.pas(453,1) Error: identifier idents no member "List"
more of it... it is still unclear for me, why example works with unmodified version while uses this unit
PascalDragon:
--- Quote from: staratel20 on January 20, 2025, 12:50:04 am ---I've tried to modify code like this:
--- End quote ---
Please use [code=pascal][/code]-tags to avoid the forum software interpreting your code.
Navigation
[0] Message Index