Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-06

Shared library with resources which contain bitmaps on Linux

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Roland Turcan

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.

Reply by email