Skip to content

Commit 332a3a5

Browse files
author
Colin Robertson
authored
Merge pull request #1269 from corob-msft/cr-frontier-windows
Space, the final frontier...
2 parents 04f1c09 + aebd863 commit 332a3a5

File tree

819 files changed

+37473
-34106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

819 files changed

+37473
-34106
lines changed

docs/windows/abstract-cpp-component-extensions.md

Lines changed: 89 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -13,87 +13,93 @@ ms.author: "mblome"
1313
ms.workload: ["cplusplus", "uwp"]
1414
---
1515
# abstract (C++ Component Extensions)
16-
The **abstract** keyword declares either:
17-
18-
- A type can be used as a base type, but the type itself cannot be instantiated.
19-
20-
- A type member function can be defined only in a derived type.
21-
22-
## All Platforms
23-
### Syntax
24-
25-
```cpp
26-
class-declaration
27-
class-identifier
28-
abstract {}
29-
virtualreturn-typemember-function-identifier() abstract ;
30-
```
31-
16+
17+
The **abstract** keyword declares either:
18+
19+
- A type can be used as a base type, but the type itself cannot be instantiated.
20+
21+
- A type member function can be defined only in a derived type.
22+
23+
## All Platforms
24+
25+
### Syntax
26+
27+
```cpp
28+
class-declaration
29+
class-identifier
30+
abstract {}
31+
virtualreturn-typemember-function-identifier() abstract ;
32+
```
33+
3234
### Remarks
33-
34-
The first example syntax declares a class to be abstract. The *class-declaration* component can be either a native C++ declaration (**class** or **struct**), or a C++ extension declaration (**ref class** or **ref struct**) if the `/ZW` or `/clr` compiler option is specified.
35-
36-
The second example syntax declares a virtual member function to be abstract. Declaring a function abstract is the same as declaring it a pure virtual function. Declaring a member function abstract also causes the enclosing class to be declared abstract.
37-
38-
The **abstract** keyword is supported in native and platform-specific code; that is, it can be compiled with or without the `/ZW` or `/clr` compiler option.
39-
40-
You can detect at compile time if a type is abstract with the `__is_abstract(type)` type trait. For more information, see [Compiler Support for Type Traits](../windows/compiler-support-for-type-traits-cpp-component-extensions.md).
41-
42-
The **abstract** keyword is a context-sensitive override specifier. For more information about context-sensitive keywords, see [Context-Sensitive Keywords](../windows/context-sensitive-keywords-cpp-component-extensions.md). For more information about override specifiers, see [How to: Declare Override Specifiers in Native Compilations](../dotnet/how-to-declare-override-specifiers-in-native-compilations-cpp-cli.md).
43-
44-
## Windows Runtime
45-
For more information, see [Ref classes and structs](../cppcx/ref-classes-and-structs-c-cx.md).
46-
47-
### Requirements
48-
Compiler option: `/ZW`
49-
50-
## Common Language Runtime
51-
52-
### Requirements
53-
Compiler option: `/clr`
54-
55-
### Examples
56-
57-
The following code example generates an error because class `X` is marked **abstract**.
58-
59-
```cpp
60-
// abstract_keyword.cpp
61-
// compile with: /clr
62-
ref class X abstract {
63-
public:
64-
virtual void f() {}
65-
};
66-
67-
int main() {
68-
X ^ MyX = gcnew X; // C3622
69-
}
70-
```
71-
72-
The following code example generates an error because it instantiates a native class that is marked **abstract**. This error will occur with or without the `/clr` compiler option.
73-
74-
```cpp
75-
// abstract_keyword_2.cpp
76-
class X abstract {
77-
public:
78-
virtual void f() {}
79-
};
80-
81-
int main() {
82-
X * MyX = new X; // C3622: 'X': a class declared as 'abstract'
83-
// cannot be instantiated. See declaration of 'X'}
84-
```
85-
86-
The following code example generates an error because function `f` includes a definition but is marked **abstract**. The final statement in the example shows that declaring an abstract virtual function is equivalent to declaring a pure virtual function.
87-
88-
```cpp
89-
// abstract_keyword_3.cpp
90-
// compile with: /clr
91-
ref class X {
92-
public:
93-
virtual void f() abstract {} // C3634
94-
virtual void g() = 0 {} // C3634
95-
};
96-
```
97-
98-
## See Also
99-
[Component Extensions for Runtime Platforms](../windows/component-extensions-for-runtime-platforms.md)
35+
36+
The first example syntax declares a class to be abstract. The *class-declaration* component can be either a native C++ declaration (**class** or **struct**), or a C++ extension declaration (**ref class** or **ref struct**) if the `/ZW` or `/clr` compiler option is specified.
37+
38+
The second example syntax declares a virtual member function to be abstract. Declaring a function abstract is the same as declaring it a pure virtual function. Declaring a member function abstract also causes the enclosing class to be declared abstract.
39+
40+
The **abstract** keyword is supported in native and platform-specific code; that is, it can be compiled with or without the `/ZW` or `/clr` compiler option.
41+
42+
You can detect at compile time if a type is abstract with the `__is_abstract(type)` type trait. For more information, see [Compiler Support for Type Traits](../windows/compiler-support-for-type-traits-cpp-component-extensions.md).
43+
44+
The **abstract** keyword is a context-sensitive override specifier. For more information about context-sensitive keywords, see [Context-Sensitive Keywords](../windows/context-sensitive-keywords-cpp-component-extensions.md). For more information about override specifiers, see [How to: Declare Override Specifiers in Native Compilations](../dotnet/how-to-declare-override-specifiers-in-native-compilations-cpp-cli.md).
45+
46+
## Windows Runtime
47+
48+
For more information, see [Ref classes and structs](../cppcx/ref-classes-and-structs-c-cx.md).
49+
50+
### Requirements
51+
52+
Compiler option: `/ZW`
53+
54+
## Common Language Runtime
55+
56+
### Requirements
57+
58+
Compiler option: `/clr`
59+
60+
### Examples
61+
62+
The following code example generates an error because class `X` is marked **abstract**.
63+
64+
```cpp
65+
// abstract_keyword.cpp
66+
// compile with: /clr
67+
ref class X abstract {
68+
public:
69+
virtual void f() {}
70+
};
71+
72+
int main() {
73+
X ^ MyX = gcnew X; // C3622
74+
}
75+
```
76+
77+
The following code example generates an error because it instantiates a native class that is marked **abstract**. This error will occur with or without the `/clr` compiler option.
78+
79+
```cpp
80+
// abstract_keyword_2.cpp
81+
class X abstract {
82+
public:
83+
virtual void f() {}
84+
};
85+
86+
int main() {
87+
X * MyX = new X; // C3622: 'X': a class declared as 'abstract'
88+
// cannot be instantiated. See declaration of 'X'}
89+
```
90+
91+
The following code example generates an error because function `f` includes a definition but is marked **abstract**. The final statement in the example shows that declaring an abstract virtual function is equivalent to declaring a pure virtual function.
92+
93+
```cpp
94+
// abstract_keyword_3.cpp
95+
// compile with: /clr
96+
ref class X {
97+
public:
98+
virtual void f() abstract {} // C3634
99+
virtual void g() = 0 {} // C3634
100+
};
101+
```
102+
103+
## See Also
104+
105+
[Component Extensions for Runtime Platforms](../windows/component-extensions-for-runtime-platforms.md)

