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
stuff.rc
file. – Ken White