3

everytime i write a resource file (.rc) and drop it over the bcc32.exe, nothin happens. if i drop it over rc.exe, it gives me a .res file, which doesnt work in delphi.

so what do i have to write in the .rc file, to get my .res built correctly at the bcc32? (example pls) lets say i wanna have abc.wav, which is on my desktop. thanks

Alex
  • 75
  • 1
  • 4
  • 9

2 Answers2

11

It's brcc32.exe that you want, not bcc32.exe.

That should produce your .res file for you.

However, you could also look into changing your {$R} directive slightly so that you don't need to manually compile your .rc file.

IIRC, you can use {$R yourfile.res yourfile.rc} in your source, and Delphi should compile the .rc for you.

Conor Boyd
  • 1,024
  • 7
  • 15
  • This is a better answer than mine. I'll delete it. – Tim Jarvis Aug 27 '09 at 23:00
  • and the rc file is abc.wav c:\user\desktop\abc.wav so i just save this as a .rc and put it in my project's folder? the sourcecode, how does it have to be then? both,rc and res {$R lala.res lala. rc} or just the .rc ? by the way, thanks for your good answer, i didnt know that i can use .rc directly in delphi oO alex – Alex Aug 27 '09 at 23:19
  • Francois has already clarified some of this, but maybe this answer will help also: http://stackoverflow.com/questions/1298031/including-resource-file-in-a-project-by-rc-file-rather-than-res-file – Conor Boyd Aug 27 '09 at 23:47
10

If you have D2007 or newer, just add your RC file to the project manager...

The RC file is a simple text file where you declare your resources and the corresponding files (with path if needed) like:

SANTA  BITMAP "SANTA.BMP"
SOUND  RCDATA "SOUND.WAV"

In D2009 or newer, you can just add the wav to the project manager.
And the easiest way to "add" is to drag your file and drop it there.

Francesca
  • 21,452
  • 4
  • 49
  • 90
  • with this "add to project" window, i normally use for adding a new unit? – Alex Aug 27 '09 at 23:46
  • ah sry for doublepost, but i dont know how to write the .rc file yet. just name c:\...\....\abc.wav ? ill go to bed now, ty for your help, ill try it tomorrow – Alex Aug 27 '09 at 23:48
  • @alex, the .rc file is just a text file, containing 3 space delimited fields. The first is the internal name, the second is the type (RCDATA is a catch all type) and the third is the filename of the resource to compile. – skamradt Aug 28 '09 at 06:17
  • so: abc RCDATA "abc.wav" if the .rc is in the same folder like the wav? – Alex Aug 28 '09 at 12:58