1
votes

I have made resource file and have compiled and linked it with my delphi unit.But I am facing problems when reading from that resource file.

implementation

{$R *.dfm}
{$R 'stuff.res' 'stuff.rc'}

procedure TForm1.FormCreate(Sender: TObject);
  var vExeFile: string;
  RS: TResourceStream;
begin
  RS := TResourceStream.Create(HInstance, 'ExeTest', RT_RCDATA);
  try
    vExeFile := ExtractFilePath(ParamStr(0)) + 'tmp.exe';
    RS.SaveToFile(vExeFile);
  finally
    RS.Free;
 end;
end;

I have tried above code but it shows Resource ExeTest not found

1
Show the content of your stuff.rc file.Ken White

1 Answers

0
votes

If you want to export RCDATA, your rc file has to look like this:

ExeTest RCDATA YourDataFileName