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/mfc/reference/add-idl-mfc-method-wizard.md
+15-8Lines changed: 15 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -13,18 +13,18 @@ The **Add IDL MFC Method** wizard adds a method to an interface defined in an In
13
13
14
14
If the ATL project doesn't support MFC, only the wizard that adds a method to an IDL interface is available. For example, if you have a Microsoft ActiveX control project, and you open the IDL library, using following procedure you can add the method to interface. If the project contains a class associated with the interface, the wizard will add the method to the class, too.
15
15
16
-
This wizard differs from the **Add Method** wizard. The [Add method](../../ide/adding-a-method-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. For ATL projects that don't support MFC, only the **Add Method** wizard is available.
16
+
This wizard differs from the [Add Method](../../ide/adding-a-method-visual-cpp.md)wizard (which adds a method to an IDL interface) in the following ways:
17
17
18
-
Whereas the **Add IDL MFC Method** wizard adds a method to an IDL interface, this wizard also:
18
+
- It's specific to MFC, ActiveX, or ATL projects that support MFC. For ATL projects that don't support MFC, only the **Add Method**wizard is available.
19
19
20
-
-Adds the following entries if a Dispatch map is found in the project.
20
+
-It adds the following entries if a Dispatch map is found in the project.
For ATL projects that don't support MFC, this wizard isn't available.
42
43
43
44
## Add a method to your interface
44
45
@@ -72,7 +73,9 @@ The following section describes the UI that you'll use to add a method:
72
73
73
74
-**Internal name**
74
75
75
-
Only available for 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.
76
+
Only available for custom methods (if **Method type** is selected as custom) added to an MFC dispinterface. The name that will be used in the dispatch map, the header (.h) file, and the implementation (.cpp) file. By default, this name is the same as **Method name**.
77
+
78
+
You can change the method name according to the following table if you are adding the method to an MFC dispinterface or MFC ActiveX control dispinterface.
76
79
77
80
|Interface type|Description|
78
81
|--------------------|-----------------|
@@ -84,6 +87,8 @@ The following section describes the UI that you'll use to add a method:
84
87
85
88
The data type returned by the method. The standard way to return error codes from methods defined in an interface is with a `HRESULT`.
86
89
90
+
If the interface type is dual interface or custom interface, only `HRESULT` return type is allowed. You can set the data type according to the interface type, as defined in the following table:
91
+
87
92
|Interface type|Description|
88
93
|--------------------|-----------------|
89
94
|Dual interface|`HRESULT`. Unchangeable.|
@@ -101,15 +106,15 @@ The following section describes the UI that you'll use to add a method:
101
106
|Method type|Description|
102
107
|-----------------|-----------------|
103
108
|**Stock**|The default. Inserts the default implementation of the method you select in the **Method name** list. **Return type** is unchangeable if you select **Stock**.|
104
-
|**Custom**|Inserts a default 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.|
109
+
|**Custom**|You provide a custom implementation for the method selected in **Method name**. You can provide your own return type, or select one from the **Return type** list|
105
110
106
111
-**Parameter type**
107
112
108
113
Sets the data type of the parameter. You can type it or select the type from the list.
109
114
110
115
-**Parameter name**
111
116
112
-
Sets the name of a parameter. Select **+** to add the parameter to the **parameters** list. If you don't provide a parameter name, the wizard ignores any parameter attributes (ATL only) or **Parameter type** selections.
117
+
Sets the name of a parameter. Select **+** to add the parameter to the **parameters** list.
113
118
114
119
> [!NOTE]
115
120
> 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 in the code and insert the parameter manually.
@@ -118,6 +123,8 @@ The following section describes the UI that you'll use to add a method:
118
123
119
124
Adds the parameter to the list of **parameters**. Specify the parameter name in **Parameter name**, and its type and parameter attributes in **Parameters**.
120
125
126
+
If you don't provide a parameter name, the wizard ignores any parameter attributes (ATL only) or **Parameter type** selections.
127
+
121
128
-**x**
122
129
123
130
Removes the selected parameter from the **Parameters** list.
@@ -140,7 +147,7 @@ The following section describes the UI that you'll use to add a method:
140
147
141
148
-`helpstring`
142
149
143
-
Specifies a text that describes the associated element. By default it's*Method name*. For more information, see [helpstring](/windows/win32/Midl/helpstring) in the *MIDL Reference*.
150
+
Specifies a text that describes the associated element. By default its*Method name*. For more information, see [helpstring](/windows/win32/Midl/helpstring) in the *MIDL Reference*.
0 commit comments