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
Copy file name to clipboardExpand all lines: docs/ide/adding-a-method-visual-cpp.md
+41-41Lines changed: 41 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,9 @@ You can use the [add method wizard](#add-method-wizard) to add a method to an in
24
24
25
25
1. In the Add Method Wizard, provide the information to create the method.
26
26
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.
28
28
29
-
1. Select **Finish** to add the method.
29
+
1. Select **OK** to add the method.
30
30
31
31
## In this section
32
32
@@ -39,18 +39,6 @@ Use this wizard to add a method to an interface. Depending on the project type o
39
39
40
40
### Names
41
41
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
-
54
42
-**Method name**
55
43
56
44
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
61
49
|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.|
62
50
|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).|
63
51
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
-
75
52
-**Internal name**
76
53
77
54
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
82
59
|MFC dispinterface|Set to the method name by default. You can edit the internal name.|
83
60
|MFC ActiveX control dispinterface|You can set the internal name only for custom methods. Stock methods don't use an internal name.|
84
61
85
-
-**Parameter attributes**
62
+
-**Return type**
86
63
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.
|**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.|
94
84
95
85
-**Parameter type**
96
86
97
87
Sets the data type of the parameter. Select the type from the list.
98
88
99
89
-**Parameter name**
100
90
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.
102
92
103
-
Once you select **Add**, the parameter name appears in **Parameter list**.
93
+
Once you select **`+`**, the parameter name appears in **Parameters**.
104
94
105
95
> [!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.
107
101
108
-
-**Add**
102
+
-**`x`**
109
103
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.
111
105
112
-
-**Remove**
106
+
-**Parameters**
113
107
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.
115
109
116
-
-**Parameter list**
110
+
-**Parameter attributes**
111
+
112
+
Sets any other attributes for the parameter specified in **Parameter name**.
117
113
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.
|**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`|
0 commit comments