Skip to content

Commit 63df575

Browse files
TylerMSFTTylerMSFT
authored andcommitted
edit pass. Move to ide location
1 parent 8716fee commit 63df575

File tree

3 files changed

+37
-33
lines changed

3 files changed

+37
-33
lines changed
Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
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/07/2022"
4+
ms.date: 04/08/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"]
7-
ms.assetid: 37bd4db7-efd3-4faa-87ad-64902ed16a36
87
ms.custom: devdivchpfy22
98
---
109
# Add an IDL property
1110

12-
The **Add IDL Property** wizard adds a method to an interface defined in an Interface Definition Library (IDL) in a project that has IDL file. To use the **Add IDL Property** wizard, you must be in a project that doesn't support MFC.
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, you're project can't support MFC.
1312

14-
For example, if you have an ATL project, and it has an IDL file, using the following procedure you can add the method to interface.
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.
1514

16-
This wizard differs from the **Add Property** wizard and **Add IDL MFC Property** wizard. The [Add Property](../../ide/adding-a-property-visual-cpp.md) wizard adds a default method to your project. The Add IDL MFC Method wizard is specific to MFC, ActiveX, or ATL projects that support MFC.
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.
1716

18-
**To add an IDL property to your object**
17+
**To add an IDL property**
1918

2019
1. On the **View** menu, select **Class View**.
2120

@@ -28,50 +27,51 @@ This wizard differs from the **Add Property** wizard and **Add IDL MFC Property*
2827

2928
1. In the **Add IDL Property** wizard, provide the information to create the property.
3029

31-
1. Specify any IDL settings for the property.
32-
3330
1. Select **OK** to add the property.
3431

35-
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.
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.
3633

37-
For ATL interfaces, the `Get` and `Put` functions are added to the .cpp file, and references to these functions are added to the .h file.
34+
For ATL interfaces, the `Get` and `Put` functions are added to the `.cpp` and `.h` files.
3835

3936
## Add an IDL property wizard
4037

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

43-
:::image type="content" source="../reference/media/add-idl-property-wizard.png" alt-text="Adding IDL property to the interface":::
40+
:::image type="content" source="media/add-idl-property-wizard.png" alt-text="Adding IDL property to the interface":::
4441

4542
- **Property name**
4643

4744
Sets the name of the property.
4845

4946
- **Property type**
5047

51-
Sets the type of property you're adding.
48+
Sets whether your property will have a getter, setter, or both.
5249

5350
- **Return type**
5451

55-
For ATL interfaces, sets the return type for the property. For dual interfaces, `HRESULT` is always the return type, and select option is unavailable. For custom interfaces, you can select a return type from the list. `HRESULT` is still recommended, as it provides a standard way to return errors.
52+
For ATL interfaces, sets the return type for the property.
53+
For dual interfaces, `HRESULT` is always the return type, and select option is unavailable.
54+
For custom interfaces, you can select a return type from the list. `HRESULT` is still recommended, as it provides a standard way to return errors.
5655

5756
- **Get function**
5857

59-
For ATL interfaces, sets the property as readable. It creates the `Get` method for retrieving property from the object. Select **Get**, **Put**, or both.
58+
For ATL interfaces, creates the `Get` method for retrieving the property value. Select **Get**, **Put**, or both.
6059

6160
- **Put function**
6261

63-
For ATL interfaces, sets the property writable. It creates the `Put` method for setting, or "putting," property of the object. Select **Get**, **Put**, or both. If you select **Put function** option, you can choose from the following two ways to implement the method:
62+
For ATL interfaces, creates the `Put` method for setting the property value. Select **Get**, **Put**, or both. If you select **Put function**, you can choose from the following two ways to implement the method:
6463

6564
|Option|Description|
6665
|------------|-----------------|
67-
|**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.|
68-
|**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.|
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.|
6968

7069
- **Parameters**
7170

7271
Displays the list of parameters added to the property. Each item in the list consists of the parameter name, parameter type, and attributes.
7372

74-
The `in` indicates that the parameter is passed from the calling procedure to the called procedure. The `out` indicates that the pointer parameter is returned from the called procedure to the calling procedure (from the server to the client).
73+
`in` indicates that the parameter is passed from the calling procedure to the called procedure.
74+
`out` indicates that the pointer parameter is returned from the called procedure to the calling procedure (from the server to the client).
7575

