Delphi Pages Forums

Delphi Pages Forums (http://www.delphipages.com/forum/index.php)
-   General (http://www.delphipages.com/forum/forumdisplay.php?f=2)
-   -   problems porting an app from Delphi 7 to 10 (http://www.delphipages.com/forum/showthread.php?t=217319)

DavidB3 12-02-2015 10:55 AM

problems porting an app from Delphi 7 to 10
 
Hi.

I am trying to port a small application from Delphi 7 to Delphi 10 Seattle.
I've solved most of the problems except for these:

1. The 64 bit version does not start. It says "missing crtdll.dll". But I found it in 3 locations: System32, SysWOW64 and WinSxS.
If I copy the dll near the exe file it says "The application was unable to start correctly (0xc000007b). Click OK to close the application.".
I searched on Google and it says it's a problem somewhere in my OS (Windows 8.1 x64 Pro). But I tried many fixes I found without luck.
What is strange is that a (much) simpler 64 bit project generates a 64 bit exe which I can start without this problem...
My guess is in the rest of the code is something Delphi 10 doesn't like. But it's a lot of code to test so it's like searching for a needle in a haystack...
Maybe someone has an idea where the problem is or how to find it faster.

2. The application uses Listview. In the newest version from comctl32.dll (>= 6 version, in my OS 6.16 version) the user can resize the headers/columns seeing the modification(s) instantly, not after releasing the mouse button like in the previous version.
But the problem is the nearby displayed icons + the blue selection rectangle are been corrupted. If I force a refresh it displays fine.
The problem can be reproduced in any project.
Does anybody knows a fix/workaround?

3. In a Listview draw event I modify the color of the text and/or its background color for items/columns. I don't draw them, I just let the Listview do it (using these values).
But it's not changing the background of the icons (still clWindow like the rest of the Canvas). I can try to draw them in one of the *draw* events from Listview but I don't know how to achieve these:
- not break something else (like the resize of the Listview and/or the headers/columns resize);
- combine the transparent icons with this color using alpha blending.
Maybe someone knows how...

Can anyone help me please...?


Delphi 7 sources:

https://drive.google.com/file/d/0ByK...ew?usp=sharing


Delphi 10 Seattle sources:

https://drive.google.com/file/d/0ByK...ew?usp=sharing

kolbasz 12-02-2015 01:55 PM

Hi DavidB3,

Long time no see! According to the documentation, "crtdll.dll" is only needed for compatibility with older version of windows. You should replace it with "msvcrt.dll":

function crt_isspace(ch: Integer): Integer; cdecl; external 'msvcrt.dll' name 'isspace';
//...

regards,
kolbasz

DavidB3 12-02-2015 02:06 PM

Good to see you too :)

Yes, it worked, now I can start the 64 bit version too.

Thank you :)

kolbasz 12-02-2015 04:48 PM

You're welcome! I'm glad its' working. :)
The project looks great, good job!

DavidB3 12-03-2015 03:37 AM

Thanks.
But, as you can see, I still got some problems to solve :(


Just so everyone could see the other 2 problems:

https://drive.google.com/file/d/0ByK...ew?usp=sharing

https://drive.google.com/file/d/0ByK...ew?usp=sharing

kolbasz 12-03-2015 06:27 AM

Can you make a simple application, just a listbox that reproduce the issues? The problem is you have so many setting, resource files, etc... plus don't have VirtualBox installed. It's very hard to test your project in this conditions.

DavidB3 12-03-2015 07:41 AM

You're right.

So here is a much simpler application to test:

https://drive.google.com/file/d/0ByK...ew?usp=sharing

kolbasz 12-03-2015 01:39 PM

1 Attachment(s)
First of all I don't have Delphi Seattle so I made the changes in XE4. Anyway you should be able to compile without any modification. VCL has not changed much since XE2-->Seattle.
It's not perfect, you should add more stuff like transparent selection, hot item, etc...but at least it's working(very similar with the D7 version).

DavidB3 12-03-2015 04:18 PM

Yes, it works, thank you.
The idea of using a TIcon to draw the images is brilliant.

But OwnerDraw is something I usually avoid, because it's not easy to make a code that would work fine in any situation.
Right now it is under 50%.
Among the alpha blending implementation, I have to take into account other things too:
- the user can delete or add some of the columns, shifting/adding/removing the column(s) with images;
- the OS hottrack doesn't work anymore and maybe the user would want the one from his Windows theme, not the "fixed" one I
can implement;
- when you click now on the empty space is not deselecting as before - I have to implement this too;
..... and many small other...

A simpler application is good to implement and test a few small fixes (for those problems I mentioned), not such big changes :D
I have now a lot of work to do so I can reach at least 90%. But seems like it's the only way to get rid of those problems...

Thank you again.

kolbasz 12-03-2015 06:02 PM

If I remember correctly you're not a big fan of third party components, but in this particular case TVirtualStringTree is justified. All the drawing problem would gone + there are a lot more options.
VST is tested for many people over a long period of time, the fingerprint is very small, would not increase the exe size considerably.
Anyway is up to you to decide. I can make a small demo tomorrow if you like, basically your test project but TListView replaced with TVirtualStringTree.

PS: I would switch from Icon to PNG.


All times are GMT. The time now is 05:35 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.