How to create a DLL with just images in it.

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

How to create a DLL with just images in it.

Postby Frank_T » Wed Apr 06, 2005 5:04 am

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.
Frank_T
 

Postby msbechtold » Wed Apr 13, 2005 3:25 pm

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;
   }
msbechtold
 


Return to Technical

Who is online

Users browsing this forum: No registered users and 15 guests

cron