Board index » delphi » How can I put resources in a DLL

How can I put resources in a DLL

Does anybody know how to put a bitmap and/or other resources in a .DLL
in Delphi? I'm programming an app. which has several bitmap logos. I'ver
heard from someone that it's a normal technique to put these resources
in a DLL. How can I do so?

Thanks,
        Ralph Schreijen

 

Re:How can I put resources in a DLL


Quote
Ralph_Schreijen wrote:

> Does anybody know how to put a bitmap and/or other resources in a .DLL
> in Delphi? I'm programming an app. which has several bitmap logos. I'ver
> heard from someone that it's a normal technique to put these resources
> in a DLL. How can I do so?

> Thanks,
>         Ralph Schreijen

Use "Image Editor" or "Resource WorkShop" to produce a .RES file

Use the {$R XXXXXXX.Res} compiler directive to include the .RES when linking.

Then use the LoadCursor/String/Bitmap API calls to acces them

hope this is enough info

Gary

--
                                                     ____  /"//"/|__  __    
Gary Olliffe <ga...@parallax.co.uk>                 /   /|/ // / / / / /|  
Snail Mail : Parallax Solutions Ltd., Stone Court, / __/ / // / /> " <|/    
             Siskin Drive, Coventy, CV3 4FJ       /_/|_|/ // / /_/|/ /|    
Tel        : +44 (0)1203 514549                   |_|/./_//_/ /|_|/|_|/    
                                                       |_||_|/ Solutions Ltd

Re:How can I put resources in a DLL


In article c...@hera.cuci.nl, netp...@cuci.nl (Ralph_Schreijen) writes:

Quote
>Does anybody know how to put a bitmap and/or other resources in a .DLL
>in Delphi? I'm programming an app. which has several bitmap logos. I'ver
>heard from someone that it's a normal technique to put these resources
>in a DLL. How can I do so?

>Thanks,
>        Ralph Schreijen

With the Image Editor create a component resource file.  In this
you can do the usual to create bitmaps.  The file that you save
here will be called SOMETHING.DCR.  The *.DCR file is really a *.RES
file with a different name.  So in you source code (MYDLL.DPR) you
would add:

  {$R SOMETHING.DCR}

In fact you can create DLLs this way that include only bitmaps
and no executable code:

  library Pictures;
  {$R something.dcr}
  begin
  end;

For an advanced topic you may still wish to include version
information in this DLL.

I hope this helps.

Best regards,
Michael Vincze
vin...@ti.com

Other Threads