I want to add MS Word file in my delphi 7 project directory.I already have created resource file (.rc) and include Word file in it.But when I am compiling .rc with BRCC32, it shows [Error] RLINK32: Unsupported 16bit resource in file "C:\Program Files (x86)\Borland\Delphi7\Projects\stuff.rc". What I have to do?
5
votes
And please also show how you compile the .rc file, and how you link the .res file.
– David Heffernan
if you don't change word file often you can also just embed it into DFM. That is a bit easier to use in runtime, but if your word file keeps changing - then better to let it remain separate file and link via RC
– Arioch 'The
1 Answers
7
votes
The error message indicates that you are attempting to link the resource script, the .rc file, rather than the compiled resource, the .res file.
So you presumably have a line that reads:
{$R stuff.rc}
This instead should read
{$R stuff.res}
What's more, judging from the error message, I suspect that you resource script, the .rc file, is not a resource script. I bet that it is in fact a Word document.
Your .rc file needs to be a text file that looks like this:
WordDocument RCDATA MyDoc.doc
You also need to compile your script. Like this:
brcc32 stuff.rc
This compilation step produces the binary compiled resource file, the .res file.
To make it crystal clear, you need to carry out these steps:
- Make the .rc file as described above.
- Compile the .rc file with brcc32.
- Link the compiled resource by adding {$R stuff.res} to one of your Delphi source files.
You need to go back to basics and try to understand Windows resources better.