Here is the situation:

I used Delphi to created an application that uses many pictures, so I put 
all the pictures in a DLL. 

Here is the relevant Delphi code (that works, by hook or by crook!):

var
 TheLibHandle,
 ThePicHandle: THandle;
 HandleInUse: Boolean;

In FormShow of my application, I have:
TheLibHandle:=LoadLibrary('MyPics.dll');
HandleInUse:=False;

Where I get the image out of the picture library, I have:

    ThePicHandle:=LoadBitmap(TheLibHandle,'Bitmap_1');
    Form1.Image10.Picture.Bitmap.Handle:=ThePicHandle;
    HandleInUse:=True;

Then when I close the form, I have:

 if HandleInUse then DeleteObject(ThePicHandle);
 FreeLibrary(TheLibHandle);
 Form1.Close;

This code obviously does not work in Lazarus!  I have gathered that I 
should use dlopen and dlclose, but I cannot find any clear help on this. 
Can someone please “translate” my elementary Delphi code to meaningful 
code for Lazarus that will work for Windows and Linux?

Your assistance will be appreciated!

Herman Ohlhoff

Reply via email to