Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 590839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:34:19+00:00 2026-05-13T15:34:19+00:00

How do I create a resource dll ? The dll will be having a

  • 0

How do I create a resource dll ? The dll will be having a set of .png files. In a way these .png files should be exposed from the dll. My application would need to refer this dll to get a .png file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:34:19+00:00Added an answer on May 13, 2026 at 3:34 pm

    A resource dll is the same as any other dll, it just has little or no code in it, and relatively more resources.

    Microsoft doesn’t have a predefined resource type for PNG files, but you can define your own

    The most minimal possible resource dll is just a compiled .rc file passed to the linker like this.


    //save this as resources.rc (supply your own .png file)
    
    #define RT_PNG 99
    
    #define ID_DIGG 1
    
    ID_DIGG  RT_PNG  "image\\digg.png"
    

    Then execute these commands at a command prompt.

    rc resources.rc
    link /dll /noentry /machine:x86 resources.res
    

    Thats it. the first command compiles resources.rc into resources.res
    the second command turns resources.res into a dll.

    You should now have a dll called resources.dll that contains a single png file.
    In practice, of course, you will want to put the #defines in a header file that you share with the code that uses the dll.

    To use the dll in C++, your code would look something like this.

    #define RT_PNG   MAKEINTRESOURCE(99)
    #define ID_DIGG  MAKEINTRESOURCE(1)
    
    HMODULE hMod = LoadLibraryEx("resources.dll", NULL, LOAD_LIBRARY_AS_DATAFILE);
    if (NULL != hMod)
    {
        HRSRC hRes = FindResource(hMod, RT_PNG, ID_DIGG);
        if (NULL != hRes)
        {
            HGLOBAL hgbl = LoadResource(hMod, hRes)
            void *  pPng = LockResource(hgbl);
            UINT32  cbPng = SizeofResource(hMod, hRes);
    
            // pPng now points to the contents of your your .png file
            // and cbPng is its size in bytes
    
        }
    
        // Don't free the library until you are done with pPng
        // FreeLibrary(hMod);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 284k
  • Answers 284k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The problem is you're using accepts_nested_fields for when you shouldn't… May 13, 2026 at 4:24 pm
  • Editorial Team
    Editorial Team added an answer It is a namespace problem but not with namespace std.… May 13, 2026 at 4:24 pm
  • Editorial Team
    Editorial Team added an answer Try using a debug tool like Firebug or the IE… May 13, 2026 at 4:24 pm

Related Questions

I'm working on a PInvoke wrapper for a library that does not support Unicode
UPDATED QUESTION Since the ctor is not supported by .NETCF (public FileStream(IntPtr handle, FileAccess
I'm trying to develop an agent/client that will listen to HTTP requests on a
What? I have a DLGTEMPLATE loaded from a resource DLL, how can I change
For some reason, we have a script that creates batch files to XCOPY our

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.