Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 12-02-2015, 10:55 AM
DavidB3 DavidB3 is offline
Senior Member
 
Join Date: Jul 2013
Posts: 119
Default 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

Last edited by DavidB3; 12-02-2015 at 11:05 AM.
Reply With Quote
  #2  
Old 12-02-2015, 01:55 PM
kolbasz kolbasz is offline
Senior Member
 
Join Date: Nov 2013
Posts: 841
Default

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
Reply With Quote
  #3  
Old 12-02-2015, 02:06 PM
DavidB3 DavidB3 is offline
Senior Member
 
Join Date: Jul 2013
Posts: 119
Default

Good to see you too

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

Thank you
Reply With Quote
  #4  
Old 12-02-2015, 04:48 PM
kolbasz kolbasz is offline
Senior Member
 
Join Date: Nov 2013
Posts: 841
Default

You're welcome! I'm glad its' working.
The project looks great, good job!
Reply With Quote
  #5  
Old 12-03-2015, 03:37 AM
DavidB3 DavidB3 is offline
Senior Member
 
Join Date: Jul 2013
Posts: 119
Default

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
Reply With Quote
  #6  
Old 12-03-2015, 06:27 AM
kolbasz kolbasz is offline
Senior Member
 
Join Date: Nov 2013
Posts: 841
Default

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.
Reply With Quote
  #7  
Old 12-03-2015, 07:41 AM
DavidB3 DavidB3 is offline
Senior Member
 
Join Date: Jul 2013
Posts: 119
Default

You're right.

So here is a much simpler application to test:

https://drive.google.com/file/d/0ByK...ew?usp=sharing
Reply With Quote
  #8  
Old 12-03-2015, 01:39 PM
kolbasz kolbasz is offline
Senior Member
 
Join Date: Nov 2013
Posts: 841
Default

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).
Attached Files
File Type: zip Test.zip (87.4 KB, 6 views)
Reply With Quote
  #9  
Old 12-03-2015, 04:18 PM
DavidB3 DavidB3 is offline
Senior Member
 
Join Date: Jul 2013
Posts: 119
Default

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
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.
Reply With Quote
  #10  
Old 12-03-2015, 06:02 PM
kolbasz kolbasz is offline
Senior Member
 
Join Date: Nov 2013
Posts: 841
Default

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.
Reply With Quote
Reply

Tags
64 bit, delphi 10, delphi 7, listview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 01:49 AM.


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