Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to recompile a specific unit from the VCL?

I want to apply a fix from QC to a Delphi 2009 unit (DBClient as it happens). I know I need to copy the unit to another directory and make the change to the copy. How do I then get Delphi to compile that unit and use it in favour of the DCU that already exists?

like image 355
Rob McDonell Avatar asked Jun 28 '09 14:06

Rob McDonell


2 Answers

It's kind of a last resort (and not supported by CodeGear), but I do something similar to Mohammed when necessary. Except instead of putting any modified units into the application folder, I put them into their own folder with the rest of my library code and include this folder in my library path where it will be used by all of my projects. It also prevents me from having multiple (possibly slightly different) copies hanging around.

I also make a point of checking any updates to see what has changed so I can either remove the modified units or re-apply the changes to the newer (and presumably better) units from CodeGear.

like image 97
Bruce McGee Avatar answered Sep 17 '22 14:09

Bruce McGee


If you don't want to modify the original .Pas file, I do this by copy the .Pas file into my application folder, then choose built project, it will create new dcu file in my application folder, which will be used instead of the original one.

like image 39
Mohammed Nasman Avatar answered Sep 19 '22 14:09

Mohammed Nasman