Skip to content

Commit 3fc5606

Browse files
author
msebolt
committed
resource file consolidation pr38
1 parent d15ea22 commit 3fc5606

5 files changed

Lines changed: 90 additions & 113 deletions

‎.openpublishing.redirection.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7790,6 +7790,16 @@
77907790
"redirect_url": "/cpp/windows/manifest-resources",
77917791
"redirect_document_id": false
77927792
},
7793+
{
7794+
"source_path": "docs/windows/how-to-open-a-resource-script-file-outside-of-a-project-standalone.md",
7795+
"redirect_url": "/cpp/windows/how-to-create-a-resource-script-file",
7796+
"redirect_document_id": false
7797+
},
7798+
{
7799+
"source_path": "docs/windows/how-to-open-a-resource-script-file-in-text-format.md",
7800+
"redirect_url": "/cpp/windows/how-to-create-a-resource-script-file",
7801+
"redirect_document_id": false
7802+
},
77937803
{
77947804
"source_path": "docs/windows/activationfactory-activationfactory-constructor.md",
77957805
"redirect_url": "/cpp/windows/activationfactory-class#activationfactory",

‎docs/windows/TOC.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
### [Resource Files (Visual Studio)](resource-files-visual-studio.md)
1313
#### [How to: Create a Resource Script File](how-to-create-a-resource-script-file.md)
1414
#### [How to: Create a Resource](how-to-create-a-resource.md)
15-
#### [How to: Open a Resource Script File Outside of a Project (Standalone)](how-to-open-a-resource-script-file-outside-of-a-project-standalone.md)
16-
#### [How to: Open a Resource Script File in Text Format](how-to-open-a-resource-script-file-in-text-format.md)
1715
#### [How to: Add MFC Support to Resource Script Files](how-to-add-mfc-support-to-resource-script-files.md)
1816
#### [How to: Include Resources at Compile Time](how-to-include-resources-at-compile-time.md)
1917
#### [How to: Copy Resources](how-to-copy-resources.md)

‎docs/windows/how-to-create-a-resource-script-file.md‎

Lines changed: 80 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,108 @@
11
---
22
title: "How to: Create a Resource Script File (C++)"
33
ms.date: "11/04/2016"
4-
helpviewer_keywords: ["rc files [C++], creating", ".rc files [C++], creating", "resource script files [C++], creating"]
4+
f1_keywords: ["vc.editors.resource"]
5+
helpviewer_keywords: ["rc files [C++], creating", ".rc files [C++], creating", "resource script files [C++], creating", "resources [C++], viewing", "rc files [C++], viewing resources", ".rc files [C++], viewing resources", "resource script files [C++], viewing resources", "resource script files [C++], opening in text format", ".rc files [C++], opening in text format", "rc files [C++], opening in text format"]
56
ms.assetid: 82be732a-cdcd-4a58-8de7-976d1418f86b
67
---
78
# How to: Create a Resource Script File (C++)
89

910
> [!NOTE]
1011
> The **Resource Editor** is not available in Express editions.
1112
>
12-
> This material applies to Windows desktop applications. Projects in .NET languages do not use resource script files. See [Resource Files](../windows/resource-files-visual-studio.md), for more information.
13+
> This material applies to Windows desktop applications. Projects in .NET languages do not use resource script files. For more information, see [Resource Files](../windows/resource-files-visual-studio.md), for more information.
1314
14-
### To create a new resource script (.rc) file
15+
## To create a new resource script (.rc) file
1516

1617
1. Put focus on your existing project folder in **Solution Explorer**, for example, `MyProject`.
1718

1819
> [!NOTE]
1920
> Don't confuse the project folder with the Solution folder in **Solution Explorer**. If you put focus on the **Solution** folder, your choices in the **Add New Item** dialog box (in Step 3) will be different.
2021
21-
2. On the **Project** menu, click **Add New Item**.
22+
1. On the **Project** menu, select **Add New Item**.
2223

23-
3. In the **Add New Item** dialog box, click the **Visual C++** folder then choose **Resource File (.rc)** in the right pane.
24+
1. In the **Add New Item** dialog box, select the **Visual C++** folder then choose **Resource File (.rc)** in the right pane.
2425

25-
4. Provide a name for your resource script file in the **Name** text box, then click **Open**.
26+
1. Provide a name for your resource script file in the **Name** text box, then choose **Open**.
2627

2728
You can now [create](../windows/how-to-create-a-resource.md) and add new resources to your .rc file.
2829

2930
> [!NOTE]
3031
> You can only add a resource script (.rc file) to an existing project that is loaded into the Visual Studio IDE. You cannot create a standalone .rc file (one outside the project). [Resource templates](../windows/how-to-use-resource-templates.md) (.rct files) can be created anytime.
3132
33+
## To open a resource script file outside of a C++ project (standalone)
34+
35+
You can view resources in an .rc file without having a project open. The .rc file will open in a document window as opposed to opening in the [Resource View](../windows/resource-view-window.md) window (as it does when the file is open inside a project).
36+
37+
> [!NOTE]
38+
> This is an important distinction because some commands are only available when the file is opened standalone (outside of a project). For example, you can only save a file in a different format or as a different file name when the file is opened outside of a project (the **Save As** command is unavailable when a file is opened inside a project).
39+
40+
### To open an .rc file outside a project
41+
42+
1. From the **File** menu, choose **Open**, then select **File**.
43+
44+
1. In the **Open File** dialog box, navigate to the resource script file you want to view, highlight the file, and select **Open**.
45+
46+
> [!NOTE]
47+
> If you open the project first (**File**, **Open**, **Project**), some commands will not be available to you. Opening a file "standalone" means opening it without first loading the project.
48+
49+
### To open multiple .rc files outside a project
50+
51+
1. Open both resource files stand-alone. For example, open `Source1.rc` and `Source2.rc`.
52+
53+
1. From the **File** menu, choose **Open**, then select **File**.
54+
55+
1. In the **Open File** dialog box, navigate to the first resource script file you want to open (`Source1.rc`), highlight the file, and choose **Open**.
56+
57+
1. Repeat the previous step to open the second .rc file (`Source2.rc`).
58+
59+
The .rc files are now open in separate documents windows.
60+
61+
1. When both .rc files are open, tile the windows so you can view them simultaneously:
62+
63+
- From the **Window** menu, choose **New Horizontal Tab Group** or **New Vertical Tab Group**.
64+
65+
\- or -
66+
67+
- Right-click one of the .rc files and choose **New Horizontal Tab Group** or **New Vertical Tab Group** from the shortcut menu.
68+
69+
> [!NOTE]
70+
> If your project doesn't already contain an .rc file, please see [Creating a New Resource Script File](../windows/how-to-create-a-resource-script-file.md).
71+
72+
## To open a resource script file in text format
73+
74+
There may be times when you want to view the contents of your project's resource script (.rc) file without opening a resource, such as a dialog box, inside its specific resource editor. For example, you may want to search for a string across all dialog boxes in the resource file without having to open each one separately.
75+
76+
> [!NOTE]
77+
> If your project doesn't already contain an .rc file, please see [Creating a New Resource Script File](../windows/how-to-create-a-resource-script-file.md).
78+
79+
You can easily open the resource file in text format to view all the resources it contains and complete global operations supported by the text editor.
80+
81+
> [!NOTE]
82+
> The resource editors do not directly read .rc or `resource.h` files. The resource compiler compiles them into .aps files, which are consumed by the resource editors. This file is a compile step and only stores symbolic data. As with a normal compile process, information that is not symbolic (for example, comments) is discarded during the compile process. Whenever the .aps file gets out of synch with the .rc file, the .rc file is regenerated (for example, when you Save, the resource editor overwrites the .rc file and the resource.h file). Any changes to the resources themselves will remain incorporated in the .rc file, but comments will always be lost once the .rc file is overwritten. For information on how to preserve comments, see [Including Resources at Compile Time](../windows/how-to-include-resources-at-compile-time.md).
83+
84+
### To open a resource script file as text
85+
86+
1. From the **File** menu choose **Open**, then choose **File**.
87+
88+
1. In the **Open File** dialog box, navigate to the resource script file you want to view in text format.
89+
90+
1. Highlight the file, then select the drop-down arrow on the **Open** button (located on the right side of the button).
91+
92+
1. Choose **Open With** from the drop-down menu.
93+
94+
1. In the **Open With** dialog box, select **Source Code (Text) Editor**.
95+
96+
1. From the **Open As** drop-down list, select **Text**.
97+
98+
The resource opens in the **Source Code** editor.
99+
100+
\- or -
101+
102+
1. In **Solution Explorer**, right-click the .rc file.
103+
104+
1. From the shortcut menu, choose **Open with...**, then select **Source Code (Text) Editor**.
105+
32106
## Requirements
33107

34108
Win32

‎docs/windows/how-to-open-a-resource-script-file-in-text-format.md‎

Lines changed: 0 additions & 49 deletions
This file was deleted.

‎docs/windows/how-to-open-a-resource-script-file-outside-of-a-project-standalone.md‎

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)