Solved

How to write the command for several reource

Posted on 2006-10-31
3
186 Views
Last Modified: 2010-04-05
How to write the command for several reource

ex:

{$R “project.res” “project.rc”}
{$R “extract.res” “extract.rc”}
0
Comment
Question by:ProgsX
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 28

Expert Comment

by:TName
ID: 17843974
Why don't you just try

{$R projects.res}
{$R extract.res}
0
 

Author Comment

by:ProgsX
ID: 17844344
I use two files

Sfx.rc in the file (extract RCDATA Sfx.exe)
and
Build.rc in the next file (extract RCDATA Build.exe)


{$R 'Sfx.res' 'Sfx.rc'}
{$R 'build.res' 'build.rc'}

I use this function to extract the information which I have need

procedure ExtraireEXE_sfx(CheminSfx: String);//sfx
var
 Res: TResourceStream;
 EXE: TFileStream;
begin
  Try
    Res := TResourceStream.Create(hInstance, 'extract', RT_RCDATA);
    EXE := TFileStream.Create(CheminSfx, fmCreate);
    EXE.CopyFrom(Res, 0);
  Finally
    EXE.Free;
    Res.Free;
  end;
end;

procedure ExtraireEXE_build(CheminBuild: String);//build
var
 Res: TResourceStream;
 EXE: TFileStream;
begin
  Try
    Res := TResourceStream.Create(hInstance, 'extract', RT_RCDATA);//
    EXE := TFileStream.Create(CheminBuild, fmCreate);
    EXE.CopyFrom(Res, 0);
  Finally
    EXE.Free;
    Res.Free;
  end;
end;


I have his errors

[Error] WARNING. Duplicate resource(s):
[Error]   Type 10 (RCDATA), ID EXTRACT:
[Error]     File C:\Documents and Settings\Administractor\Mes documents\Projects\Projects\build.res resource kept; file C:\Documents and Settings\Administractor\Mes documents\Projects\Projects\Sfx.res resource discarded.

0
 
LVL 14

Accepted Solution

by:
Pierre Cornelius earned 250 total points
ID: 17872552
You must use different identifiers in your resource files. I suggest you use a prefix e.g. sfx_extract and build_extract. you will only need one extract function.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question