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/c-runtime-library/reference/freopen-s-wfreopen-s.md
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ An out parameter that will point to the reopened stream when the function return
41
41
*`fileName`*\
42
42
Path of the file to reopen.
43
43
44
-
*`mode`*\
44
+
*`mode`*\
45
45
The mode for the reopened stream.
46
46
47
47
*`oldStream`*\
@@ -57,9 +57,9 @@ For more information about error codes, see [`errno, _doserrno, _sys_errlist, an
57
57
58
58
The **`freopen_s`** function is typically used to attach the pre-opened streams associated with `stdin`, `stdout` and `stderr` to another file.
59
59
60
-
The **`freopen_s`** function closes the file currently associated with *`stream`* and reassigns *`stream`* to the file specified by *path*. **`_wfreopen_s`** is a wide-character version of **`freopen_s`**; the *path* and *`mode`* arguments to **`_wfreopen_s`** are wide-character strings. **`_wfreopen_s`** and **`freopen_s`** behave identically otherwise.
60
+
The **`freopen_s`** function closes the file currently associated with *`stream`* and reassigns *`stream`* to the file specified by *path*. **`_wfreopen_s`** is a wide-character version of **`freopen_s`**; the *path* and *`mode`* arguments to **`_wfreopen_s`** are wide-character strings. **`_wfreopen_s`** and **`freopen_s`** behave identically otherwise.
61
61
62
-
If any of *pFile*, *path*, *`mode`*, or *`stream`* are **`NULL`**, or if *path* is an empty string, these functions invoke the invalid parameter handler, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, these functions set **`errno`** to **`EINVAL`** and return **`EINVAL`**.
62
+
If any of *pFile*, *path*, *`mode`*, or *`stream`* are **`NULL`**, or if *path* is an empty string, these functions invoke the invalid parameter handler, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, these functions set **`errno`** to **`EINVAL`** and return **`EINVAL`**.
63
63
64
64
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
65
65
@@ -69,9 +69,9 @@ By default, this function's global state is scoped to the application. To change
**`freopen_s`** is typically used to redirect the pre-opened files **`stdin`**, **`stdout`**, and **`stderr`** to files specified by the user. The new file associated with *`stream`* is opened with *`mode`*, which is a character string specifying the type of access requested for the file, as follows:
72
+
**`freopen_s`** is typically used to redirect the pre-opened files **`stdin`**, **`stdout`**, and **`stderr`** to files specified by the user. The new file associated with *`stream`* is opened with *`mode`*, which is a character string specifying the type of access requested for the file, as follows:
73
73
74
-
|*`mode`*|Access|
74
+
|*`mode`*|Access|
75
75
|-|-|
76
76
|**`"r"`**| Opens for reading. If the file doesn't exist or cannot be found, the **`freopen_s`** call fails. |
77
77
|**`"w"`**| Opens an empty file for writing. If the given file exists, its contents are destroyed. |
@@ -86,16 +86,16 @@ When a file is opened with the **`"a"`** or **`"a+"`** access type, all write op
86
86
87
87
The **`"a"`** mode doesn't remove the EOF marker before appending to the file. After appending has occurred, the MS-DOS TYPE command only shows data up to the original EOF marker and not any data appended to the file. The **`"a+"`** mode does remove the EOF marker before appending to the file. After appending, the MS-DOS TYPE command shows all data in the file. The **`"a+"`** mode is required for appending to a stream file that is terminated with the CTRL+Z EOF marker.
88
88
89
-
When the **`"r+"`**, **`"w+"`**, or **`"a+"`** access type is specified, both reading and writing are allowed (the file is said to be open for "update"). However, when you switch between reading and writing, there must be an intervening [`fsetpos`](fsetpos.md), [`fseek`](fseek-fseeki64.md), or [`rewind`](rewind.md) operation. The current position can be specified for the [`fsetpos`](fsetpos.md) or [`fseek`](fseek-fseeki64.md) operation, if you want. In addition to the above values, one of the following characters may be included in the *`mode`* string to specify the translation mode for new lines.
89
+
When the **`"r+"`**, **`"w+"`**, or **`"a+"`** access type is specified, both reading and writing are allowed (the file is said to be open for "update"). However, when you switch between reading and writing, there must be an intervening [`fsetpos`](fsetpos.md), [`fseek`](fseek-fseeki64.md), or [`rewind`](rewind.md) operation. The current position can be specified for the [`fsetpos`](fsetpos.md) or [`fseek`](fseek-fseeki64.md) operation, if you want. In addition to the above values, one of the following characters may be included in the *`mode`* string to specify the translation mode for new lines.
90
90
91
-
|*`mode`* modifier|Translation mode|
91
+
|*`mode`* modifier|Translation mode|
92
92
|-|-|
93
93
|**`t`**| Open in text (translated) mode. |
94
94
|**`b`**| Open in binary (untranslated) mode; translations involving carriage-return and line feed characters are suppressed. |
95
95
96
96
In text (translated) mode, carriage return-line feed (CR-LF) combinations are translated into single line feed (LF) characters on input; LF characters are translated to CR-LF combinations on output. Also, CTRL+Z is interpreted as an end-of-file character on input. In files opened for reading or for writing and reading with **`"a+"`**, the run-time library checks for a CTRL+Z at the end of the file and removes it, if possible. This is done because using [`fseek`](fseek-fseeki64.md) and [`ftell`](ftell-ftelli64.md) to move within a file may cause [`fseek`](fseek-fseeki64.md) to behave improperly near the end of the file. Don't use the **`t`** option when you want ANSI portability because it's a Microsoft extension.
97
97
98
-
If **`t`** or **`b`** isn't given in *`mode`*, the default translation mode is defined by the global variable [`_fmode`](../../c-runtime-library/fmode.md). If **`t`** or **`b`** is prefixed to the argument, the function fails and returns **`NULL`**.
98
+
If **`t`** or **`b`** isn't given in *`mode`*, the default translation mode is defined by the global variable [`_fmode`](../../c-runtime-library/fmode.md). If **`t`** or **`b`** is prefixed to the argument, the function fails and returns **`NULL`**.
99
99
100
100
For a discussion of text and binary modes, see [Text and Binary Mode File I/O](../../c-runtime-library/text-and-binary-mode-file-i-o.md).
101
101
@@ -106,7 +106,7 @@ For a discussion of text and binary modes, see [Text and Binary Mode File I/O](.
106
106
|**`freopen_s`**|`<stdio.h>`|
107
107
|**`_wfreopen_s`**|`<stdio.h>` or `<wchar.h>`|
108
108
109
-
The console isn't supported in Universal Windows Platform (UWP) apps. The standard stream handles that are associated with the console, **`stdin`**, **`stdout`**, and **`stderr`**, must be redirected before C run-time functions can use them in UWP apps.
109
+
The console isn't supported in Universal Windows Platform (UWP) apps. The standard stream handles that are associated with the console, **`stdin`**, **`stdout`**, and **`stderr`**, must be redirected before C run-time functions can use them in UWP apps.
110
110
111
111
For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
112
112
@@ -149,10 +149,10 @@ This will go to the file 'freopen.out'
Provides a Standard Template Library iterator for objects derived from the Windows Runtime`IVectorView` interface.
12
+
Provides a Standard Template Library iterator for objects derived from the Windows Runtime`IVectorView` interface.
13
13
14
14
`ViewVectorIterator` is a proxy iterator that stores elements of type `VectorProxy<T>`. However, the proxy object is almost never visible to user code. For more information, see [Collections (C++/CX)](../cppcx/collections-c-cx.md).
Copy file name to clipboardExpand all lines: docs/cppcx/ref-classes-and-structs-c-cx.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ A ref class or ref struct has these essential features:
24
24
25
25
## Declaration
26
26
27
-
The following code fragment declares the `Person` ref class. Notice that the standard C++ `std::map` type is used in the private members, and the Windows Runtime`IMapView` interface is used in the public interface. Also notice that the "^" is appended to declarations of reference types.
27
+
The following code fragment declares the `Person` ref class. Notice that the standard C++ `std::map` type is used in the private members, and the Windows Runtime`IMapView` interface is used in the public interface. Also notice that the "^" is appended to declarations of reference types.
Copy file name to clipboardExpand all lines: docs/mfc/reference/cdbexception-class.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ This type includes SQL-prefixed codes defined by ODBC and AFX_SQL-prefixed codes
61
61
62
62
- AFX_SQL_ERROR_API_CONFORMANCE The driver for a `CDatabase::OpenEx` or `CDatabase::Open` call does not conform to required ODBC API Conformance level 1 ( SQL_OAC_LEVEL1).
63
63
64
-
- AFX_SQL_ERROR_CONNECT_FAIL Connection to the data source failed. You passed a NULL`CDatabase` pointer to your recordset constructor and the subsequent attempt to create a connection based on `GetDefaultConnect` failed.
64
+
- AFX_SQL_ERROR_CONNECT_FAIL Connection to the data source failed. You passed a NULL`CDatabase` pointer to your recordset constructor and the subsequent attempt to create a connection based on `GetDefaultConnect` failed.
65
65
66
66
- AFX_SQL_ERROR_DATA_TRUNCATED You requested more data than you have provided storage for. For information on increasing the provided data storage for `CString` or `CByteArray` data types, see the `nMaxLength` argument for [RFX_Text](record-field-exchange-functions.md#rfx_text) and [RFX_Binary](record-field-exchange-functions.md#rfx_binary) under "Macros and Globals."
Copy file name to clipboardExpand all lines: docs/parallel/concrt/creating-asynchronous-operations-in-cpp-for-windows-store-apps.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ The notion of an *action* means that the asynchronous task doesn't produce a val
63
63
64
64
The return type of `create_async` is determined by the type of its arguments. For example, if your work function doesn't return a value and doesn't report progress, `create_async` returns `IAsyncAction`. If your work function doesn't return a value and also reports progress, `create_async` returns `IAsyncActionWithProgress`. To report progress, provide a [concurrency::progress_reporter](../../parallel/concrt/reference/progress-reporter-class.md) object as the parameter to your work function. The ability to report progress enables you to report what amount of work was performed and what amount still remains (for example, as a percentage). It also enables you to report results as they become available.
65
65
66
-
The `IAsyncAction`, `IAsyncActionWithProgress<TProgress>`, `IAsyncOperation<TResult>`, and `IAsyncActionOperationWithProgress<TProgress, TProgress>` interfaces each provide a `Cancel` method that enables you to cancel the asynchronous operation. The `task` class works with cancellation tokens. When you use a cancellation token to cancel work, the runtime does not start new work that subscribes to that token. Work that is already active can monitor its cancellation token and stop when it can. This mechanism is described in greater detail in the document [Cancellation in the PPL](cancellation-in-the-ppl.md). You can connect task cancellation with the Windows Runtime`Cancel` methods in two ways. First, you can define the work function that you pass to `create_async` to take a [concurrency::cancellation_token](../../parallel/concrt/reference/cancellation-token-class.md) object. When the `Cancel` method is called, this cancellation token is canceled and the normal cancellation rules apply to the underlying `task` object that supports the `create_async` call. If you do not provide a `cancellation_token` object, the underlying `task` object defines one implicitly. Define a `cancellation_token` object when you need to cooperatively respond to cancellation in your work function. The section [Example: Controlling Execution in a Windows Runtime App with C++ and XAML](#example-app) shows an example of how to perform cancellation in a Universal Windows Platform (UWP) app with C# and XAML that uses a custom Windows Runtime C++ component.
66
+
The `IAsyncAction`, `IAsyncActionWithProgress<TProgress>`, `IAsyncOperation<TResult>`, and `IAsyncActionOperationWithProgress<TProgress, TProgress>` interfaces each provide a `Cancel` method that enables you to cancel the asynchronous operation. The `task` class works with cancellation tokens. When you use a cancellation token to cancel work, the runtime does not start new work that subscribes to that token. Work that is already active can monitor its cancellation token and stop when it can. This mechanism is described in greater detail in the document [Cancellation in the PPL](cancellation-in-the-ppl.md). You can connect task cancellation with the Windows Runtime `Cancel` methods in two ways. First, you can define the work function that you pass to `create_async` to take a [concurrency::cancellation_token](../../parallel/concrt/reference/cancellation-token-class.md) object. When the `Cancel` method is called, this cancellation token is canceled and the normal cancellation rules apply to the underlying `task` object that supports the `create_async` call. If you do not provide a `cancellation_token` object, the underlying `task` object defines one implicitly. Define a `cancellation_token` object when you need to cooperatively respond to cancellation in your work function. The section [Example: Controlling Execution in a Windows Runtime App with C++ and XAML](#example-app) shows an example of how to perform cancellation in a Universal Windows Platform (UWP) app with C# and XAML that uses a custom Windows Runtime C++ component.
67
67
68
68
> [!WARNING]
69
69
> In a chain of task continuations, always clean up state and then call [concurrency::cancel_current_task](reference/concurrency-namespace-functions.md#cancel_current_task) when the cancellation token is canceled. If you return early instead of calling `cancel_current_task`, the operation transitions to the completed state instead of the canceled state.
0 commit comments