4

I have a file that needs to be refreshed every days, linked into a rc file this way :

docs.rc

  file RCDATA "C:\folder\myfile.ext"

I understand that it refreshes the resources itself if changes are made in my *.rc file... only. The only way i found to be sure that the resource is refreshed is removing it, compiling, setting it back and compiling again.

Any piece of advice, pre-compiling command or anything better ?

Thanks !

Using Delphi XE2 Enterprise.

[edit]

of course i forgot this line from project code :

{$R 'docs.res' 'docs.rc'}
Darkendorf
  • 463
  • 11
  • 28
  • Building the project should be enough, are you sure it doesn't link in the changet file? – ain Feb 09 '12 at 09:31
  • What you haven't shown is how you're invoking RC. Do you have a {$R} declaration in your project that you haven't shown us or an RC node in the project view? – Warren P Feb 09 '12 at 14:15

2 Answers2

6

Open your project. Go to Project Menu then select Resources and Images item. Then add your resources to the list instead of RC file.

It will solve your problem.

Vahid Nasehi
  • 455
  • 5
  • 9
2

You could use Pre-Build event and compile rc-files "manually" with brcc32.exe

George
  • 84
  • 3
  • 1
    Not necessary. Delphi can compile it for you, if you just add it to the project like Vahid said, or you can use the old `{$R foo.rc foo.res}` syntax in the .dpr file. – Warren P Feb 09 '12 at 14:16
  • @WarrenP : That's how I used to do it too, but it does not appear to work anymore in Delphi XE2... (IIRC it stopped working some versions before that, probably 2010-ish) – Oliver Giesen Aug 22 '12 at 11:52