Jump to content
RCrandall

Is Graphics32 ready for Delphi 11 yet?

Recommended Posts

I have a project that I'm trying to move from 10.4.2 to 11 and the very last library I need a new version for is Graphics32.  As near as I can tell, it has not been brought up to Delphi 11 yet, but then I'm not very experienced with the nuts and bolts of this.  I downloaded the latest from GitHub but it not seem to even cover Delphi 10.4, specifically is was missing the "RX4" folder in \Source\Packages that I needed for 10.4.  My hazy recollection is that someone else contributed this at the time I got it.

 

There were GitHub commits within the last two weeks do it clearly is not dead, but I'm at a loss to figure out what its present status is either.  Is this project still being maintained?  Just having the source is wonderful, of course, but I have no appetite or skill to try and do the conversion to Delphi 11 myself.  Over the years, I've become very leary of trying to modify any third-party library in any way.

 

I'm hoping to try out the improvements in Delphi 11 but I'm blocked.  Can anyone point me to the right URL and tell me what the status of this library is?

 

Thanks in advance, Rob Crandall

 

 

Share this post


Link to post

Yes, and it reported 80 erorrs on the RX3 package and then 74 errors when I copied over the newer RX4 package.  One or two I might be able to handle, but not that many.  If only I knew just the right thing to do perhaps I could finesse it (that remains plan C for me) with some code or other changes, but that is a very deep dive to do right.  Plan B is to ask here to see if anyone else has run into this, and Plan A is to keep Googling to find the people and comments that helped me get it working for Delphi 10.4.  

 

Sincere thanks to everyone for looking at this and making suggestions!

 

Rob C

Share this post


Link to post

There is probably a central include file that needs updating for Delphi 11. And most likely this will fix all the compile errors.

  • Like 1

Share this post


Link to post

I would think that it's just a matter of adjusting the dependencies of the existing packages with the corresponding D11 dependencies and recompile, but I'll look into it.

Share this post


Link to post

Cool!  While you were doing that I manned up and tried to find the problem myself.  I updated the GR32_Compiler.inc file with some Delphi 11 info along the lines of the previous updated and darned if it didn't compile!  I was astonished.

 

Anyway, thank you Anders and I will very cheerfully use your package.  My main hope was that Delphi 11 would not have the endless IDE problems with Code Insight and related, and so far it is working perfectly!  More astonishment!  Some days that start badly just end up being good days after all.

 

Thanks everyone for your help.

 

Cheers, Rob C

  • Like 1

Share this post


Link to post
2 hours ago, RCrandall said:

While you were doing that I manned up and tried to find the problem myself.  I updated the GR32_Compiler.inc file with some Delphi 11 info along the lines of the previous updated and darned if it didn't compile!  I was astonished.

Well done. It usually turns out that there's very little that needs to be done to update a library to a new version, but the number of errors can be daunting until you realise that they are all the same error! 

  • Like 1

Share this post


Link to post

These jungles of compiler IFDEFs are horrible but spread very widely. Necessity of updating the file with each new compiler version (that Emba bakes out each year) is very dumb. Alas, IF clauses that allow MUCH simpler code appeared too late (in D7) and they still aren't correctly supported by IDE's CodeInsight 😞

Edited by Fr0sT.Brutal

Share this post


Link to post
3 hours ago, Fr0sT.Brutal said:

Necessity of updating the file with each new compiler version (that Emba bakes out each year) is very dumb.

I agree.

In my own code I assume "unknown version" = Last known version+1. That way new versions doesn't break the code and I very rarely need to update the include file.

Share this post


Link to post
20 minutes ago, Anders Melander said:

I agree.

In my own code I assume "unknown version" = Last known version+1. That way new versions doesn't break the code and I very rarely need to update the include file.

I came to the same conclusion when I was using traditional COMPILER_XX_UP. Then I switched to my own implementation based on IFs so now I have neat {$IF CompilerVersion >= RAD_XE4}

Share this post


Link to post
6 hours ago, Fr0sT.Brutal said:

Alas, IF clauses that allow MUCH simpler code appeared too late (in D7) and they still aren't correctly supported by IDE's CodeInsight 😞

Actually, the $IF compiler directive appeared in Delphi 6.

Share this post


Link to post
36 minutes ago, dummzeuch said:

Actually, the $IF compiler directive appeared in Delphi 6.

