Skip to content

Commit a6e354e

Browse files
committed
Update for VS 2022
1 parent 29673d3 commit a6e354e

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

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

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ You can use the [add method wizard](#add-method-wizard) to add a method to an in
2424

2525
1. In the Add Method Wizard, provide the information to create the method.
2626

27-
1. Specify any interface definition language settings for this method in the [IDL attributes](#idl-attributes-add-method-wizard) page of the wizard.
27+
1. Specify any interface definition language settings for the method in the [IDL attributes](#idl-attributes-add-method-wizard) page of the wizard.
2828

29-
1. Select **Finish** to add the method.
29+
1. Select **OK** to add the method.
3030

3131
## In this section
3232

@@ -39,18 +39,6 @@ Use this wizard to add a method to an interface. Depending on the project type o
3939

4040
### Names
4141

42-
- **Return type**
43-
44-
The data type returned by the method. `HRESULT` is recommended for all interface types, because it provides a standard way to return errors.
45-
46-
|Interface type|Description|
47-
|--------------------|-----------------|
48-
|Dual interface|`HRESULT`. Unchangeable.|
49-
|Custom interface|`HRESULT`. Unchangeable.|
50-
|Local custom interface|Provide your own return type or select from the list.|
51-
|Dispinterface|Provide your own return type or select from the list.|
52-
|MFC ActiveX control dispinterface|If you implement a stock method, the return type is set to the appropriate value and is unchangeable. If you select a method from the **Method name** list and select **Custom** under **Select method type**, select a return type from the list.|
53-
5442
- **Method name**
5543

5644
Sets the name for the method.
@@ -61,17 +49,6 @@ Use this wizard to add a method to an interface. Depending on the project type o
6149
|MFC dispinterface|Provide your own method name or select a suggested method name from the list. If you select a name from the list, the appropriate value appears in the **Return type** box, and it's unchangeable.|
6250
|MFC ActiveX control dispinterface|Provide your own or select either of the stock methods [DoClick](../mfc/reference/colecontrol-class.md#doclick) and [Refresh](../mfc/reference/colecontrol-class.md#refresh). For more information, see [MFC ActiveX controls: Adding stock methods](../mfc/mfc-activex-controls-adding-stock-methods.md).|
6351

64-
- **Method type**
65-
66-
Available only for MFC ActiveX controls. If you provide a method name in the **Method name** box, rather than selecting a method from the list, this box is unavailable.
67-
68-
If you select one of the methods in the **Method name** list, select either the stock implementation or a custom implementation.
69-
70-
|Method type|Description|
71-
|-----------------|-----------------|
72-
|**Stock**|The default. Inserts the stock implementation of the method you select in the **Method name** list. **Return type** is unchangeable if you select **Stock**.|
73-
|**Custom**|Inserts a stub implementation of the method selected in the **Method name** list. For custom method types, you can provide your own return type, or you can select one from the **Return type** list.|
74-
7552
- **Internal name**
7653

7754
Available for only custom methods added to an MFC dispinterface. Sets the name used in the dispatch map, the header (.h) file, and the implementation (.cpp) file. By default, this name is the same as **Method name**. You can change the method name, if you're working with an MFC dispinterface or if you're adding a custom method to an MFC ActiveX control dispinterface.
@@ -82,40 +59,63 @@ Use this wizard to add a method to an interface. Depending on the project type o
8259
|MFC dispinterface|Set to the method name by default. You can edit the internal name.|
8360
|MFC ActiveX control dispinterface|You can set the internal name only for custom methods. Stock methods don't use an internal name.|
8461

85-
- **Parameter attributes**
62+
- **Return type**
8663

87-
Sets any additional attributes for the parameter specified in **Parameter name**.
64+
The data type returned by the method. `HRESULT` is recommended for all interface types, because it provides a standard way to return errors.
8865

89-
|Parameter attribute|Description|Allowed combinations|
90-
|-------------------------|-----------------|--------------------------|
91-
|**In**|Indicates that the parameter is passed from the calling procedure to the called procedure.|`in` only<br /><br /> `in` and `out`|
92-
|**Out**|Indicates that the pointer parameter is returned from the called procedure to the calling procedure (from the server to the client).|`out` only<br /><br /> `in` and `out`<br /><br /> `out` and `retval`|
93-
|**Retval**|Indicates that the parameter receives the return value of the member.|`retval` and `out`|
66+
|Interface type|Description|
67+
|--------------------|-----------------|
68+
|Dual interface|`HRESULT`. Unchangeable.|
69+
|Custom interface|`HRESULT`. Unchangeable.|
70+
|Local custom interface|Provide your own return type or select from the list.|
71+
|Dispinterface|Provide your own return type or select from the list.|
72+
|MFC ActiveX control dispinterface|If you implement a stock method, the return type is set to the appropriate value and is unchangeable. If you select a method from the **Method name** list and select **Custom** under **Select method type**, select a return type from the list.|
73+
74+
- **Method type**
75+
76+
Available only for MFC ActiveX controls. If you provide a method name in the **Method name** box, rather than selecting a method from the list, this box is unavailable.
77+
78+
If you select one of the methods in the **Method name** list, select either the stock implementation or a custom implementation.
79+
80+
|Method type|Description|
81+
|-----------------|-----------------|
82+
|**Stock**|The default. Inserts the stock implementation of the method you select in the **Method name** list. **Return type** is unchangeable if you select **Stock**.|
83+
|**Custom**|Inserts a stub implementation of the method selected in the **Method name** list. For custom method types, you can provide your own return type, or you can select one from the **Return type** list.|
9484

9585
- **Parameter type**
9686

9787
Sets the data type of the parameter. Select the type from the list.
9888

9989
- **Parameter name**
10090

101-
Sets the name of a parameter to pass through your method. After you type the name, select **Add** to add it to the list of parameters that will pass through your method. If you don't provide a parameter name, the wizard ignores any parameter attributes (ATL only) or **Parameter type** selections.
91+
Sets the name of a parameter to pass through your method. After you type the name, select **`+`** to add it to the list of parameters that will pass through your method. If you don't provide a parameter name, the wizard ignores any parameter attributes (ATL only) or **Parameter type** selections.
10292

103-
Once you select **Add**, the parameter name appears in **Parameter list**.
93+
Once you select **`+`**, the parameter name appears in **Parameters**.
10494

10595
> [!NOTE]
106-
> If you supply a parameter name and then select **Finish** before you select **Add**, the parameter isn't added to the method. You must find the method and insert the parameter manually.
96+
> If you supply a parameter name and then select **OK** before you select **+**, the parameter isn't added to the method. You must find the method and insert the parameter manually.
97+
98+
- **`+`**
99+
100+
Adds the parameter you specify in **Parameter name**, and its type and parameter attributes, to **Parameters**. Select **`+`** to add a parameter to the list.
107101

108-
- **Add**
102+
- **`x`**
109103

110-
Adds the parameter you specify in **Parameter name**, and its type and parameter attributes, to **Parameter list**. Select **Add** to add a parameter to the list.
104+
Removes the parameter you select in **Parameters** from the list.
111105

112-
- **Remove**
106+
- **Parameters**
113107

114-
Removes the parameter you select in **Parameter list** from the list.
108+
Displays all parameters and their modifiers and types currently added for the method. As you add parameters, the wizard updates **Parameters** to display each parameter, with its modifier and type.
115109

116-
- **Parameter list**
110+
- **Parameter attributes**
111+
112+
Sets any other attributes for the parameter specified in **Parameter name**.
117113

118-
Displays all parameters and their modifiers and types currently added for the method. As you add parameters, the wizard updates **Parameter list** to display each parameter, with its modifier and type.
114+
|Parameter attribute|Description|Allowed combinations|
115+
|-------------------------|-----------------|--------------------------|
116+
|**In**|Indicates that the parameter is passed from the calling procedure to the called procedure.|`in` only<br /><br /> `in` and `out`|
117+
|**Out**|Indicates that the pointer parameter is returned from the called procedure to the calling procedure (from the server to the client).|`out` only<br /><br /> `in` and `out`<br /><br /> `out` and `retval`|
118+
|**Retval**|Indicates that the parameter receives the return value of the member.|`retval` and `out`|
119119

120120
## IDL attributes, add method wizard
121121

0 commit comments

Comments
 (0)