Recompile the modified VCL block

I need to compile my project with a modified VCL module. I am using Delphi XE8. I copied Vcl.StdCtrls.pas from D: \ Program Files (x86) \ Embarcadero \ Studio \ 16.0 \ source \ vcl to the project folder where my .dpr file is localized, and then I changed my copy of Vcl.StdCtrls.pas. I also added this block to the project tree. The problem is that with Delphi XE8 this way of recompiling VCL units no longer works. I installed an obvious syntax error in my modified Vcl.StdCtrls.pas module. The compiler does not report an error, which means that it does not even check the file. I always do full Shift + F9. I found a similar question. How to recompile a specific device from VCL? but, as I said, it no longer works, not for Delphi XE8.

In addition, the modified block is in my use list in the .dpr file:

uses Vcl.StdCtrls in 'D:\Dev\MYPROJECT\Vcl.StdCtrls.pas', ... 

//It does not help

+6
source share
1 answer

This seems to be a mistake. I assume you are using runtime packages. In XE7, such a project will not compile - this is the correct behavior. In XE8, it compiles, apparently using the VCL runtime package and ignoring the modified block.

Edit:

Note that even in previous versions of Delphi, changing the VCL module using runtime packages would require repackaging the changed packages and their dependencies (in this case vcl and rtl). In other words, you cannot just use a modified block when linking to a run-time package that contains another copy of this device. Module names must be unique throughout the entire project area, including the main executable and all associated runtime packages.

So, the solution for you is either:

  • do not use runtime packages, or
  • repackage all necessary units into your own runtime packages and associate them with them instead of the supplied Embarcadero rtl, vcl, etc.
+7
source

Source: https://habr.com/ru/post/987938/


All Articles