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/strtod-strtod-l-wcstod-wcstod-l.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,9 +49,13 @@ The locale to use.
49
49
50
50
## Return Value
51
51
52
-
**strtod** returns the value of the floating-point number, except when the representation would cause an overflow, in which case the function returns +/-**HUGE_VAL**. The sign of **HUGE_VAL** matches the sign of the value that cannot be represented. **strtod** returns 0 if no conversion can be performed or an underflow occurs.
52
+
**strtod** returns the value of the floating-point number, except when the representation would cause an overflow, in which case the function returns +/-**HUGE_VAL**. The sign of **HUGE_VAL** matches the sign of the value that cannot be represented. **strtod** returns `0` if no conversion can be performed or an underflow occurs.
53
53
54
-
**wcstod** returns values analogously to **strtod**. For both functions, **errno** is set to **ERANGE** if overflow or underflow occurs and the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). See [_doserrno, errno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md) for more information on this and other return codes.
54
+
**wcstod** returns values analogously to **strtod**:
55
+
- For both functions, **errno** is set to **ERANGE** if overflow or underflow occurs.
56
+
- If there are invalid parameters, **errno** is set to **EINVAL** and the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md).
57
+
58
+
See [_doserrno, errno, _sys_errlist, and _sys_nerr](../../c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr.md) for more information on this and other return codes.
Points to memory used to store the internal state of the parser so that the parser can continue from where it left off during subsequent calls.
69
+
62
70
## Return Value
63
71
64
72
Returns a pointer to the next token found in *strToken*. The functions return **NULL** when no more tokens are found. Each call modifies *strToken* by substituting a null character for the first delimiter that occurs after the returned token.
@@ -67,6 +75,8 @@ Returns a pointer to the next token found in *strToken*. The functions return **
67
75
68
76
The **strtok** function finds the next token in *strToken*. The set of characters in *strDelimit* specifies possible delimiters of the token to be found in *strToken* on the current call. **wcstok** and **_mbstok** are wide-character and multibyte-character versions of **strtok**. The arguments and return value of **wcstok** are wide-character strings; those of **_mbstok** are multibyte-character strings. These three functions behave identically otherwise.
69
77
78
+
The two argument version of **wcstok** is not standard. If you need to use that version, you'll need to define `_CRT_NON_CONFORMING_WCSTOK` before you `#include <wchar.h>` (or `#include <string.h>`).
79
+
70
80
> [!IMPORTANT]
71
81
> These functions incur a potential threat brought about by a buffer overrun problem. Buffer overrun problems are a frequent method of system attack, resulting in an unwarranted elevation of privilege. For more information, see [Avoiding Buffer Overruns](/windows/win32/SecBP/avoiding-buffer-overruns).
72
82
@@ -94,6 +104,7 @@ By default, this function's global state is scoped to the application. To change
94
104
|-------------|---------------------|
95
105
|**strtok**|\<string.h>|
96
106
|**wcstok**|\<string.h> or \<wchar.h>|
107
+
|**_wcstok_l**|<tchar.h>|
97
108
|**_mbstok**, **_mbstok_l**|\<mbstring.h>|
98
109
99
110
For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
@@ -112,9 +112,11 @@ The **vsnprintf** function returns the number of characters written, not countin
112
112
113
113
Both **_vsnprintf** and **_vsnwprintf** functions return the number of characters written if the number of characters to write is less than or equal to *count*; if the number of characters to write is greater than *count*, these functions return -1 indicating that output has been truncated.
114
114
115
-
The value returned by all these functions does not include the terminating null, whether one is written or not. When *count* is zero, the value returned is the number of characters the functions would write, not including any terminating null. You can use this result to allocate sufficient buffer space for the string and its terminating null, and then call the function again to fill the buffer.
115
+
The value returned by all these functions does not include the terminating null, whether one is written or not.
116
116
117
-
If *format* is **NULL**, or if *buffer* is **NULL** and *count* is not equal to zero, 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 return -1 and set **errno** to **EINVAL**.
117
+
- If *count* is zero and *buffer* is **NULL**, the value returned is the number of characters the functions would write, not including any terminating null. You can use this result to allocate sufficient buffer space for the string and its terminating null, and then call the function again to fill the buffer.
118
+
- If *count* is zero but *buffer* is not **NULL**, nothing is written and the function returns `-1`.
119
+
- If *format* is **NULL**, or if *buffer* is **NULL** and *count* is not equal to zero, 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 return -1 and set **errno** to **EINVAL**.
- BCGP_MDI_CREATE_VERT_GROUP - can create a vertical tab group.
770
+
- AFX_MDI_CREATE_VERT_GROUP - can create a vertical tab group.
771
771
772
-
- BCGP_MDI_CREATE_HORZ_GROUP - can create a horizontal tab group.
772
+
- AFX_MDI_CREATE_HORZ_GROUP - can create a horizontal tab group.
773
773
774
-
- BCGP_MDI_CAN_MOVE_PREV - can move a tab to the previous tab group.
774
+
- AFX_MDI_CAN_MOVE_PREV - can move a tab to the previous tab group.
775
775
776
-
- BCGP_MDI_CAN_MOVE_NEXT - can move a tab to the next tab group.
776
+
- AFX_MDI_CAN_MOVE_NEXT - can move a tab to the next tab group.
777
777
778
778
### Remarks
779
779
@@ -1058,7 +1058,7 @@ To load or save the state of MDI tabs and groups and the list of opened document
1058
1058
1059
1059
- Call [CMDIFrameWndEx::SaveMDIState](#savemdistate) when the main frame is being closed
1060
1060
1061
-
- Call [CMDIFrameWndEx::LoadMDIState](#loadmdistate) when the main frame is being created. The recommended place for this call is before the main frame is displayed for the first time. Add `CWinAppEx::EnableLoadWindowPlacement` `(FALSE);` before `pMainFrame->LoadFrame (IDR_MAINFRAME);.` Add `CBCGPWorkspace::ReloadWindowPlacement` `(pMainFrame);` after the call to `LoadMDIState` to display the main frame at the position that was stored in the registry.
1061
+
- Call [CMDIFrameWndEx::LoadMDIState](#loadmdistate) when the main frame is being created. The recommended place for this call is before the main frame is displayed for the first time. Add `CWinAppEx::EnableLoadWindowPlacement` `(FALSE);` before `pMainFrame->LoadFrame (IDR_MAINFRAME);.` Add `CWinAppEx::ReloadWindowPlacement` `(pMainFrame);` after the call to `LoadMDIState` to display the main frame at the position that was stored in the registry.
1062
1062
1063
1063
- Override `GetDocumentName` in the `CMDIChildWndEx`- derived class if your application displays documents that are not stored as files. The returned string will be saved in the registry as the document identifier. The base implementation of [CMDIChildWndEx::GetDocumentName](../../mfc/reference/cmdichildwndex-class.md#getdocumentname) returns a value obtained from [CDocument::GetPathName](../../mfc/reference/cdocument-class.md#getpathname).
[in] A bitwise-OR combination of flags that indicates what actions are allowed for the current tab:
1442
1442
1443
-
- BCGP_MDI_CREATE_VERT_GROUP - can create a vertical tab group.
1443
+
- AFX_MDI_CREATE_VERT_GROUP - can create a vertical tab group.
1444
1444
1445
-
- BCGP_MDI_CREATE_HORZ_GROUP - can create a horizontal tab group.
1445
+
- AFX_MDI_CREATE_HORZ_GROUP - can create a horizontal tab group.
1446
1446
1447
-
- BCGP_MDI_CAN_MOVE_PREV - can move a tab to the previous tab group.
1447
+
- AFX_MDI_CAN_MOVE_PREV - can move a tab to the previous tab group.
1448
1448
1449
-
- BCGP_MDI_CAN_MOVE_NEXT - can move a tab to the next tab group.
1449
+
- AFX_MDI_CAN_MOVE_NEXT - can move a tab to the next tab group.
1450
1450
1451
-
- BCGP_MDI_CAN_BE_DOCKED - switch a tabbed document to docked state (relevant for tabbed documents only).
1451
+
- AFX_MDI_CAN_BE_DOCKED - switch a tabbed document to docked state (relevant for tabbed documents only).
1452
1452
1453
1453
*bTabDrop*<br/>
1454
1454
[in] TRUE to display the menu as a result of dragging the tab onto another tabbed group. FALSE to display the menu as a shortcut menu on the currently active tab.
1455
1455
1456
1456
### Return Value
1457
1457
1458
-
Override this method in a [CBCGPMDIFrameWnd](../../mfc/reference/cmdiframewndex-class.md)-derived class.
1458
+
Override this method in a [CMDIFrameWndEx](../../mfc/reference/cmdiframewndex-class.md)-derived class.
Copy file name to clipboardExpand all lines: docs/mfc/reference/cmultidoctemplate-class.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,8 @@ class CMultiDocTemplate : public CDocTemplate
17
17
18
18
## Members
19
19
20
+
Note: The member functions for this class are virtual. See [CDocTemplate](../../mfc/reference/cdoctemplate-class.md) and [CCmdTarget](../../mfc/reference/ccmdtarget-class.md) for documentation.
Extends the integer primitives to help prevent integer overflow and lets you compare different types of integers.
12
12
13
13
> [!NOTE]
14
-
> The latest version of this library is located at [https://github.com/dcleblanc/SafeInt](https://github.com/dcleblanc/SafeInt).
14
+
> The latest version of the SafeInt library is located at [https://github.com/dcleblanc/SafeInt](https://github.com/dcleblanc/SafeInt). To use the SafeInt library, clone the repo and `#include "SafeInt.hpp"`
15
15
16
16
## Syntax
17
17
@@ -214,7 +214,10 @@ There are two options to customize the error policy. The first option is to set
214
214
215
215
## Requirements
216
216
217
-
**Header:** safeint.h
217
+
**Header:** SafeInt.hpp
218
+
> [!NOTE]
219
+
> The latest version of this library is located at [https://github.com/dcleblanc/SafeInt](https://github.com/dcleblanc/SafeInt). Clone the library and include SafeInt.hpp to use the SafeInt library.
220
+
> Prefer this github repo to <safeint.h>. It is a modern version of <safeint.h> that includes a small number of bug fixes, uses modern features of C++ resulting in more efficient code, and is portable to any platform using gcc, clang, or Intel compilers.
218
221
219
222
**Namespace:** msl::utilities
220
223
@@ -225,39 +228,47 @@ Constructs a `SafeInt` object.
225
228
```cpp
226
229
SafeInt() throw
227
230
228
-
SafeInt (
229
-
const T& i
230
-
) throw ()
231
+
SafeInt (const T& i) throw ()
231
232
232
-
SafeInt (
233
-
bool b
234
-
) throw ()
233
+
SafeInt (bool b) throw ()
235
234
236
235
template <typenameU>
237
-
SafeInt (
238
-
const SafeInt <U, E>& u
239
-
)
236
+
SafeInt (const SafeInt <U, E>& u)
240
237
241
238
I template <typenameU>
242
-
SafeInt (
243
-
const U& i
244
-
)
239
+
SafeInt (const U& i)
245
240
```
246
241
247
242
### Parameters
248
243
249
-
*i*<br/>
244
+
`i`<br/>
250
245
[in] The value for the new `SafeInt` object. This must be a parameter of type T or U, depending on the constructor.
251
246
252
-
*b*<br/>
247
+
`b`<br/>
253
248
[in] The Boolean value for the new `SafeInt` object.
254
249
255
-
*u*<br/>
250
+
`u`<br/>
256
251
[in] A `SafeInt` of type U. The new `SafeInt` object will have the same value as *u*, but will be of type T.
257
252
258
-
U
253
+
`U`
259
254
The type of data stored in the `SafeInt`. This can be either a Boolean, character, or integer type. If it is an integer type, it can be signed or unsigned and be between 8 and 64 bits.
260
255
256
+
### Example
257
+
258
+
```c
259
+
#include "SafeInt.hpp" // set path to your clone of the SafeInt GitHub repo (https://github.com/dcleblanc/SafeInt)
260
+
261
+
int main()
262
+
{
263
+
int divisor = 3;
264
+
int dividend = 6;
265
+
int result;
266
+
267
+
bool success = SafeDivide(dividend, divisor, result); // result = 2
268
+
success = SafeDivide(dividend, 0, result); // expect fail. result is not modified.
269
+
}
270
+
```
271
+
261
272
### Remarks
262
273
263
274
The input parameter for the constructor, *i* or *u*, must be a Boolean, character, or integer type. If it is another type of parameter, the `SafeInt` class calls [static_assert](../cpp/static-assert.md) to indicate an invalid input parameter.
0 commit comments