Skip to content

Commit e933bed

Browse files
TaojunshenSteve Wishnouskyrachana-sataoopbld15Colin Robertson
authored
4/13/2022 AM Publish (MicrosoftDocs#4218)
* Update open-wopen.md Clarify that _O_TEMPORARY sets FILE_SHARE_DELETE. * Update other pages that mention _O_TEMPORARY effects. * New article - IDL method wizard * update after review * update after review * Update after review * Update after review * Updating - Add property wizard for VS2022 * Updating broken links * Update after review * New article - Add an IDL Property * link updation * Update after review * update after review * update after review * Broken link fixed * Broken link fixed * Update virtual-functions.md * update for links * Updating links * Address cpp-docs 3780 3782 3790 3791 3805 * Attempt correction of table format * Add documentation for compiler error C2956 and update error text (MicrosoftDocs#4176) * Add documentation for compiler error C2956 and update error text * Add TOC entry * Update for grammar and my own comprehension. Sometimes, you just get carried away. This version could use some simplification. * Simplify. Address remarks, attempt simplification. Acrolinx all the things. * More updates per review Co-authored-by: Colin Robertson <corob@microsoft.com> * Address cpp-docs 3816 * Address non-blocking issues from 4207 * fix for sample program. * edits * edit pass. Move to ide location * minor edit * fix link * Final update * final update * final update * resolving blocking issue * resolving blocking issue * ToC update * link update * Correct inconsistent formatting for the `_O_EXCL` constant in the docs for the open functions * Update c28195.md * Update in alt-text * Update in alt-text * edit pass * edit pass * more cleanup * typo * small edit * Final update Co-authored-by: Steve Wishnousky <stwish@microsoft.com> Co-authored-by: rachana-satao <83084319+rachana-satao@users.noreply.github.com> Co-authored-by: opbld15 <opbld15@microsoft.com> Co-authored-by: Colin Robertson <corob@microsoft.com> Co-authored-by: opbld16 <opbld16@microsoft.com> Co-authored-by: opbld17 <opbld17@microsoft.com> Co-authored-by: atikmapari <31974726+atikmapari@users.noreply.github.com> Co-authored-by: PRMerger19 <prmrgr19@microsoft.com> Co-authored-by: Ming Ho <94572161+homing1@users.noreply.github.com> Co-authored-by: PRMerger5 <prmergr5@microsoft.com> Co-authored-by: Regan Downer <97987445+v-regandowner@users.noreply.github.com> Co-authored-by: Jonathan Emmett <joemmett@microsoft.com> Co-authored-by: Tamara K <93546702+tamarakhader@users.noreply.github.com> Co-authored-by: TylerMSFT <Tyler.Whitney@microsoft.com> Co-authored-by: PRMerger17 <prmrgr17@microsoft.com> Co-authored-by: Paula Miller <v-paulmi@microsoft.com> Co-authored-by: Martin Storsjö <martin@martin.st> Co-authored-by: Sunny Chatterjee <sunnych@microsoft.com> Co-authored-by: Tyler Whitney <TylerMSFT@users.noreply.github.com>
1 parent 906b874 commit e933bed

File tree

6 files changed

+122
-3
lines changed

6 files changed

+122
-3
lines changed

docs/c-runtime-library/reference/open-wopen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ The **`_open`** function opens the file specified by *`filename`* and prepares i
7373
| **`_O_CREAT`** | Creates a file and opens it for writing. Has no effect if the file specified by *filename* exists. The *pmode* argument is required when **`_O_CREAT`** is specified. |
7474
| **`_O_CREAT`** &#124; **`_O_SHORT_LIVED`** | Creates a file as temporary and if possible does not flush to disk. The *pmode* argument is required when **`_O_CREAT`** is specified. |
7575
| **`_O_CREAT`** &#124; **`_O_TEMPORARY`** | Creates a file as temporary; the file is deleted when the last file descriptor is closed. The *pmode* argument is required when **`_O_CREAT`** is specified. To preserve legacy behavior for app-compatibility, other processes are not prevented from deleting this file. |
76-
| **`_O_CREAT`** &#124; `_O_EXCL` | Returns an error value if a file specified by *filename* exists. Applies only when used with **`_O_CREAT`**. |
76+
| **`_O_CREAT`** &#124; **`_O_EXCL`** | Returns an error value if a file specified by *filename* exists. Applies only when used with **`_O_CREAT`**. |
7777
| **`_O_NOINHERIT`** | Prevents creation of a shared file descriptor. |
7878
| **`_O_RANDOM`** | Specifies that caching is optimized for, but not restricted to, random access from disk. |
7979
| **`_O_RDONLY`** | Opens a file for reading only. Cannot be specified with **`_O_RDWR`** or **`_O_WRONLY`**. |

docs/c-runtime-library/reference/sopen-s-wsopen-s.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ The integer expression *oflag* is formed by combining one or more manifest const
8989
| **`_O_CREAT`** | Creates a file and opens it for writing. Has no effect if the file specified by *`filename`* exists. The *`pmode`* argument is required when **`_O_CREAT`** is specified. |
9090
| **`_O_CREAT`** &#124; **`_O_SHORT_LIVED`** | Creates a file as temporary and if possible does not flush to disk. The *`pmode`* argument is required when **`_O_CREAT`** is specified. |
9191
| **`_O_CREAT`** &#124; **`_O_TEMPORARY`** | Creates a file as temporary; the file is deleted when the last file descriptor is closed. The *`pmode`* argument is required when **`_O_CREAT`** is specified. To preserve legacy behavior for app-compatibility, other processes are not prevented from deleting this file. |
92-
| **`_O_CREAT`** &#124; `_O_EXCL` | Returns an error value if a file specified by *`filename`* exists. Applies only when used with **`_O_CREAT`**. |
92+
| **`_O_CREAT`** &#124; **`_O_EXCL`** | Returns an error value if a file specified by *`filename`* exists. Applies only when used with **`_O_CREAT`**. |
9393
| **`_O_NOINHERIT`** | Prevents creation of a shared file descriptor. |
9494
| **`_O_RANDOM`** | Specifies that caching is optimized for, but not restricted to, random access from disk. |
9595
| **`_O_RDONLY`** | Opens a file for reading only. Cannot be specified with **`_O_RDWR`** or **`_O_WRONLY`**. |

docs/c-runtime-library/reference/sopen-wsopen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The integer expression *oflag* is formed by combining one or more of the followi
8282
| **_O_CREAT** | Creates a file and opens it for writing. Has no effect if the file specified by *filename* exists. The *pmode* argument is required when **_O_CREAT** is specified. |
8383
| **_O_CREAT** &#124; **_O_SHORT_LIVED** | Creates a file as temporary and if possible does not flush to disk. The *pmode* argument is required when **_O_CREAT** is specified. |
8484
| **_O_CREAT** &#124; **_O_TEMPORARY** | Creates a file as temporary; the file is deleted when the last file descriptor is closed. The *pmode* argument is required when **_O_CREAT** is specified. To preserve legacy behavior for app-compatibility, other processes are not prevented from deleting this file. |
85-
| **_O_CREAT** &#124; `_O_EXCL` | Returns an error value if a file specified by *filename* exists. Applies only when used with **_O_CREAT**. |
85+
| **_O_CREAT** &#124; **`_O_EXCL`** | Returns an error value if a file specified by *filename* exists. Applies only when used with **_O_CREAT**. |
8686
| **_O_NOINHERIT** | Prevents creation of a shared file descriptor. |
8787
| **_O_RANDOM** | Specifies that caching is optimized for, but not restricted to, random access from disk. |
8888
| **_O_RDONLY** | Opens a file for reading only. Cannot be specified with **_O_RDWR** or **_O_WRONLY**. |
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
description: "Learn more about: Use a Microsoft Visual Studio wizard to add a method to an interface definition language (IDL) interface in your project"
3+
title: "Add an IDL method"
4+
ms.date: "04/13/2022"
5+
f1_keywords: ["vc.codewiz.method.overview", "vc.codewiz.method.idlattrib"]
6+
helpviewer_keywords: ["add IDL method wizard [C++]", "IDL methods [C++], adding", "methods [C++], adding using wizards", "IDL attributes, add an IDL method wizard"]
7+
ms.custom: devdivchpfy22
8+
---
9+
10+
# Add an IDL method
11+
12+
The **Add IDL Method** wizard adds a method to an Interface Definition Library (IDL) interface, such as in an ATL project that contains an IDL file. This wizard isn't available in projects that support MFC.
13+
14+
This wizard differs from the [**Add method**](adding-a-method-visual-cpp.md) wizard and the [**Add IDL MFC method**](../mfc/reference/add-idl-mfc-method-wizard.md) wizard in the following ways:
15+
16+
- The **Add method** wizard adds a method to an interface in your project and can update the class associated with the interface.
17+
- The **Add IDL MFC method** wizard is specific to MFC, ActiveX, or ATL projects that support MFC.
18+
19+
## Add a method to your IDL interface
20+
21+
1. On the **View** menu, select **Class View**.
22+
23+
1. In the **Class View** pane, expand the project node to display the IDL interface (`.idl`file) to which you want to add the method.
24+
25+
1. Right-click the name of the interface.
26+
27+
1. On the shortcut menu, select **Add** > **Add Method**.
28+
29+
1. In the **Add IDL Method** wizard, provide the information to create the method.
30+
31+
1. Select **OK** to add the method.
32+
33+
### User Interface element list
34+
35+
The following section describes the wizard interface that you'll use to add a method:
36+
37+
:::image type="content" source= "media/add-interface-definition-library-method-wizard.png" alt-text="Screenshot of adding a method using the wizard. Shows two parameters: [ in ] int i and [ in ] float f. Return type is HRESULT. Infer in out parameter values from type is selected.":::
38+
39+
- **Method name**
40+
41+
Provide a name for the method.
42+
43+
- **Return type**
44+
45+
The data type returned by the method. The standard way to return error codes from methods defined in an interface is with a `HRESULT`.
46+
47+
The following table describes the different kinds of interfaces that you can add a method to, and the allowed return type. For dual and custom interfaces, the return type must be `HRESULT` and the wizard won't allow you to change it.
48+
49+
|Interface kind|Return type|
50+
|--------------------|-----------------|
51+
|[Dual interface](/windows/win32/winauto/dual-interfaces--iaccessible-and-idispatch)|`HRESULT`. Unchangeable.|
52+
|[Custom interface](/windows/win32/winauto/custom-user-interface-elements)|`HRESULT`. Unchangeable.|
53+
|Local custom interface|Provide your own return type or select it from the drop-down list.|
54+
|[Dispinterface](/windows/win32/midl/dispinterface)|Provide your own return type or select it from the drop-down list.|
55+
56+
- **Parameters**
57+
58+
Displays the method's parameters, modifiers, and types.
59+
60+
- **+**
61+
62+
Add a parameter. In **Parameters**, type the parameter type, name, and any modifiers. For example, `[in] int i`, and choose **OK**.
63+
64+
- **x**
65+
66+
Removes the selected parameter from the **Parameters** list.
67+
68+
- **Infer in/out parameters values from types**
69+
70+
Inserts the `[in]` or `[out]` attribute based on the parameter's type.
71+
72+
- **Set the last parameter as the return value (retval)**
73+
74+
The last parameter will be treated as the method's return value.
75+
76+
- **Attributes**
77+
78+
The following attributes are also described in the [MIDL Reference](/windows/win32/midl/midl-language-reference.md).
79+
80+
- `id`
81+
82+
Sets the numeric ID that identifies the method. For more information, see [`id`](/windows/win32/Midl/id).
83+
84+
- `call_as`
85+
86+
Specifies the name of the remote method to map to this local method. For more information, see [`call_as`](/windows/win32/Midl/call-as).
87+
88+
- `helpcontext`
89+
90+
Specifies a context ID that lets the user view information about this method in the Help file. For more information, see [`helpcontext`](/windows/win32/Midl/helpcontext).
91+
92+
- `helpstring`
93+
94+
Specifies the character string used to describe the element to which it applies. For more information, see [`helpstring`](/windows/win32/Midl/helpstring).
95+
96+
- **Additional attributes**
97+
98+
- `hidden`
99+
100+
Indicates that the item exists but shouldn't be displayed in a user-oriented browser. For more information, see [`hidden`](/windows/win32/Midl/hidden).
101+
102+
- `local`
103+
104+
Specifies that an interface or function isn't remote. For more information, see [`local`](/windows/win32/Midl/local).
105+
106+
- `restricted`
107+
108+
Specifies that a library, or member of a module, interface, or dispinterface can't be called arbitrarily. For more information, see [`restricted`](/windows/win32/Midl/restricted).
109+
110+
- `source`
111+
112+
Indicates that a member of a [`coclass`](/windows/win32/Midl/coclass), property, or method is a source of events. For a member of a `coclass`, this attribute means that the member is called rather than implemented. For more information, see [`source`](/windows/win32/Midl/source).
113+
114+
## See also
115+
116+
[Add a method wizard](adding-a-method-visual-cpp.md)\
117+
[Add an IDL MFC method wizard](../mfc/reference/add-idl-mfc-method-wizard.md)
Loading

docs/ide/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ items:
7878
href: ../ide/adding-a-member-variable-visual-cpp.md
7979
- name: Add a method
8080
href: ../ide/adding-a-method-visual-cpp.md
81+
- name: Add an IDL method
82+
href: ../ide/add-interface-definition-library-method-wizard.md
8183
- name: Add a property
8284
href: ../ide/adding-a-property-visual-cpp.md
8385
- name: Add an IDL property

0 commit comments

Comments
 (0)