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.
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
- What is the correct way to declare and use a FILE
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.
Then execute these commands at a command prompt.
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.