Skip to content

Commit 1416eb9

Browse files
committed
Update after review
1 parent 91f79c8 commit 1416eb9

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

docs/mfc/reference/add-idl-mfc-method-wizard.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ The **Add IDL MFC Method** wizard adds a method to an interface defined in an In
1313

1414
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.
1515

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:
1717

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.
1919

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.
2121
```cpp
2222
BEGIN_DISPATCH_MAP(CMFCApplication2Doc, CDocument)
2323
DISP_FUNCTION_ID(CMFCApplication2Doc, "name", dispidname, name, VT_EMPTY, VTS_NONE)
2424
DISP_FUNCTION_ID(CMFCApplication2Doc, "nombre", dispidnombre, nombrenom, VT_EMPTY, VTS_NONE)
2525
END_DISPATCH_MAP()
2626
```
27-
- Generates the following associated method implementations:
27+
- It generates the following associated method implementations:
2828
```cpp
2929
void CMFCApplication2Doc::name()
3030
{
@@ -39,6 +39,7 @@ void CMFCApplication2Doc::nombrenom()
3939
// TODO: Add your dispatch handler code here
4040
}
4141
```
42+
For ATL projects that don't support MFC, this wizard isn't available.
4243

4344
## Add a method to your interface
4445

@@ -72,7 +73,9 @@ The following section describes the UI that you'll use to add a method:
7273

7374
- **Internal name**
7475

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.
7679

7780
|Interface type|Description|
7881
|--------------------|-----------------|
@@ -84,6 +87,8 @@ The following section describes the UI that you'll use to add a method:
8487

8588
The data type returned by the method. The standard way to return error codes from methods defined in an interface is with a `HRESULT`.
8689

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+
8792
|Interface type|Description|
8893
|--------------------|-----------------|
8994
|Dual interface|`HRESULT`. Unchangeable.|
@@ -101,15 +106,15 @@ The following section describes the UI that you'll use to add a method:
101106
|Method type|Description|
102107
|-----------------|-----------------|
103108
|**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|
105110

106111
- **Parameter type**
107112

108113
Sets the data type of the parameter. You can type it or select the type from the list.
109114

110115
- **Parameter name**
111116

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.
113118

114119
> [!NOTE]
115120
> 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:
118123

119124
Adds the parameter to the list of **parameters**. Specify the parameter name in **Parameter name**, and its type and parameter attributes in **Parameters**.
120125

126+
If you don't provide a parameter name, the wizard ignores any parameter attributes (ATL only) or **Parameter type** selections.
127+
121128
- **x**
122129

123130
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:
140147

141148
- `helpstring`
142149

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*.
144151

145152
## See also
146153

0 commit comments

Comments
 (0)