7676
- **+**
7777

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

9090
1. `helpcontext`
9191

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) in the [MIDL Reference](/windows/win32/midl/midl-language-reference.md).
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).
9393

9494
1. `helpstring`
9595

96-
Specifies a character string that's used to describe the element to which it applies. By default, it's set to **`property`** *Property name*. For more information, see [helpstring](/windows/win32/Midl/helpstring) in the [MIDL Reference](/windows/win32/midl/midl-language-reference.md).
96+
Specifies a character string that's used to describe the element to which it applies. By default, it's set to **`property`** *Property name*. For more information, see [helpstring](/windows/win32/Midl/helpstring).
9797

9898
1. `id`
9999

100-
Sets the numerical ID that identifies the property. This option isn't available for properties of custom interfaces. For more information, see [id](/windows/win32/Midl/id) in the [MIDL Reference](/windows/win32/midl/midl-language-reference.md).
100+
Sets the numerical ID that identifies the property. This option isn't available for properties of custom interfaces. For more information, see [id](/windows/win32/Midl/id).
101101

102102
- **Additional attributes**
103103

104+
Keywords in the Microsoft Interface Definition Language (MIDL) are described in detail in the [MIDL language reference](/windows/win32/midl/midl-language-reference.md).
105+
104106
|Option|Description|
105107
|------------|-----------------|
106-
|`bindable`|Indicates that the property supports data binding. For more information, see [bindable](/windows/win32/Midl/bindable) in the [MIDL Reference](/windows/win32/midl/midl-language-reference.md).|
107-
|`defaultbind`|Indicates that this single, bindable property best represents the object. For more information, see [defaultbind](/windows/win32/Midl/defaultbind) in the [MIDL Reference](/windows/win32/midl/midl-language-reference.md).|
108-
|`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) in the [MIDL Reference](/windows/win32/midl/midl-language-reference.md).|
109-
|`displaybind`|Indicates that this property should be displayed to the user as bindable. For more information, see [displaybind](/windows/win32/Midl/displaybind) in the [MIDL Reference](/windows/win32/midl/midl-language-reference.md).|
110-
|`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) in the [MIDL Reference](/windows/win32/midl/midl-language-reference.md).|
111-
|`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) in the [MIDL Reference](/windows/win32/midl/midl-language-reference.md).|
112-
|`local`|Specifies to the MIDL compiler that the property isn't remote. For more information, see [local](/windows/win32/Midl/local) in the [MIDL Reference](/windows/win32/midl/midl-language-reference.md).|
113-
|`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) in the [MIDL Reference](/windows/win32/midl/midl-language-reference.md).|
114-
|`requestedit`|Indicates that the property supports the `OnRequestEdit` notification. For more information, see [requestedit](/windows/win32/Midl/requestedit) in the [MIDL Reference](/windows/win32/midl/midl-language-reference.md).|
115-
|`restricted`|Specifies that the property can't be called arbitrarily. For more information, see [restricted](/windows/win32/Midl/restricted) in the [MIDL Reference](/windows/win32/midl/midl-language-reference.md).|
116-
|`source`|Indicates that a member of the property is a source of events. For more information, see [source](/windows/win32/Midl/source) in the [MIDL Reference](/windows/win32/midl/midl-language-reference.md).|
108+
|`bindable`|Indicates that the property supports data binding. For more information, see [bindable](/windows/win32/Midl/bindable).|
109+
|`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 the 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).|
117119

118120
## **See also**
119121

120-
[Add Property](../../ide/adding-a-property-visual-cpp.md)
122+
[Add Property](adding-a-property-visual-cpp.md)

docs/ide/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ items:
8080
href: ../ide/adding-a-method-visual-cpp.md
8181
- name: Add a property
8282
href: ../ide/adding-a-property-visual-cpp.md
83+
- name: Add an IDL property
84+
href: ../ide/adding-a-property-visual-cpp.md
8385
- name: Add an event
8486
href: ../ide/adding-an-event-visual-cpp.md
8587
- name: Add an event handler

0 commit comments

Comments
 (0)