You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7d49662
Browse filesBrowse the repository at this point in the historyBrowse files
helpviewer_keywords: ["comments [C++], compiled files", "resources [C++], including at compile time", "projects [C++], including resources", "#include directive", "include directive (#include)", "Resource Includes dialog box [C++]", "rc files [C++], changing storage", "symbol header files [C++], changing", ".rc files [C++], changing storage", "symbol header files [C++], read-only", "symbols [C++], symbol header files", "directories [C++], specifying include paths for resources", "include files [C++], specifying for resources", "resources [C++], including in projects"]
5
+
helpviewer_keywords: ["comments [C++], compiled files", "resources [C++], including at compile time", "projects [C++], including resources", "#include directive", "include directive (#include)", "Resource Includes dialog box [C++]", "rc files [C++], changing storage", "symbol header files [C++], changing", ".rc files [C++], changing storage", "symbol header files [C++], read-only", "symbols [C++], symbol header files", "directories [C++], specifying include paths for resources", "include files [C++], specifying for resources", "resources [C++], including in projects", "symbols [C++], finding", "resources [C++], searching for symbols"]
6
6
ms.assetid: 357e93c2-0a29-42f9-806f-882f688b8924
7
7
---
8
-
# How to: Include Resources at Compile Time
8
+
# How to: Include Resources at Compile Time (C++)
9
9
10
10
Normally it's easy and convenient to work with the default arrangement of all resources in one resource script (.rc) file. However, you can add resources in other files to your current project at compile time by listing them in the **Compile-time directives** box in the **Resource Includes** dialog box.
11
11
@@ -19,7 +19,7 @@ There are several reasons to place resources in a file other than the main .rc f
19
19
20
20
- To include resources that are being used by several different projects, or that are part of a source code version-control system, and so must exist in a central location where modifications will affect all projects.
21
21
22
-
- To include resources (such as RCDATA resources) that are in a custom format. RCDATA resources may have special requirements. For example, you cannot use an expression as a value for the nameID field. See the Windows SDK documentation for more information.
22
+
- To include resources (such as RCDATA resources) that are in a custom format. RCDATA resources may have special requirements. For example, you can't use an expression as a value for the nameID field. For more information, see the Windows SDK documentation.
23
23
24
24
If you have sections in your existing .rc files that meet any of these conditions, you should place the sections in one or more separate .rc files and include them in your project using the **Resource Includes** dialog box. The *Projectname*.rc2 file created in the \res subdirectory of a new project is used for this purpose.
25
25
@@ -36,7 +36,7 @@ To open the **Resource Includes** dialog box, right-click an .rc file in [Resour
36
36
> [!NOTE]
37
37
> Entries in these text boxes appear in the .rc file marked by `TEXTINCLUDE 1`, `TEXTINCLUDE 2`, and `TEXTINCLUDE 3` respectively. For more information, see [TN035: Using Multiple Resource Files and Header Files with Visual C++](../mfc/tn035-using-multiple-resource-files-and-header-files-with-visual-cpp.md).
38
38
39
-
Once you have made changes to your resource file using the **Resource Includes** dialog box, you need to close the .rc file and then reopen it for the changes to take effect. For more information, see [Including Resources at Compile Time](../windows/how-to-include-resources-at-compile-time.md).
39
+
Once you have made changes to your resource file using the **Resource Includes** dialog box, you need to close the .rc file and then reopen it for the changes to take effect.
40
40
41
41
For information on adding resources to managed projects, see [Resources in Desktop Apps](/dotnet/framework/resources/index) in the .NET Framework Developer's Guide.
42
42
@@ -50,12 +50,28 @@ For information on adding resources to managed projects, see [Resources in Deskt
50
50
51
51
The resources in files included in this way are made a part of your executable file at compile time. They aren't directly available for editing or modification when you're working on your project's main .rc file. Open included .rc files separately. Any files that are included but don't have an .rc extension won't be editable by the resource editors.
52
52
53
-
## To specify include directories for a specific resource (.rc file) (C++)
53
+
## To specify include directories for a specific resource (.rc file)
54
54
55
55
1. Right-click the .rc file in Solution Explorer and select **Properties** from the shortcut menu.
56
56
57
57
1. In the **Property Pages** dialog box, select the **Resources** node in the left pane, then specify the additional include directories in the **Additional include directories** property.
58
58
59
+
## To find symbols in resources
60
+
61
+
1. From the **Edit** menu, choose **Find Symbol**.
62
+
63
+
1. In the [Find Symbol dialog box](/visualstudio/ide/go-to), in the **Find What** box, select a previous search string from the drop-down list or type the accelerator key you want to find (for example, ID_ACCEL1).
64
+
65
+
> [!TIP]
66
+
> To use [regular expressions](/visualstudio/ide/using-regular-expressions-in-visual-studio) for your search, you must use the [Find in Files command](/visualstudio/ide/reference/find-command) from the **Edit** menu instead of the **Find Symbol** command. To enable regular expressions, you must have the **Use: Regular Expressions** check box selected in the [Find dialog box](/visualstudio/ide/finding-and-replacing-text). Then you can select the right-arrow button to the right of the **Find What** box to display a list of regular search expressions. When you select an expression from this list, it is substituted as the search text in the **Find What** box.
67
+
68
+
1. Select any of the **Find** options.
69
+
70
+
1. Choose **Find Next**.
71
+
72
+
> [!NOTE]
73
+
> You cannot search for symbols in string, accelerator, or binary resources.
[TN035: Using Multiple Resource Files and Header Files with Visual C++](../mfc/tn035-using-multiple-resource-files-and-header-files-with-visual-cpp.md)<br/>
0 commit comments