Skip to content

Commit a86a2ae

Browse files
authored
Merge pull request MicrosoftDocs#1684 from msebolt/resource-file-consolidation-pr4
resource file conolidation pr4
2 parents 192906e + d0fe8ba commit a86a2ae

7 files changed

Lines changed: 104 additions & 162 deletions

‎.openpublishing.redirection.json‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7325,6 +7325,26 @@
73257325
"redirect_url": "/cpp/windows/predefined-accelerator-keys",
73267326
"redirect_document_id": false
73277327
},
7328+
{
7329+
"source_path": "docs/windows/creating-a-new-custom-or-data-resource.md",
7330+
"redirect_url": "/cpp/windows/binary-editor",
7331+
"redirect_document_id": false
7332+
},
7333+
{
7334+
"source_path": "docs/windows/editing-binary-data.md",
7335+
"redirect_url": "/cpp/windows/binary-editor",
7336+
"redirect_document_id": false
7337+
},
7338+
{
7339+
"source_path": "docs/windows/finding-binary-data.md",
7340+
"redirect_url": "/cpp/windows/binary-editor",
7341+
"redirect_document_id": false
7342+
},
7343+
{
7344+
"source_path": "docs/windows/opening-a-resource-for-binary-editing.md",
7345+
"redirect_url": "/cpp/windows/binary-editor",
7346+
"redirect_document_id": false
7347+
},
73287348
{
73297349
"source_path": "docs/windows/activationfactory-activationfactory-constructor.md",
73307350
"redirect_url": "/cpp/windows/activationfactory-class#activationfactory",

‎docs/windows/TOC.md‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@
5959
##### [Editing Accelerator Tables](editing-accelerator-tables.md)
6060
##### [Accelerator Keys](predefined-accelerator-keys.md)
6161
#### [Binary Editor](binary-editor.md)
62-
##### [Creating a New Custom or Data Resource](creating-a-new-custom-or-data-resource.md)
63-
##### [Opening a Resource for Binary Editing](opening-a-resource-for-binary-editing.md)
64-
##### [Editing Binary Data](editing-binary-data.md)
65-
##### [Finding Binary Data](finding-binary-data.md)
6662
#### [Dialog Editor](dialog-editor.md)
6763
##### [Creating a New Dialog Box](creating-a-new-dialog-box.md)
6864
##### [Creating a Dialog Box That Users Cannot Exit](creating-a-dialog-box-that-users-cannot-exit.md)

‎docs/windows/binary-editor.md‎

Lines changed: 84 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
title: "Binary Editor (C++)"
33
ms.date: "11/04/2016"
4-
f1_keywords: ["vc.editors.binary.F1"]
5-
helpviewer_keywords: ["editors, Binary", "resources [C++], editing", "resource editors [C++], Binary editor", "Binary editor"]
4+
f1_keywords: ["vc.editors.binary.F1", "vc.editors.binary"]
5+
helpviewer_keywords: ["editors, Binary", "resources [C++], editing", "resource editors [C++], Binary editor", "Binary editor", "binary data, editing", "resources [C++], opening for binary editing", "binary data", "hexadecimal bytes in binary data", "strings [C++], searching for", "file searches [C++]", "binary data, finding", "ASCII characters, finding in binary data", "custom resources [C++]", "data resources [C++]", "resources [C++], creating"]
66
ms.assetid: 2483c48b-1252-4dbc-826b-82e6c1a0e9cb
77
---
88
# Binary Editor (C++)
@@ -20,15 +20,92 @@ To open the **Binary Editor**, first choose **File** > **New** > **File** from t
2020
> [!TIP]
2121
> While using the **Binary** editor, in many instances, you can right-click to display a shortcut menu of resource-specific commands. The commands available depend on what your cursor is pointing to. For example, if you click while pointing to the **Binary** editor with selected hexadecimal values, the shortcut menu shows the **Cut**, **Copy**, and **Paste** commands.
2222
23-
With the **Binary** editor, you can:
23+
## Binary Editor How-To
2424

25-
- [Open a resource for binary editing](../windows/opening-a-resource-for-binary-editing.md)
25+
With the **Binary** editor, see the following actions:
2626

27-
- [Edit binary data](../windows/editing-binary-data.md)
27+
### To open a resource for binary editing
2828

29-
- [Find binary data](../windows/finding-binary-data.md)
29+
#### To open a Windows desktop resource
3030

31-
- [Create a new custom or data resource](../windows/creating-a-new-custom-or-data-resource.md)
31+
1. In [Resource View](../windows/resource-view-window.md), select the specific resource file you want to edit.
32+
33+
> [!NOTE]
34+
> 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).
35+
36+
1. Right-click the resource and click **Open Binary Data** from the shortcut menu.
37+
38+
> [!NOTE]
39+
> If you use the [Resource View](../windows/resource-view-window.md) window to open a resource with a format that Visual Studio does not recognize (such as RCDATA or a custom resource), the resource is automatically opened in the **Binary** editor.
40+
41+
#### To open a managed resource
42+
43+
1. In **Solution Explorer**, select the specific resource file you want to edit.
44+
45+
1. Right-click the resource and choose **Open With** from the shortcut menu.
46+
47+
1. In the **Open With** dialog box, choose **Binary Editor**.
48+
49+
> [!NOTE]
50+
> You can use the [Image editor](../windows/image-editor-for-icons.md) and the [Binary editor](binary-editor.md) to work with resource files in managed projects. Any managed resources you want to edit must be linked resources. The Visual Studio resource editors do not support editing embedded resources.
51+
52+
![Binary Editor](../mfc/media/vcbinaryeditor2.gif "vcBinaryEditor2")<br/>
53+
Binary Data for a Dialog Box Displayed in the Binary Editor
54+
55+
Only certain ASCII values are represented in the Binary editor (0x20 through 0x7E). Extended characters are displayed as periods in the ASCII Value section of the Binary editor (the right panel). The "printable" characters are ASCII values 32 through 126.
56+
57+
> [!NOTE]
58+
> If you want to use the **Binary** editor on a resource already being edited in another editor window, close the other editor window first.
59+
60+
### To edit a resource in the Binary editor
61+
62+
1. Select the byte you want to edit.
63+
64+
The **Tab** key moves the focus between the hexadecimal and ASCII sections of the **Binary** editor. You can use the **Page Up** and **Page Down** keys to move through the resource one screen at a time.
65+
66+
1. Type the new value.
67+
68+
The value changes immediately in both the hexadecimal and ASCII sections and focus shifts to the next value in line.
69+
70+
> [!NOTE]
71+
> The **Binary** editor accepts changes automatically when you close the editor.
72+
73+
### To find binary data
74+
75+
You can search for either ASCII strings or hexadecimal bytes. For example, to find "Hello," you can search for either the string "Hello" or for "48 65 6C 6C 6F" (the hexadecimal equivalent).
76+
77+
1. From the **Edit** menu, choose [Find](/visualstudio/ide/reference/find-command).
78+
79+
1. In the **Find What** box, select a previous search string from the drop-down list or type the data you want to find.
80+
81+
1. Select any of the **Find** options.
82+
83+
1. Select **Find Next**.
84+
85+
### To create a new custom or data resource
86+
87+
You can create a new custom or data resource by placing the resource in a separate file using normal resource script (.rc) file syntax, and then including that file by right-clicking your project in **Solution Explorer** and clicking **Resource Includes** on the shortcut menu.
88+
89+
1. [Create a .rc file](../windows/how-to-create-a-resource-script-file.md) that contains the custom or data resource.
90+
91+
You can type custom data in a .rc file as null-terminated quoted strings, or as integers in decimal, hexadecimal, or octal format.
92+
93+
1. In **Solution Explorer**, right-click your project's .rc file, then click **Resource Includes** on the shortcut menu.
94+
95+
1. In the **Compile-Time Directives** box, type a `#include` statement that gives the name of the file containing your custom resource. For example:
96+
97+
```cpp
98+
#include mydata.rc
99+
```
100+
101+
Make sure the syntax and spelling of what you type are correct. The contents of the **Compile-Time Directives** box are inserted into the resource script file exactly as you typed them.
102+
103+
1. Select **OK** to record your changes.
104+
105+
Another way to create a custom resource is to import an external file as the custom resource. For more information, see [Importing and Exporting Resources](../windows/how-to-import-and-export-resources.md).
106+
107+
> [!NOTE]
108+
> Creating new custom or data resources requires Win32.
32109

33110
## Managed Resources
34111

‎docs/windows/creating-a-new-custom-or-data-resource.md‎

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

‎docs/windows/editing-binary-data.md‎

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

‎docs/windows/finding-binary-data.md‎

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

‎docs/windows/opening-a-resource-for-binary-editing.md‎

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

0 commit comments

Comments
 (0)