How do I make a dll of just resources?

Posted on 2003-02-21
Medium Priority
Last Modified: 2013-11-20
I have an application that includes dialogs and tabs and bitmaps.  I want to break up this application into 1 exe and many DLLs.  One of the DLLs should contain just bitmaps and resources.  How can I create a DLL with just bitmaps, string tables and other resources (even the images of dialog boxes) and be sure that the exe and other dlls will still be able to use these bitmaps?  The other DLLs and exe should be able to call the DoModal function of a class and the class should be able to use the bitmap that is in this bitmap dll.  
Question by:shiju_luke
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

codez80 earned 750 total points
ID: 7999922
make your dll as usual,

export a function from your dll:

HRESOURCE __declspec(dllexport) GetDLLResource(LPCTSTR lpszResource);

then in the implementation of that function use Win32 API LoadResource, and make sure when you call that method you mention DLL handle, (if you are in MFC do this: AFX_MANAGE_STATE(); HANDLE hDLL = AfxGetApp()->m_hModule; )

the handle returned from that function can be used in your executable or any other DLL

good luck

if you need more details let me know and I'll tell you about it (if I know!)


LVL 86

Expert Comment

ID: 8043070
Hmm, wasn't that all covered in the MSDN links also?

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question