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
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.
13
12
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.
15
14
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.
17
16
18
-
**To add an IDL property to your object**
17
+
**To add an IDL property**
19
18
20
19
1. On the **View** menu, select **Class View**.
21
20
@@ -28,50 +27,51 @@ This wizard differs from the **Add Property** wizard and **Add IDL MFC Property*
28
27
29
28
1. In the **Add IDL Property** wizard, provide the information to create the property.
30
29
31
-
1. Specify any IDL settings for the property.
32
-
33
30
1. Select **OK** to add the property.
34
31
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.
36
33
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.
38
35
39
36
## Add an IDL property wizard
40
37
41
38
The following section describes the UI that you'll use to add an IDL property:
42
39
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":::
44
41
45
42
-**Property name**
46
43
47
44
Sets the name of the property.
48
45
49
46
-**Property type**
50
47
51
-
Sets the type of property you're adding.
48
+
Sets whether your property will have a getter, setter, or both.
52
49
53
50
-**Return type**
54
51
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.
56
55
57
56
-**Get function**
58
57
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.
60
59
61
60
-**Put function**
62
61
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:
64
63
65
64
|Option|Description|
66
65
|------------|-----------------|
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.|
69
68
70
69
-**Parameters**
71
70
72
71
Displays the list of parameters added to the property. Each item in the list consists of the parameter name, parameter type, and attributes.
73
72
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).
75
75
76
76
-**+**
77
77
@@ -89,32 +89,34 @@ The following section describes the UI that you'll use to add an IDL property:
89
89
90
90
1.`helpcontext`
91
91
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).
93
93
94
94
1.`helpstring`
95
95
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).
97
97
98
98
1.`id`
99
99
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).
101
101
102
102
-**Additional attributes**
103
103
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
+
104
106
|Option|Description|
105
107
|------------|-----------------|
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).|
0 commit comments