Board index » delphi » Delphi 2 bug: $R doesn't recognize file changes

Delphi 2 bug: $R doesn't recognize file changes

This bug may have already been reported, but I haven't found mention of it
and only ran into it today...

1.  Create a new .dpr program file that has a {$R X.RES} line to include
some resource file.  Don't put anything in the project manager window.

2.  Compile the program; Delphi creates the .exe file.

3.  While the Delphi environment is still open, use some other tool in
some other directory (like brcc in Delphi Bin) to create a new X.RES file.

4.  On the Windows desktop, replace the old X.RES file with the new X.RES
file.  Delphi will be unaware of this.

5.  Go back to the Delphi environment and rebuild or recompile to create
the .exe file again.  The new .exe file will be built using the old X.RES
resources even though they've been replaced on the desktop (apparently
Delphi is caching its own copy).

Some may consider this a feature instead of a bug, but I sure don't.

 

Re:Delphi 2 bug: $R doesn't recognize file changes


On Sun, 25 May 1997 15:55:50 -0700, z...@semaphorecorp.com (Semaphore

Quote
Corporation) wrote:
>This bug may have already been reported, but I haven't found mention of it
>and only ran into it today...

[ Delphi caches project's .RES file]

Quote
>Some may consider this a feature instead of a bug, but I sure don't.

This is a well-known phenomenon. The proper way to edit the project's
resource file is to write an expert that does so. Most people take the
approach of storing resources in other resource files, leaving the
project resource file to contain only the MAINICON resource (and in
D3, the version info resource).

--
Ray Lischner            
Author of Secrets of Delphi 2 (http://www.tempest-sw.com/secrets/)

Re:Delphi 2 bug: $R doesn't recognize file changes


Quote
z...@semaphorecorp.com (Semaphore Corporation) wrote:
>4.  On the Windows desktop, replace the old X.RES file with the new X.RES
>file.  Delphi will be unaware of this.
>5.  Go back to the Delphi environment and rebuild or recompile to create
>the .exe file again.  The new .exe file will be built using the old X.RES
>resources even though they've been replaced on the desktop (apparently
>Delphi is caching its own copy).
>Some may consider this a feature instead of a bug, but I sure don't.

Sorry, couldn't reproduce this (Delphi 2.01). Maybe you have an invalid
time stamp on one  of the resource files? The replacing file must be newer
than the file being replaced. If you replace the old file by generating a
resource file of the same name from a resource script using BRCC32,
Delphi 2.01 notifies the change and recompiles units depending on that
resource file when it compiles your project.

Other Threads