Thanks. This completely changes the things 😄

Now it's even more shameful for Borland/Emba to not support IF expressions in CodeInsight

Share this post


Link to post
Quote

These jungles of compiler IFDEFs are horrible but spread very widely. Necessity of updating the file with each new compiler version (that Emba bakes out each year) is very dumb.

It would be really cool if Embarcadero broke with tradition of ignoring anything older than one year and included a unified include file that provides all the conditions that numerous third party libraries need to keep supporting multiple compilers, which Embarcadero then updated and included with each new release.  We could even write it for them.

 

Component vendors would need a one-off update to the new format, and to include the initial version for the existing users, but would no longer need to keep updating their own versions. 

 

Angus

 

  • Like 3

Share this post


Link to post
1 hour ago, Angus Robertson said:

It would be really cool if Embarcadero ... included a unified include file

The last time I looked, they not only did not supply such a file, but also shipped an ancient version of jedi.inc (with the DUnit sources if I remember correctly). I had the misfortune of including that directory in the search path once and it took me hours to find the cause for the sudden compile errors.

Share this post


Link to post
6 hours ago, Angus Robertson said:

It would be really cool if Embarcadero broke with tradition of ignoring anything older than one year and included a unified include file that provides all the conditions that numerous third party libraries need to keep supporting multiple compilers, which Embarcadero then updated and included with each new release.  We could even write it for them.

That request is almost older than Delphi itself.

 

I get that they're not interested in making it easier to use old versions of the product, but I don't get that they aren't interested in making the lives of 3rd party developers easier (in this regard at least).

Share this post


Link to post
On 11/6/2021 at 9:05 PM, Anders Melander said:

I've just committed updated packages for Delphi 11 and added Delphi 11 to GR32_Compiler.inc (and cleaned it up a bit).

Hello Anders,

I try to use graphics32 package for Delphi11. I compiled GR 32 RD110 and GR 32 DD110 and installed GR 32 DD110. I can find components in Palette.

But when I drop TImage32 on Form1 and after compiling try to open file with a button click ( I am using C++ builder) :

 

void __fastcall TForm1::Button1Click(TObject *Sender)
{
Image321->Bitmap->LoadFromFile("Miki.bmp");
}

I first get:

Access violation in module rtl280.bpl  ( If I uncheck link with dynamic RTL, this message dissapears)

 

but then:

I get access violation at some address, which prevents loading the bitmap.

 

Can you give me an advice to overcome the trouble?

Borut

Share this post


Link to post
On 11/6/2021 at 9:05 PM, Anders Melander said:

I've just committed updated packages for Delphi 11 and added Delphi 11 to GR32_Compiler.inc (and cleaned it up a bit).

Hello Anders,

I try to use graphics32 package for Delphi11. I compiled GR 32 RD110 and GR 32 DD110 and installed GR 32 DD110. I can find components in Palette.

But when I drop TImage32 on Form1 and after compiling try to open file with a button click ( I am using C++ builder) :

 

void __fastcall TForm1::Button1Click(TObject *Sender)
{
Image321->Bitmap->LoadFromFile("Miki.bmp");
}

I first get:

Access violation in module rtl280.bpl  ( If I uncheck link with dynamic RTL, this message dissapears)

 

but then:

I get access violation at some address, which prevents loading the bitmap.

 

Can you give me an advice to overcome the trouble?

Borut

 

If I try the same in Delphi11:

 

procedure TForm1.Button1Click(Sender: TObject);
begin
Image321.Bitmap.LoadFromFile('Miki.bmp')
end;

end.

ž

it normally opens the bitmap

 

 

 

Edited by Borut

Share this post


Link to post
5 hours ago, Borut said:

Can you give me an advice to overcome the trouble?

I don't use C++ Builder so probably not.

Do you get errors at design-time or only at run-time?

If you get run-time errors then what's the call stack when the exception occurs?

Share this post


Link to post

Thanks for the reply.

I don't have problems at design time.  If I load bitmap into Image321 from Object Inspector, the image is normally shown in Image321 before and also after compiling.

It is only after compiling when I try to load bmp with button click:    Image321->Bitmap->LoadFromFile("Miki.bmp"), that error occurs.

The message I get in Events if run project with debugging is following:

