Create a pure resource DLL (VC ++)

Source: Internet
Author: User
Create a pure resource DLL

Pure resource DLL is a DLL that only contains resources (tags, bitmaps, strings, and dialogs. Using pure resource DLL is a good way to share the same group of resources among multiple programs. It is also a good method for applications that provide their resources to be localized in multiple languages (see localized Resources in the MFC Application: affiliated DLL ).

To create a pure resource DLL, create a new Win32 DLL (non-MFC) project and add the resource to this project.

  • In the "Create Project" dialog box, select "Win32 project" and specify the DLL project type in the "Win32 Project Wizard.

  • Create a new resource script that contains resources (such as strings or menus) for the DLL and save the. RC file.

  • In"Project"Click Add existing item on the menu, and insert the new. RC file in the project.

  • Specify the/noentry linker option. /Noentry prevents the linker from linking _ main references to the DLL. This option is required to create a pure resource DLL.

  • Generate DLL.

Applications that use pure resource dll should callLoadlibraryTo explicitly link to the DLL. To access resources, call the general functionFindresourceAndLoadresourceThese two functions are valid for any type of resources or call one of the following resource-specific functions:

  • Formatmessage

  • Loadaccelerators

  • Loadbitmap

  • Loadcursor

  • Loadicon

  • Loadmenu

  • Loadstring

After resources are used, the application should callFreelibrary.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.