docs/windows/accelerator-editor.md

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,35 @@ ms.author: "mblome"
1313
ms.workload: ["cplusplus", "uwp"]
1414
---
1515
# Accelerator Editor
16-
An accelerator table is a Windows resource that contains a list of accelerator keys (also known as shortcut keys) and the command identifiers that are associated with them. A program can have more than one accelerator table.
17-
18-
Normally, accelerators are used as keyboard shortcuts for program commands that are also available on a menu or toolbar. However, you can use the accelerator table to define key combinations for commands that don't have a user-interface object associated with them.
19-
20-
You can use [Class View](http://msdn.microsoft.com/8d7430a9-3e33-454c-a9e1-a85e3d2db925) to hook accelerator key commands to code.
21-
22-
With the **Accelerator** editor, you can:
23-
24-
- [Set Accelerator Properties](../windows/setting-accelerator-properties.md)
25-
26-
- [Associate an Accelerator Key with a Menu Item](../windows/associating-an-accelerator-key-with-a-menu-item.md)
27-
28-
- [Edit Accelerator Tables](../windows/editing-accelerator-tables.md)
29-
30-
- [Use Predefined Accelerator Keys](../windows/predefined-accelerator-keys.md)
31-
32-
> [!TIP]
33-
> While using the **Accelerator** editor, you can right-click to display a shortcut menu of frequently used commands. The commands available depend on what the pointer is pointing to.
34-
35-
> [!NOTE]
36-
> Windows does not allow you to create empty accelerator tables. If you create an accelerator table with no entries, it is deleted automatically when you save the table.
37-
38-
For information on adding resources to managed projects, please see [Resources in Desktop Apps](/dotnet/framework/resources/index) in the *.NET Framework Developer's Guide*. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resource strings to properties, see [Creating Resource Files for Desktop Apps](/dotnet/framework/resources/creating-resource-files-for-desktop-apps). For information on globalization and localization of resources in managed apps, see [Globalizing and Localizing .NET Framework Applications](/dotnet/standard/globalization-localization/index).
39-
40-
## Requirements
41-
Win32
42-
43-
## See Also
44-
[Resource Editors](../windows/resource-editors.md)
16+
17+
An accelerator table is a Windows resource that contains a list of accelerator keys (also known as shortcut keys) and the command identifiers that are associated with them. A program can have more than one accelerator table.
18+
19+
Normally, accelerators are used as keyboard shortcuts for program commands that are also available on a menu or toolbar. However, you can use the accelerator table to define key combinations for commands that don't have a user-interface object associated with them.
20+
21+
You can use [Class View](http://msdn.microsoft.com/8d7430a9-3e33-454c-a9e1-a85e3d2db925) to hook accelerator key commands to code.
22+
23+
With the **Accelerator** editor, you can:
24+
25+
- [Set Accelerator Properties](../windows/setting-accelerator-properties.md)
26+
27+
- [Associate an Accelerator Key with a Menu Item](../windows/associating-an-accelerator-key-with-a-menu-item.md)
28+
29+
- [Edit Accelerator Tables](../windows/editing-accelerator-tables.md)
30+
31+
- [Use Predefined Accelerator Keys](../windows/predefined-accelerator-keys.md)
32+
33+
> [!TIP]
34+
> While using the **Accelerator** editor, you can right-click to display a shortcut menu of frequently used commands. The commands available depend on what the pointer is pointing to.
35+
36+
> [!NOTE]
37+
> Windows does not allow you to create empty accelerator tables. If you create an accelerator table with no entries, it is deleted automatically when you save the table.
38+
39+
For information on adding resources to managed projects, please see [Resources in Desktop Apps](/dotnet/framework/resources/index) in the *.NET Framework Developer's Guide*. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resource strings to properties, see [Creating Resource Files for Desktop Apps](/dotnet/framework/resources/creating-resource-files-for-desktop-apps). For information on globalization and localization of resources in managed apps, see [Globalizing and Localizing .NET Framework Applications](/dotnet/standard/globalization-localization/index).
40+
41+
## Requirements
42+
43+
Win32
44+
45+
## See Also
46+
47+
[Resource Editors](../windows/resource-editors.md)

docs/windows/accelerator-key-property.md

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,37 @@ ms.author: "mblome"
1212
ms.workload: ["cplusplus", "uwp"]
1313
---
1414
# Accelerator Key Property
15-
The following are legal entries for the Key property in the accelerator table:
16-
17-
- An integer between 0 and 255 in decimal format. The value determines whether the value is treated as ASCII or ANSI as follows:
18-
19-
- Single-digit numbers are always interpreted as the corresponding key, rather than as ASCII or ANSI values.
20-
21-
- Values from 1 through 26, when preceded with zeros, are interpreted as ^A through ^Z, which represents the ASCII value of the letters of the alphabet when pressed with the **Ctrl** key held down.
22-
23-
- Values from 27-32 are always interpreted as three-digit decimal values 027 through 032.
24-
25-
- Values from 033 through 255, whether preceded by 0's or not are interpreted as ANSI values.
26-
27-
- A single keyboard character. Uppercase A - Z or the numbers 0 - 9 can be either ASCII or virtual key values; any other character is ASCII only.
28-
29-
- A single keyboard character in the range A - Z (uppercase only), preceded by a caret (^) (for example, ^C). This enters the ASCII value of the key when it is pressed with the **Ctrl** key held down.
30-
31-
> [!NOTE]
32-
> When entering an ASCII value, the modifier property options are limited. The only control key available for use is the **Alt** key.
33-
34-
- Any valid virtual key identifier. The drop-down Key box in the Accelerator table contains a list of standard virtual key identifiers.
35-
36-
> [!TIP]
37-
> Another way to define an accelerator key is to right-click an entry or multiple entries in the Accelerator table, choose **Next Key Typed** from the shortcut menu, and then press any of the keys or key combinations on the keyboard. The **Next Key Typed** command is also available from the **Edit** menu.
38-
39-
## Requirements
40-
Win32
41-
42-
## See Also
43-
[Setting Accelerator Properties](../windows/setting-accelerator-properties.md)
44-
[Editing in an Accelerator Table](../windows/editing-in-an-accelerator-table.md)
45-
[Accelerator Editor](../windows/accelerator-editor.md)
15+
16+
The following are legal entries for the Key property in the accelerator table:
17+
18+
- An integer between 0 and 255 in decimal format. The value determines whether the value is treated as ASCII or ANSI as follows:
19+
20+
- Single-digit numbers are always interpreted as the corresponding key, rather than as ASCII or ANSI values.
21+
22+
- Values from 1 through 26, when preceded with zeros, are interpreted as ^A through ^Z, which represents the ASCII value of the letters of the alphabet when pressed with the **Ctrl** key held down.
23+
24+
- Values from 27-32 are always interpreted as three-digit decimal values 027 through 032.
25+
26+
- Values from 033 through 255, whether preceded by 0's or not are interpreted as ANSI values.
27+
28+
- A single keyboard character. Uppercase A - Z or the numbers 0 - 9 can be either ASCII or virtual key values; any other character is ASCII only.
29+
30+
- A single keyboard character in the range A - Z (uppercase only), preceded by a caret (^) (for example, ^C). This enters the ASCII value of the key when it is pressed with the **Ctrl** key held down.
31+
32+
> [!NOTE]
33+
> When entering an ASCII value, the modifier property options are limited. The only control key available for use is the **Alt** key.
34+
35+
- Any valid virtual key identifier. The drop-down Key box in the Accelerator table contains a list of standard virtual key identifiers.
36+
37+
> [!TIP]
38+
> Another way to define an accelerator key is to right-click an entry or multiple entries in the Accelerator table, choose **Next Key Typed** from the shortcut menu, and then press any of the keys or key combinations on the keyboard. The **Next Key Typed** command is also available from the **Edit** menu.
39+
40+
## Requirements
41+
42+
Win32
43+
44+
## See Also
45+
46+
[Setting Accelerator Properties](../windows/setting-accelerator-properties.md)
47+
[Editing in an Accelerator Table](../windows/editing-in-an-accelerator-table.md)
48+
[Accelerator Editor](../windows/accelerator-editor.md)

0 commit comments

Comments
 (0)