Project Project1.exe raised exception class $C0000005 with message 'access violation at 0xeefeeefe: read of address 0xeefeeefe'. The blue arrow in the window is pointing to the line : Image321->Bitmap->LoadFromFile("Miki.bmp")

Borut

Share this post


Link to post
2 minutes ago, Borut said:

Project Project1.exe raised exception class $C0000005 with message 'access violation at 0xeefeeefe: read of address 0xeefeeefe'. The blue arrow in the window is pointing to the line : Image321->Bitmap->LoadFromFile("Miki.bmp")

Place a breakpoint on that line and inspect the value of Image321 and Image321->Bitmap. They should both be non-nil. If Image321 is nil then the control wasn't instantiated when the form was created. Since you appear to be using run-time packages then that will probably have something to do with it.

 

I still need the call stack when the exception is raised. If C++ Builder is like Delphi then you can select all the lines of the IDE's Call Stack window and copy them with Ctrl+Ins (or Ctrl+C).

 

Share this post


Link to post

Here is the copy of the call stack. I will try to inspect the values...

 

:00404439 TForm1::Button1Click(this=:024221E0, Sender=:023ED2C0)
:50cc8229 vcl280.@Vcl@Controls@TControl@Click$qqrv + 0x79
:50cccdc2 ; C:\Program Files (x86)\Embarcadero\Studio\22.0\bin\vcl280.bpl
:50cf006d vcl280.@Vcl@Stdctrls@TButtonControl@WndProc$qqrr24Winapi@Messages@TMessage + 0x71
:50cccf1c ; C:\Program Files (x86)\Embarcadero\Studio\22.0\bin\vcl280.bpl
:50cccdc2 ; C:\Program Files (x86)\Embarcadero\Studio\22.0\bin\vcl280.bpl
:50e035a9 ; C:\Program Files (x86)\Embarcadero\Studio\22.0\bin\vcl280.bpl
:50ccc33b vcl280.@Vcl@Controls@TWinControl@MainWndProc$qqrr24Winapi@Messages@TMessage + 0x2f
:50174202 rtl280.@System@Classes@TDataModule@WriteHeight$qqrp22System@Classes@TWriter + 0x22
:777e339b user32.AddClipboardFormatListener + 0x4b
:777da33a ; C:\Windows\SysWOW64\user32.dll
:777d9709 ; C:\Windows\SysWOW64\user32.dll
:777d7d4f user32.SendMessageW + 0x6f
:71536608 ; C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_a8625c1886757984\COMCTL32.dll
:71575f33 ; C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_a8625c1886757984\COMCTL32.dll
:777e339b user32.AddClipboardFormatListener + 0x4b
:777da33a ; C:\Windows\SysWOW64\user32.dll
:777d9a07 ; C:\Windows\SysWOW64\user32.dll
:777d7bab user32.CallWindowProcW + 0x1b
:50ccceca vcl280.@Vcl@Controls@TWinControl@DefaultHandler$qqrpv + 0xe6
:50cccdc2 ; C:\Program Files (x86)\Embarcadero\Studio\22.0\bin\vcl280.bpl
:50cf006d vcl280.@Vcl@Stdctrls@TButtonControl@WndProc$qqrr24Winapi@Messages@TMessage + 0x71
:50174202 rtl280.@System@Classes@TDataModule@WriteHeight$qqrp22System@Classes@TWriter + 0x22
:777e339b user32.AddClipboardFormatListener + 0x4b
:777da33a ; C:\Windows\SysWOW64\user32.dll
:777d809a ; C:\Windows\SysWOW64\user32.dll
:777d7e60 user32.DispatchMessageW + 0x10

Share this post


Link to post

I hope I am doing this wright...

If I put a breakpoint to the mentioned line and then inspect (Run...Inspect), I get:

for the Image321 a whole group of data with the top one: FBitmap ::02469B50

for the Image321->Bitmap a whole group of data with the top one: FOnHandleChange : NULL, NULL

 

If I Evaluate Image321 I get : E2003 Undeclared identifier: 'Image321'

 

Uf, I tried to inspect again and just got:

Error inspecting Image321, E2003 Undeclared identifier: 'Image321'

 

Share this post


Link to post

And again,

If try something else with Image321 like:

Image321->Top=random(500);

it changes its position with every button click,

but when I add in the next line:

Image321->Bitmap->LoadFromFile("Miki.bmp")

it reports access violation at address in module rtl280.bpl

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×