Skip to content

Commit 23f5fc9

Browse files
TaojunshenSteve Wishnouskyrachana-sataoopbld15Colin Robertson
authored
4/14/2022 AM Publish (MicrosoftDocs#4219)
* Update open-wopen.md Clarify that _O_TEMPORARY sets FILE_SHARE_DELETE. * Update other pages that mention _O_TEMPORARY effects. * New article - IDL method wizard * update after review * update after review * Update after review * Update after review * Updating - Add property wizard for VS2022 * Updating broken links * Update after review * New article - Add an IDL Property * link updation * Update after review * update after review * update after review * New article - IDL MFC property wizard * Broken link fixed * Broken link fixed * Update virtual-functions.md * update for links * Updating links * Address cpp-docs 3780 3782 3790 3791 3805 * Attempt correction of table format * Add documentation for compiler error C2956 and update error text (MicrosoftDocs#4176) * Add documentation for compiler error C2956 and update error text * Add TOC entry * Update for grammar and my own comprehension. Sometimes, you just get carried away. This version could use some simplification. * Simplify. Address remarks, attempt simplification. Acrolinx all the things. * More updates per review Co-authored-by: Colin Robertson <corob@microsoft.com> * Address cpp-docs 3816 * Address non-blocking issues from 4207 * fix for sample program. * edits * edit pass. Move to ide location * minor edit * fix link * Final update * final update * final update * resolving blocking issue * resolving blocking issue * ToC update for new article * ToC update * link update * Correct inconsistent formatting for the `_O_EXCL` constant in the docs for the open functions * Update c28195.md * Update in alt-text * Update in alt-text * Final Update- See also section * edit pass * edit pass * more cleanup * typo * small edit * Final update * edit pass * edit pass * formatting for scannability * acrolinx * one more try at spacing * final update Co-authored-by: Steve Wishnousky <stwish@microsoft.com> Co-authored-by: rachana-satao <83084319+rachana-satao@users.noreply.github.com> Co-authored-by: opbld15 <opbld15@microsoft.com> Co-authored-by: Colin Robertson <corob@microsoft.com> Co-authored-by: opbld16 <opbld16@microsoft.com> Co-authored-by: opbld17 <opbld17@microsoft.com> Co-authored-by: atikmapari <31974726+atikmapari@users.noreply.github.com> Co-authored-by: PRMerger19 <prmrgr19@microsoft.com> Co-authored-by: Ming Ho <94572161+homing1@users.noreply.github.com> Co-authored-by: PRMerger5 <prmergr5@microsoft.com> Co-authored-by: Regan Downer <97987445+v-regandowner@users.noreply.github.com> Co-authored-by: Jonathan Emmett <joemmett@microsoft.com> Co-authored-by: Tamara K <93546702+tamarakhader@users.noreply.github.com> Co-authored-by: TylerMSFT <Tyler.Whitney@microsoft.com> Co-authored-by: PRMerger17 <prmrgr17@microsoft.com> Co-authored-by: Paula Miller <v-paulmi@microsoft.com> Co-authored-by: Martin Storsjö <martin@martin.st> Co-authored-by: Sunny Chatterjee <sunnych@microsoft.com> Co-authored-by: Tyler Whitney <TylerMSFT@users.noreply.github.com> Co-authored-by: Colin Cooper <72402153+v-ccolin@users.noreply.github.com>
1 parent e933bed commit 23f5fc9

6 files changed

+213
-28
lines changed

docs/ide/add-interface-definition-library-property-wizard.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
22
description: "Learn more about: Use a Microsoft Visual Studio wizard to add an IDL property to an IDL interface in your project"
33
title: "Add an IDL property"
4-
ms.date: 04/11/2022
4+
ms.date: 04/14/2022
55
f1_keywords: ["vc.codewiz.prop.overview", "vc.codewiz.prop.idlattributes"]
66
helpviewer_keywords: ["interfaces, adding properties", "properties [C++], adding to interfaces", "names, add property wizard", "IDL attributes", "stock properties, about stock properties", "stock properties"]
77
ms.custom: devdivchpfy22
88
---
99
# Add an IDL property
1010

11-
The **Add IDL Property** wizard adds a method to an interface defined in an Interface Definition Library (IDL). To use the **Add IDL Property** wizard, your project can't support MFC.
11+
The **Add IDL Property** wizard adds a property to an interface defined in an Interface Definition Library (IDL), such as in an ATL project that contains an `.idl` file. This wizard isn't available in projects that support MFC.
1212

13-
For example, if you have an ATL project, and it has an `.idl` file in it, use the following procedure to add a property to an interface.
14-
15-
This wizard differs from the **Add Property** wizard and **Add IDL MFC Property** wizard. The [Add Property](adding-a-property-visual-cpp.md) wizard adds a property to your project. The **Add IDL MFC Property** wizard is specific to MFC, ActiveX, or ATL projects that support MFC.
13+
This wizard differs from the [Add Property](adding-a-property-visual-cpp.md) wizard and [Add IDL MFC Property](../mfc/reference/add-interface-definition-library-mfc-property-wizard.md) wizard in the following ways:
14+
- The **Add Property** wizard adds a property to an interface in your project.
15+
- The **Add IDL MFC Property** wizard is specific to MFC, ActiveX, or ATL projects that support MFC.
1616

1717
**To add an IDL property**
1818

@@ -23,29 +23,31 @@ This wizard differs from the **Add Property** wizard and **Add IDL MFC Property*
2323
> [!NOTE]
2424
> You can also add properties to dispinterfaces, which, unless the project is attributed, are nested within the library node.
2525
26+
1. Right-click the name of the interface.
27+
2628
1. From the shortcut menu, select **Add** > **Add Property**.
2729

2830
1. In the **Add IDL Property** wizard, provide the information to create the property.
2931

3032
1. Select **OK** to add the property.
3133

32-
The `Get` and `Put` methods of the property are displayed as two icons in **Class View**, under the interface where it's defined. You can double-click either icon to view the property declaration in the `.idl` file.
34+
The `Get` and `Put` methods of the property are displayed as two icons in **Class View** under the interface where it's defined. Double-click either icon to view the property declaration in the `.idl` file.
3335

3436
For ATL interfaces, the `Get` and `Put` functions are added to the `.cpp` and `.h` files.
3537

3638
## Add an IDL property wizard
3739

3840
The following section describes the UI that you'll use to add an IDL property:
3941

40-
:::image type="content" source="media/add-interface-definition-library-property-wizard.png" alt-text="Screenshot of adding IDL property to the interface.":::
42+
:::image type="content" source="media/add-interface-definition-library-property-wizard.png" alt-text="Screenshot of Add IDL Property with two parameters: [ in ] int i and [ in ] char c. Return type is HRESULT. Property type is float.":::
4143

4244
- **Property name**
4345

4446
Sets the name of the property.
4547

4648
- **Property type**
4749

48-
Sets whether your property will have a getter, setter, or both.
50+
The data type of the property.
4951

5052
- **Return type**
5153

@@ -63,8 +65,8 @@ The following section describes the UI that you'll use to add an IDL property:
6365

6466
|Option|Description|
6567
|------------|-----------------|
66-
|**propput**|The [PropPut](../windows/attributes/propput.md) function returns a copy of the object. **propput** is the default and the most common way to make the property writable.|
67-
|**propputref**|The [PropPutRef](../windows/attributes/propputref.md) function returns a reference to the object, rather than returning the copy of the object itself. Consider using **propputref** option for objects, such as large structs or arrays, that may have initialization overhead.|
68+
|**`propput`**|The [`PropPut`](../windows/attributes/propput.md) function returns a copy of the object. **propput** is the default and the most common way to make the property writable.|
69+
|**`propputref`**|The [`PropPutRef`](../windows/attributes/propputref.md) function returns a reference to the object, rather than returning the copy of the object itself. Consider using **`propputref`** option for objects, such as large structs or arrays, that may have initialization overhead.|
6870

6971
- **Parameters**
7072

@@ -89,34 +91,35 @@ The following section describes the UI that you'll use to add an IDL property:
8991

9092
1. `helpcontext`
9193

92-
Specifies a context ID that lets the user view information about this property in the Help file. For more information, see [helpcontext](/windows/win32/Midl/helpcontext).
94+
Specifies a context ID that lets the user view information about this property in the Help file. For more information, see [`helpcontext`](/windows/win32/Midl/helpcontext).
9395

9496
1. `helpstring`
9597

96-
Specifies a character string that's used to describe the element to which it applies. By default, it's set to **`property`**&nbsp;*Property&nbsp;name*. For more information, see [helpstring](/windows/win32/Midl/helpstring).
98+
Specifies a character string that's used to describe the element to which it applies. By default, it's set to **`property`**&nbsp;*Property&nbsp;name*. For more information, see [`helpstring`](/windows/win32/Midl/helpstring).
9799

98100
1. `id`
99101

100-
Sets the numerical identifier that identifies the property. This option isn't available for properties of custom interfaces. For more information, see [id](/windows/win32/Midl/id).
102+
Sets the numerical identifier that identifies the property. This option isn't available for properties of custom interfaces. For more information, see [`id`](/windows/win32/Midl/id).
101103

102104
- **Additional attributes**
103105

104106
Keywords in the Microsoft Interface Definition Language (MIDL) are described in detail in the [MIDL language reference](/windows/win32/midl/midl-language-reference.md).
105107

106108
|Option|Description|
107109
|------------|-----------------|
108-
|`bindable`|Indicates that the property supports data binding. For more information, see [bindable](/windows/win32/Midl/bindable).|
110+
|`bindable`|Indicates that the property supports data binding. For more information, see [`bindable`](/windows/win32/Midl/bindable).|
109111
|`defaultbind`|Indicates that this single, bindable property best represents the object. For more information, see [defaultbind](/windows/win32/Midl/defaultbind).|
110-
|`defaultcollelem`|Indicates that the property is an accessor function for an element of the default collection. For more information, see [defaultcollelem](/windows/win32/Midl/defaultcollelem).|
111-
|`displaybind`|Indicates that this property should be displayed to the user as bindable. For more information, see [displaybind](/windows/win32/Midl/displaybind).|
112-
|`hidden`|Indicates that the property exists but shouldn't be displayed in a user-oriented browser. For more information, see [hidden](/windows/win32/Midl/hidden).|
113-
|`immediatebind`|Indicates that the database will be notified immediately of all changes to this property of a data-bound object. For more information, see [immediatebind](/windows/win32/Midl/immediatebind).|
114-
|`local`|Specifies to the MIDL compiler that the property isn't remote. For more information, see [local](/windows/win32/Midl/local).|
115-
|`nonbrowsable`|Tags an interface or dispinterface member that shouldn't be displayed in a properties browser. For more information, see [nonbrowsable](/windows/win32/Midl/nonbrowsable).|
116-
|`requestedit`|Indicates that the property supports the `OnRequestEdit` notification. For more information, see [requestedit](/windows/win32/Midl/requestedit).|
117-
|`restricted`|Specifies that the property can't be called arbitrarily. For more information, see [restricted](/windows/win32/Midl/restricted).|
118-
|`source`|Indicates that a member of the property is a source of events. For more information, see [source](/windows/win32/Midl/source).|
112+
|`defaultcollelem`|Indicates that the property is an accessor function for an element of the default collection. For more information, see [`defaultcollelem`](/windows/win32/Midl/defaultcollelem).|
113+
|`displaybind`|Indicates that this property should be displayed to the user as bindable. For more information, see [`displaybind`](/windows/win32/Midl/displaybind).|
114+
|`hidden`|Indicates that the property exists but shouldn't be displayed in a user-oriented browser. For more information, see [`hidden`](/windows/win32/Midl/hidden).|
115+
|`immediatebind`|Indicates that the database will be notified immediately of all changes to this property of a data-bound object. For more information, see [`immediatebind`](/windows/win32/Midl/immediatebind).|
116+
|`local`|Specifies to the MIDL compiler that the property isn't remote. For more information, see [`local`](/windows/win32/Midl/local).|
117+
|`nonbrowsable`|Tags an interface or dispinterface member that shouldn't be displayed in a properties browser. For more information, see [`nonbrowsable`](/windows/win32/Midl/nonbrowsable).|
118+
|`requestedit`|Indicates that the property supports the `OnRequestEdit` notification. For more information, see [`requestedit`](/windows/win32/Midl/requestedit).|
119+
|`restricted`|Specifies that the property can't be called arbitrarily. For more information, see [`restricted`](/windows/win32/Midl/restricted).|
120+
|`source`|Indicates that a member of the property is a source of events. For more information, see [`source`](/windows/win32/Midl/source).|
119121

120122
## **See also**
121123

122-
[Add Property](adding-a-property-visual-cpp.md)
124+
[Add Property](adding-a-property-visual-cpp.md)\
125+
[Add IDL MFC Property](../mfc/reference/add-interface-definition-library-mfc-property-wizard.md)

docs/ide/adding-a-property-visual-cpp.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
22
description: "Learn more about: Add a property to an interface in a Microsoft Visual Studio C++ project"
33
title: "Add a property"
4-
ms.date: 04/11/2022
4+
ms.date: 04/12/2022
55
f1_keywords: ["vc.codewiz.prop.overview"]
66
helpviewer_keywords: ["interfaces, adding properties", "properties [C++], adding to interfaces", "names, add property wizard", "add property wizard", "stock properties, about stock properties", "stock properties"]
77
ms.custom: devdivchpfy22
88
---
99

1010
# Add a property
1111

12-
Use the [Add Property wizard](#add-property-wizard) to add a method to an interface in your project.
12+
Use the [Add Property wizard](#add-property-wizard) to add a property to an interface in your project.
1313

1414
**To add a property to your interface:**
1515

16-
1. From the Visual Studio main menu, select **View** > **Class view**. In the [Class View](/visualstudio/ide/viewing-the-structure-of-code) pane, expand the project node to display the interface you want to add the method to.
16+
1. From the Visual Studio main menu, select **View** > **Class view**. In the [Class View](/visualstudio/ide/viewing-the-structure-of-code) pane, expand the project node to display the interface you want to add the property to.
1717

1818
> [!NOTE]
1919
> You can also add properties to dispinterfaces, which, unless the project is attributed, are nested within the library node.
@@ -50,4 +50,10 @@ The following section describes the UI that you'll use to add a property:
5050

5151
Select to add a property setter. By default, the name of the `Set` function is `Set`*PropertyName*. You can edit this name. If you delete the name, the function [`SetNotSupported`](../mfc/reference/colecontrol-class.md#setnotsupported) is inserted into the interface dispatch map. The `Set`*PropertyName* function specifies that the property is writable.
5252

53-
For ATL interfaces **Put function** makes the property writable; that is, it creates the `Put` method for setting, or "putting," this property of the object. Select **Get**, **Put**, or both.
53+
For ATL interfaces **Put function** makes the property writable; that is, it creates the `Put` method for setting, or "putting," this property of the object. Select **Get**, **Put**, or both.
54+
55+
## See Also
56+
57+
[Add IDL Property](add-interface-definition-library-property-wizard.md)
58+
59+
[Add IDL MFC Property](../mfc/reference/add-interface-definition-library-mfc-property-wizard.md)
Loading

0 commit comments

Comments
 (0)