@ lucamar
i tried and failed.
i did
program reslist;
{$mode objfpc}{$H+}
uses
Classes, SysUtils, resource,
// You need to specify which resources you want to be able to read.
// The units initialize themselves and register themselves as readers....
resreader;
var
resources : TResources;
reader : TAbstractResourceReader;
inFile : TFileStream;
i : integer;
{$R *.res}
begin
resources:=TResources.Create;
inFile:=TFileStream.Create(paramstr(1), fmOpenRead );
// Use FindReader to let TResources find the appropriate reader for the file
reader:=TResources.FindReader(inFile);
writeln('Selected reader: ',reader.Description);
resources.LoadFromStream(inFile,reader);
for i:=0 to resources.Count-1 do
begin
//resread := Tabtractresourcereader.create
writeln(inttostr(i));
writeln(resources.getname(resources.Items[i])); <<< source of error
end;
resources.Free;
reader.Free;
inFile.Free;
end.
compilation error: reslist.lpr(31,20) Error: identifier idents no member "getname"
given this program, i can see there are 9 resources in the resource file if i comment out the error line, but i cannot get to the names.
i trawled thought the resources source of fpc, but i get lost in the class attribute types...
can anyone help me get the correct code to print the resource names.
i have attached the test resource list as well.
as always, thanks in advance for your help