Skip to content

Commit 85a87d6

Browse files
author
Colin Robertson
committed
Add versioning
1 parent 8235d05 commit 85a87d6

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

docs/build/creating-a-resource-only-dll.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ description: "How to create a resource-only DLL in Visual Studio."
44
ms.date: "01/27/2020"
55
helpviewer_keywords: ["resource-only DLLs [C++], creating", "DLLs [C++], creating"]
66
ms.assetid: e6b1d4da-7275-467f-a58c-a0a8a5835199
7+
no-loc: [noentry]
78
---
89
# Creating a resource-only DLL
910

@@ -13,18 +14,37 @@ A resource-only DLL is a DLL that contains nothing but resources, such as icons,
1314

1415
To create a resource-only DLL, you create a new Windows DLL (non-MFC) project, and add your resources to the project:
1516

17+
::: moniker range="vs-2015"
18+
19+
1. Select **Win32 Project** in the **New Project** dialog box. Enter the project and solution names, and choose **OK**.
20+
21+
1. In the **Win32 Application Wizard**, select **Application Settings**. Choose an **Application type** of **DLL**. Under **Additional options**, select **Empty project**. Choose **Finish** to create your project.
22+
23+
1. Create a new resource script that contains the resources for the DLL (such as a string or a menu). Save the `.rc` file.
24+
25+
1. On the **Project** menu, select **Add Existing Item**, and then insert the new `.rc` file into the project.
26+
27+
1. Specify the [/NOENTRY](reference/noentry-no-entry-point.md) linker option. `/NOENTRY` prevents the linker from linking a reference to `_main` into the DLL; this option is required to create a resource-only DLL.
28+
29+
1. Build the DLL.
30+
31+
::: moniker-end
32+
::: moniker range=">=vs-2017"
33+
1634
1. Select **Windows Desktop Wizard** in the **New Project** dialog box and choose **Next**. In the **Configure your new project** page, enter the project and solution names, and choose **Create**.
1735

1836
1. In the **Windows Desktop Project** dialog box, select an **Application type** of **Dynamic Link Library**. Under **Additional options**, select **Empty project**. Choose **OK** to create your project.
1937

2038
1. Create a new resource script that contains the resources for the DLL (such as a string or a menu). Save the `.rc` file.
2139

22-
1. On the **Project** menu, click **Add Existing Item**, and then insert the new `.rc` file into the project.
40+
1. On the **Project** menu, select **Add Existing Item**, and then insert the new `.rc` file into the project.
2341

24-
1. Specify the [/NOENTRY](reference/noentry-no-entry-point.md) linker option. /NOENTRY prevents the linker from linking a reference to `_main` into the DLL; this option is required to create a resource-only DLL.
42+
1. Specify the [/NOENTRY](reference/noentry-no-entry-point.md) linker option. `/NOENTRY` prevents the linker from linking a reference to `_main` into the DLL; this option is required to create a resource-only DLL.
2543

2644
1. Build the DLL.
2745

46+
::: moniker-end
47+
2848
## Use a resource-only DLL
2949

3050
The application that uses the resource-only DLL should call [LoadLibraryEx](loadlibrary-and-afxloadlibrary.md) or a related function to explicitly link to the DLL. To access the resources, call the generic functions `FindResource` and `LoadResource`, which work on any kind of resource. Or, call one of the following resource-specific functions:

0 commit comments

Comments
 (0)