views:

314

answers:

1

I need to build a resource DLL from a supplied rc file. Here's what I did upto Delphi 2007:

library ResourceTest;

{$R '..\..\src\Media\TestBitmaps.res' '..\..\src\Media\TestBitmaps.rc'}

{$R *.res}

begin
end.

Compiling this project would create the res file from the rc file and link it in the final DLL. In Delphi 2009 it doesn't work anymore. It says the res file cannot be found. Can anyone suggest an alternative method as simple as the above?

+3  A: 

In D2009 you add the RC files to the project directly, like this. See also Project->Resources. It's different, but better, than prior versions.

Craig Stuntz
Thanks for the pointer, it got me on the right track.It seems my problem boils down to this: in D2009 the res file is generated in the project directory instead of in the directory containing the rc file. Removing and re-adding the rc file to the project changes the $R line to:<pre>{$R 'TestBitmaps.res' '..\..\src\Media\TestBitmaps.rc'}</pre>(no path information). I can live with this, but I am not sure it's an improvement after all.
nandod