Hello FPC-Pascal users discussions!
How can I build a shared library which contains many bitmaps loaded dynamically from the code using by:
procedure TForm1.Button1Click(Sender: TObject);
CONST MYRES_DLL ='./libmyres.so';
begin
FhMod := LoadLibrary (PCHAR (MYRES_DLL));
IF FhMod = 0 THEN begin
ShowMessage ('Failed to load library ' + MYRES_DLL + '.');
end else begin
ShowMessage ('Library ' + MYRES_DLL + ' is successfully loaded');
Image1.Picture.Bitmap.LoadFromResourceName (FhMod, 'pict');
end;
IF FhMod 0 THEN begin
FreeLibrary (FhMod);
end;
end;I have tried to do it in all ways I know, but loading the shared library was OK, but the LoadFromResourceName raises an exception "Resource XY not found".
Thanks in advance.
