Page 1 of 1

How to create a DLL with just images in it.

PostPosted: Wed Apr 06, 2005 5:04 am
by Frank_T
Hi All,

Anyone know how to create and call a DLL that has only images in it similar to a resource file but not bound to the Executable. It can be static or dynamic.

PostPosted: Wed Apr 13, 2005 3:25 pm
by msbechtold
Try this...

1st create an .res file using borland image editor. This file is your image container. In this file add an icon. The name of this icon will be called by ResIconName later.
Next open the newly created icon and either draw your own or copy/paste on that you like here.
Next create dll project. Adding the res file created earlier.
Next complile project creating the dll file.

Next in the calling application add
Code: Select all
HINSTANCE DLL_instance = LoadLibrary("MSB_Images.dll");  //look in the system directory
   if(DLL_instance != NULL)
   {
      fIcon = new TIcon();
      fIcon->Handle = LoadIcon(DLL_instance, ResIconName.c_str());
      FreeLibrary(DLL_instance);
      if(fIcon->Handle == NULL) delete fIcon;
   }