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
Copy file name to clipboardExpand all lines: docs/cpp/set-com-error-handler.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -83,8 +83,8 @@ Exception raised: Unable to establish the connection!
83
83
84
84
**Header:**\<comdef.h>
85
85
86
-
**Lib:** If the **wchar_t is Native Type** compiler option is on, use comsuppw.lib or comsuppwd.lib. If **wchar_t is Native Type** is off, use comsupp.lib. For more information, see [/Zc:wchar_t (wchar_t Is Native Type)](../build/reference/zc-wchar-t-wchar-t-is-native-type.md).
86
+
**Lib:** If the **/Zc:wchar_t** compiler option is specified (the default), use comsuppw.lib or comsuppwd.lib. If the **/Zc:wchar_t-**compiler option is specified, use comsupp.lib. For more information, including how to set this option in the IDE, see [/Zc:wchar_t (wchar_t Is Native Type)](../build/reference/zc-wchar-t-wchar-t-is-native-type.md).
87
87
88
88
## See also
89
89
90
-
[Compiler COM Global Functions](../cpp/compiler-com-global-functions.md)
90
+
[Compiler COM Global Functions](../cpp/compiler-com-global-functions.md)
These symbols are defined in the ATL header files, but they support standard Windows application functions and actions. These symbols are mainly used with dialog boxes. When you are working with dialogs and controls in the [Dialog editor](../windows/dialog-editor.md), these symbols will appear in the **Properties** window associated with common controls. For instance, if your dialog box has a **Cancel** button, that command will be associated with the symbol IDCANCEL in the [Properties Window](/visualstudio/ide/reference/properties-window).
9
+
These symbols are defined in the ATL header files, but they support standard Windows application functions and actions. These symbols are mainly used with dialog boxes.
10
+
11
+
When you are working with dialogs and controls in the [Dialog editor](../windows/dialog-editor.md), these symbols will appear in the **Properties** window associated with common controls. For instance, if your dialog box has a **Cancel** button, that command will be associated with the symbol IDCANCEL in the [Properties Window](/visualstudio/ide/reference/properties-window).
When you create a new resource or resource object, the development environment assigns it a default symbol name, for example, IDD_DIALOG1. You can use the [Properties Window](/visualstudio/ide/reference/properties-window) to change the default symbol name or to change the name of any symbol already associated with a resource.
10
+
When you create a new resource or resource object, the development environment assigns it a default symbol name, for example, `IDD_DIALOG1`. You can use the [Properties Window](/visualstudio/ide/reference/properties-window) to change the default symbol name or to change the name of any symbol already associated with a resource.
11
11
12
12
For symbols associated with a single resource, you can also use the **Properties** window to change the symbol value. You can use the [Resource Symbols dialog box](../windows/resource-symbols-dialog-box.md) to change the value of symbols not currently assigned to a resource.
13
13
14
14
Normally all symbol definitions are saved in `Resource.h`. However, you may need to change this include filename so that you can, for example, work with more than one resource file in the same directory.
15
15
16
16
> [!NOTE]
17
-
> If your project doesn't already contain an .rc file, see [Creating a New Resource Script File](../windows/how-to-create-a-resource-script-file.md).
17
+
> If your project doesn't already contain an .rc file, see [How to: Create Resources](../windows/how-to-create-a-resource-script-file.md).
18
18
19
19
## Symbol Name Restrictions
20
20
@@ -30,14 +30,14 @@ The restrictions on symbol names are as follows:
30
30
31
31
- Symbol names aren't case-sensitive, but the case of the first symbol definition is preserved. The header file that defines the symbols is used by both the resource compiler/editor and C++ program(s) to refer resources defined in a resource file. For two symbol names that differ only in case, the C++ program will see two separate symbols while the resource compiler/editor will see both names as referring to one single symbol.
32
32
33
-
> [!NOTE]
34
-
> If you do not follow the standard symbol name scheme (ID*_[keyword]) outlined below, and your symbol name happens to be the same as a keyword known to the resource script compiler, trying to build the resource script file will result in seemingly random error generation that is difficult to diagnose. To prevent this, adhere to the standard naming scheme.
33
+
> [!NOTE]
34
+
> If you don't follow the standard symbol name scheme (ID*_[keyword]) outlined below and your symbol name happens to be the same as a keyword known to the resource script compiler, trying to build the resource script file will result in seemingly random error generation that is difficult to diagnose. To prevent this, adhere to the standard naming scheme.
35
35
36
-
Symbol names have descriptive prefixes that indicate the kind of resource or object they represent. These descriptive prefixes begin with the text combination ID. The Microsoft Foundation Class Library (MFC) uses the symbol naming conventions shown in the following table.
36
+
Symbol names have descriptive prefixes that indicate the kind of resource or object they represent. These descriptive prefixes begin with the text combination ID. The Microsoft Foundation Class library (MFC) uses the symbol naming conventions shown in the following table:
37
37
38
38
|Category|Prefix|Use|
39
39
|--------------|------------|---------|
40
-
|Resources|IDR_ IDD_ IDC_ IDI_ IDB_|Accelerator or menu (and associated or custom resources) Dialog box Cursor Icon Bitmap|
40
+
|Resources|IDR_, IDD_, IDC_, IDI_, IDB_|Accelerator or menu (and associated or custom resources), dialog box, cursor, icon, bitmap|
41
41
|Menu items|ID_|Menu item|
42
42
|Commands|ID_|Command|
43
43
|Controls and child windows|IDC_|Control|
@@ -52,11 +52,12 @@ Symbol names have descriptive prefixes that indicate the kind of resource or obj
52
52
53
53
If you type a new symbol name, it's automatically assigned a value.
54
54
55
-
You can use the [Resource Symbols dialog box](../windows/resource-symbols-dialog-box.md) to change the names of symbols not currently assigned to a resource.
55
+
> [!NOTE]
56
+
> You can use the [Resource Symbols dialog box](../windows/resource-symbols-dialog-box.md) to change the names of symbols not currently assigned to a resource.
56
57
57
58
## Symbol Value Restrictions
58
59
59
-
A symbol value can be any integer expressed in the normal manner for #define preprocessor directives. Here are some examples of symbol values:
60
+
A symbol value can be any integer expressed in the normal manner for `#define` preprocessor directives. Here are some examples of symbol values:
60
61
61
62
```
62
63
18
@@ -79,15 +80,13 @@ Here are some limitations of symbol values:
79
80
#defineIDC_MYEDIT IDC_OTHEREDIT //not supported
80
81
```
81
82
82
-
- You can't use preprocessor macros with arguments as value definitions. For example:
83
+
- You can't use preprocessor macros with arguments as value definitions. The following example isn't a valid expression regardless of what `ID` evaluates to at compile time:
83
84
84
85
```cpp
85
86
#defineIDD_ABOUT ID(7) //not supported
86
87
```
87
88
88
-
isn't a valid expression regardless of what `ID` evaluates to at compile time.
89
-
90
-
- Your application may have an existing file containing symbols defined with expressions. For more information on how to include the symbols as read-only symbols, see [Using Shared (Read Only) or Calculated Symbols](../windows/including-shared-read-only-or-calculated-symbols.md).
89
+
- Your application may have an existing file containing symbols defined with expressions.
91
90
92
91
For more information on number ranges, see [TN023: Standard MFC Resources](../mfc/tn023-standard-mfc-resources.md).
93
92
@@ -101,7 +100,7 @@ For more information on number ranges, see [TN023: Standard MFC Resources](../mf
101
100
IDC_EDITNAME=5100
102
101
```
103
102
104
-
The new value is stored in the symbol header file the next time you save the project. Only the symbol name remains visible in the ID box; the equal sign and value aren't displayed after they're validated.
103
+
The new value is stored in the symbol header file the next time you save the project. Only the symbol name remains visible in the ID boxand the equal sign and value aren't displayed after they're validated.
105
104
106
105
## Change or Delete Symbols
107
106
@@ -114,14 +113,14 @@ While in the [Resource Symbols dialog box](../windows/resource-symbols-dialog-bo
114
113
1. Edit the symbol's name or value in the boxes provided in the **Change Symbol** dialog box.
115
114
116
115
> [!NOTE]
117
-
> To change a symbol that *is* assigned to a resource or object, you must use the resource editor or **Properties** window.
116
+
> To change a symbol that's assigned to a resource or object, you must use the resource editor or **Properties** window.
118
117
119
118
### To delete an unassigned (unused) symbol
120
119
121
120
In the [Resource Symbols dialog box](../windows/resource-symbols-dialog-box.md), select the symbol that you want to delete, and choose **Delete**.
122
121
123
-
> [!NOTE]
124
-
> Before deleting an unused symbol in a resource file, make sure it is not used elsewhere in the program or by resource files included at compile time.
122
+
> [!NOTE]
123
+
> Before deleting an unused symbol in a resource file, make sure it'snot used elsewhere in the program or by resource files included at compile time.
125
124
126
125
## Include Symbols
127
126
@@ -156,9 +155,9 @@ The environment will correctly interpret these calculated symbols as long as:
156
155
Don't call the file `Resource.h`, since that is the filename normally used by the main symbol header file.
157
156
158
157
> [!NOTE]
159
-
> **Important**What you type in the Read-Only symbol directives box is included in the resource file exactly as you type it. Make sure what you type does not contain any spelling or syntax errors.
158
+
> What you type in the **Read-Only symbol directives** box is included in the resource file exactly as you type it. Make sure what you type does not contain any spelling or syntax errors.
160
159
161
-
Use the **Read-only symbol directives** box to include files with symbol definitions only. Don't include resource definitions; otherwise, duplicate resource definitions will be created when the file is saved.
160
+
Use the **Read-only symbol directives** box to include files with symbol definitions only. Don't include resource definitions, else duplicate resource definitions will be created when the file is saved.
When you're beginning a new project, you may find it convenient to map out the symbol names you need before creating the resources to which they'll be assigned.
11
11
12
-
The **Resource Symbols**C++ dialog box allows you to add new resource symbols, change the symbols that are displayed, or skip to the location in the source code where a symbol is in use.
12
+
The **Resource Symbols** dialog box allows you to add new resource symbols, change the symbols that are displayed, or skip to the location in the source code where a symbol is in use.
13
13
14
14
The dialog box contains the following properties:
15
15
@@ -21,12 +21,12 @@ The dialog box contains the following properties:
21
21
|**Show read-only symbols**|When selected, displays read-only resources. By default, the **Resource Symbol** dialog box displays only the modifiable resources in your resource script file, but with this option selected, modifiable resources appear in bold text and read-only resources appear in plain text.|
22
22
|**Used by**|Displays the resource or resources using the symbol selected in the symbols list. To move to the editor for a given resource, select the resource in the **Used By** box and choose **View Use**.|
23
23
|**New**|Opens the **New Symbol** dialog box, which enables you to define the name and, if necessary, a value for a new symbolic resource identifier.|
24
-
|**Change**|Opens the **Change Symbol** dialog box, which allows you to change the name or value of a symbol. If the symbol is for a control or resource in use, the symbol can be changed only from the corresponding resource editor. For more information, see [Changing Unassigned Symbols](../windows/changing-unassigned-symbols.md).|
24
+
|**Change**|Opens the **Change Symbol** dialog box, which allows you to change the name or value of a symbol. If the symbol is for a control or resource in use, the symbol can be changed only from the corresponding resource editor. For more information, see [Manage Symbols](../windows/changing-unassigned-symbols.md).|
25
25
|**View Use**|Opens the resource that contains the symbol in the corresponding resource editor.|
26
26
27
27
## Create Symbols
28
28
29
-
### To create a new symbol
29
+
To create a new symbol:
30
30
31
31
1. In the **Resource Symbols** dialog box, choose **New**.
32
32
@@ -37,26 +37,24 @@ The dialog box contains the following properties:
37
37
1. Select **OK** to add the new symbol to the symbol list.
38
38
39
39
> [!NOTE]
40
-
> If you type a symbol name that already exists, a message box appears stating that a symbol with that name is already defined. You cannot define two or more symbols with the same name, but you can define different symbols with the same numeric value. For more information, see [Symbol Name Restrictions](../windows/symbol-name-restrictions.md) and [Symbol Value Restrictions](../windows/symbol-value-restrictions.md).
40
+
> If you type a symbol name that already exists, a message box appears stating that a symbol with that name is already defined. You can't define two or more symbols with the same name, but you can define different symbols with the same numeric value.
41
41
42
-
### To view resource symbols
42
+
To view resource symbols:
43
43
44
44
1. In [Resource View](../windows/resource-view-window.md), right-click your .rc file.
45
45
46
46
> [!NOTE]
47
-
> 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).
47
+
> If your project doesn't already contain an .rc file, please see [How to: Create Resources](../windows/how-to-create-a-resource-script-file.md).
48
48
49
49
1. Select **Resource Symbols** from the shortcut menu to view a resource symbol table in the **Resource Symbols** dialog box.
50
50
51
51
> [!NOTE]
52
52
> To see predefined symbols, check the **Show read-only symbols** check box.
53
53
54
-
### To open the resource editor for a given symbol
54
+
To open the resource editor for a given symbol:
55
55
56
56
When you're browsing symbols in the **Resource Symbols**, you may want more information on how a particular symbol is used. The **View Use** button provides a quick way to get this information.
57
57
58
-
#### To move to the resource editor where a symbol is being used
59
-
60
58
1. Select a symbol in the **Name** box of the **Resource Symbols** dialog box.
61
59
62
60
1. In the **Used By** box, select the resource type that interests you.
Copy file name to clipboardExpand all lines: docs/windows/mfc-predefined-symbols.md
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -11,12 +11,12 @@ MFC projects always include several header files that support windows. These are
11
11
```cpp
12
12
#include<afxwin.h>//MFC core and standard components
13
13
#include<afxext.h>//MFC extensions
14
-
#include<afxdisp.h //MFC automation classes
14
+
#include<afxdisp.h>//MFC automation classes
15
15
#include<afxdtctl.h>//MFC support for Internet Explorer common controls
16
16
#include<afxcmn.h>//MFC support for Windows common controls.
17
17
```
18
18
19
-
The header files include symbol ID values for MFC common values. These symbols are only available when you're working in an MFC project. The AFX_ prefix is followed by the standard symbol name prefixes.
19
+
The header files include symbol ID values for MFC common values. These symbols are only available when you're working in an MFC project. The `AFX_` prefix is followed by the standard symbol name prefixes.
20
20
21
21
|||
22
22
|-|-|
@@ -199,7 +199,7 @@ The header files include symbol ID values for MFC common values. These symbols a
199
199
|AFX_IDS_UPDATING_ITEMS|AFX_IDS_USER_EXCEPTION|
200
200
|AFX_IDS_VERB_EDIT|AFX_IDS_VERB_PROPERTIES|
201
201
202
-
## MFC database programming symbols
202
+
## MFC Database Programming
203
203
204
204
The symbols in this table only appear in an MFC project when database support has been added. They support the MFC connection to SQL servers and database programming.
205
205
@@ -220,9 +220,11 @@ The symbols in this table only appear in an MFC project when database support ha
These symbols are also part of the MFC support files, but they support standard Windows application functions and actions. These symbols are used with menus. When you are working with menus in the **Menu Editor**, these symbols will appear in the **Property Window** associated with common menu commands. For instance, if your application has a **File** menu with an **Exit** command, that command will be associated with the symbol ID_APP_EXIT in the [Properties window](/visualstudio/ide/reference/properties-window).
225
+
These symbols are also part of the MFC support files, but they support standard Windows application functions and actions. These symbols are used with menus.
226
+
227
+
When you're working with menus in the **Menu Editor**, these symbols will appear in the **Property Window** associated with common menu commands. For instance, if your application has a **File** menu with an **Exit** command, that command will be associated with the symbol ID_APP_EXIT in the [Properties window](/visualstudio/ide/reference/properties-window).
0 commit comments