Skip to content

Commit b9a6b8d

Browse files
committed
Merge branch 'main' of https://github.com/MicrosoftDocs/cpp-docs-pr into RAS-cpp-US1921538-1
2 parents 381dec7 + ee00e8c commit b9a6b8d

File tree

58 files changed

+2287
-2279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2287
-2279
lines changed

docs/atl-mfc-shared/cstring-argument-passing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ When you define a class interface, you must determine the argument-passing conve
1414

1515
## <a name="_core_strings_as_function_inputs"></a> Strings as Function Inputs
1616

17-
The most efficient and secure way to use a `CString` object in called functions is to pass a `CString` object to the function. Despite the name, a `CString` object doesn't store a string internally as a C-style string that has a `NULL` terminator. Instead, a `CString` object keeps careful track of the number of characters it has. Having `CString` provide a `LPCTSTR` pointer to a `NULL` terminated string is a small amount of work that can become significant if your code has to do it constantly. The result is temporary because any change to the `CString` contents invalidates old copies of the `LPCTSTR` pointer.
17+
The most efficient and secure way to use a `CString` object in called functions is to pass a `CString` object to the function. Despite the name, a `CString` object doesn't store a string internally as a C-style string that has a `NULL` terminator. Instead, a `CString` object keeps careful track of the number of characters it has. Having `CString` provide a `LPCTSTR` pointer to a `NULL`-terminated string is a small amount of work that can become significant if your code has to do it constantly. The result is temporary because any change to the `CString` contents invalidates old copies of the `LPCTSTR` pointer.
1818

19-
It does make sense in some cases to provide a C-style string. For example, there can be a situation where a called function is written in C and doesn't support objects. In this case, coerce the `CString` parameter to `LPCTSTR`, and the function will get a C-style `NULL` terminated string. You can also go the other direction and create a `CString` object by using the `CString` constructor that accepts a C-style string parameter.
19+
It does make sense in some cases to provide a C-style string. For example, there can be a situation where a called function is written in C and doesn't support objects. In this case, coerce the `CString` parameter to `LPCTSTR`, and the function will get a C-style `NULL`-terminated string. You can also go the other direction and create a `CString` object by using the `CString` constructor that accepts a C-style string parameter.
2020

2121
If the string contents are to be changed by a function, declare the parameter as a nonconstant `CString` reference (`CString&`).
2222

docs/atl-mfc-shared/string-data-management.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ helpviewer_keywords: ["Unicode, string objects"]
88

99
Visual C++ provides several ways to manage string data:
1010

11-
- [String Manipulation](../c-runtime-library/string-manipulation-crt.md) for working with C-style `NULL` terminated strings
11+
- [String Manipulation](../c-runtime-library/string-manipulation-crt.md) for working with C-style `NULL`-terminated strings
1212

1313
- Win32 API functions for managing strings
1414

docs/atl/reference/cregkey-class.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class CRegKey
8383
When you close a key, its registry data is written (flushed) to the hard disk. This process may take several seconds. If your application must explicitly write registry data to the hard disk, you can call the [`RegFlushKey`](/windows/win32/api/winreg/nf-winreg-regflushkey) Win32 function. However, `RegFlushKey` uses many system resources and should be called only when absolutely necessary.
8484

8585
> [!IMPORTANT]
86-
> Any methods that allow the caller to specify a registry location have the potential to read data that cannot be trusted. Methods that make use of [`RegQueryValueEx`](/windows/win32/api/winreg/nf-winreg-regqueryvalueexw) should take into consideration that this function does not explicitly handle strings which are `NULL` terminated. Both conditions should be checked for by the calling code.
86+
> Any methods that allow the caller to specify a registry location have the potential to read data that cannot be trusted. Methods that make use of [`RegQueryValueEx`](/windows/win32/api/winreg/nf-winreg-regqueryvalueexw) should take into consideration that this function does not explicitly handle strings which are null-terminated. Both conditions should be checked for by the calling code.
8787
8888
## Requirements
8989

@@ -469,7 +469,7 @@ LONG QueryBinaryValue(
469469
### Parameters
470470
471471
*`pszValueName`*\
472-
Pointer to a `NULL` terminated string containing the name of the value to query.
472+
Pointer to a `NULL`-terminated string containing the name of the value to query.
473473
474474
*`pValue`*\
475475
Pointer to a buffer that receives the value's data.
@@ -486,7 +486,7 @@ If the method succeeds, `ERROR_SUCCESS` is returned. If the method fails to read
486486
This method makes use of `RegQueryValueEx` and confirms that the correct type of data is returned. See [`RegQueryValueEx`](/windows/win32/api/winreg/nf-winreg-regqueryvalueexw) for more details.
487487
488488
> [!IMPORTANT]
489-
> This method allows the caller to specify any registry location, potentially reading data which cannot be trusted. Also, the [`RegQueryValueEx`](/windows/win32/api/winreg/nf-winreg-regqueryvalueexw) function used by this method does not explicitly handle strings which are `NULL` terminated. Both conditions should be checked for by the calling code.
489+
> This method allows the caller to specify any registry location, potentially reading data which cannot be trusted. Also, the [`RegQueryValueEx`](/windows/win32/api/winreg/nf-winreg-regqueryvalueexw) function used by this method does not explicitly handle strings which are null-terminated. Both conditions should be checked for by the calling code.
490490
491491
## <a name="querydwordvalue"></a> `CRegKey::QueryDWORDValue`
492492
@@ -501,7 +501,7 @@ LONG QueryDWORDValue(
501501
### Parameters
502502
503503
*`pszValueName`*\
504-
Pointer to a `NULL` terminated string containing the name of the value to query.
504+
Pointer to a `NULL`-terminated string containing the name of the value to query.
505505
506506
*`dwValue`*\
507507
Pointer to a buffer that receives the `DWORD`.
@@ -515,7 +515,7 @@ If the method succeeds, `ERROR_SUCCESS` is returned. If the method fails to read
515515
This method makes use of `RegQueryValueEx` and confirms that the correct type of data is returned. See [`RegQueryValueEx`](/windows/win32/api/winreg/nf-winreg-regqueryvalueexw) for more details.
516516
517517
> [!IMPORTANT]
518-
> This method allows the caller to specify any registry location, potentially reading data which cannot be trusted. Also, the [`RegQueryValueEx`](/windows/win32/api/winreg/nf-winreg-regqueryvalueexw) function used by this method does not explicitly handle strings which are `NULL` terminated. Both conditions should be checked for by the calling code.
518+
> This method allows the caller to specify any registry location, potentially reading data which cannot be trusted. Also, the [`RegQueryValueEx`](/windows/win32/api/winreg/nf-winreg-regqueryvalueexw) function used by this method does not explicitly handle strings which are null-terminated. Both conditions should be checked for by the calling code.
519519
520520
## <a name="queryguidvalue"></a> `CRegKey::QueryGUIDValue`
521521
@@ -530,7 +530,7 @@ LONG QueryGUIDValue(
530530
### Parameters
531531
532532
*`pszValueName`*\
533-
Pointer to a `NULL` terminated string containing the name of the value to query.
533+
Pointer to a `NULL`-terminated string containing the name of the value to query.
534534
535535
*`guidValue`*\
536536
Pointer to a variable that receives the GUID.
@@ -560,10 +560,10 @@ LONG QueryMultiStringValue(
560560
### Parameters
561561
562562
*`pszValueName`*\
563-
Pointer to a `NULL` terminated string containing the name of the value to query.
563+
Pointer to a `NULL`-terminated string containing the name of the value to query.
564564
565565
*`pszValue`*\
566-
Pointer to a buffer that receives the multistring data. A multistring is an array of `NULL` terminated strings, terminated by two null characters.
566+
Pointer to a buffer that receives the multistring data. A multistring is an array of `NULL`-terminated strings, terminated by two null characters.
567567
568568
*`pnChars`*\
569569
The size, in `TCHARs`, of the buffer pointed to by *`pszValue`*. When the method returns, *`pnChars`* contains the size, in `TCHARs`, of the multistring retrieved, including a terminating null character.
@@ -577,7 +577,7 @@ If the method succeeds, `ERROR_SUCCESS` is returned. If the method fails to read
577577
This method makes use of `RegQueryValueEx` and confirms that the correct type of data is returned. See [`RegQueryValueEx`](/windows/win32/api/winreg/nf-winreg-regqueryvalueexw) for more details.
578578
579579
> [!IMPORTANT]
580-
> This method allows the caller to specify any registry location, potentially reading data which cannot be trusted. Also, the [`RegQueryValueEx`](/windows/win32/api/winreg/nf-winreg-regqueryvalueexw) function used by this method does not explicitly handle strings which are `NULL` terminated. Both conditions should be checked for by the calling code.
580+
> This method allows the caller to specify any registry location, potentially reading data which cannot be trusted. Also, the [`RegQueryValueEx`](/windows/win32/api/winreg/nf-winreg-regqueryvalueexw) function used by this method does not explicitly handle strings which are null-terminated. Both conditions should be checked for by the calling code.
581581
582582
## <a name="queryqwordvalue"></a> `CRegKey::QueryQWORDValue`
583583
@@ -592,7 +592,7 @@ LONG QueryQWORDValue(
592592
### Parameters
593593
594594
*`pszValueName`*\
595-
Pointer to a `NULL` terminated string containing the name of the value to query.
595+
Pointer to a `NULL`-terminated string containing the name of the value to query.
596596
597597
*`qwValue`*\
598598
Pointer to a buffer that receives the `QWORD`.
@@ -606,7 +606,7 @@ If the method succeeds, `ERROR_SUCCESS` is returned. If the method fails to read
606606
This method makes use of `RegQueryValueEx` and confirms that the correct type of data is returned. See [`RegQueryValueEx`](/windows/win32/api/winreg/nf-winreg-regqueryvalueexw) for more details.
607607
608608
> [!IMPORTANT]
609-
> This method allows the caller to specify any registry location, potentially reading data which cannot be trusted. Also, the [`RegQueryValueEx`](/windows/win32/api/winreg/nf-winreg-regqueryvalueexw) function used by this method does not explicitly handle strings which are `NULL` terminated. Both conditions should be checked for by the calling code.
609+
> This method allows the caller to specify any registry location, potentially reading data which cannot be trusted. Also, the [`RegQueryValueEx`](/windows/win32/api/winreg/nf-winreg-regqueryvalueexw) function used by this method does not explicitly handle strings which are null-terminated. Both conditions should be checked for by the calling code.
610610
611611
## <a name="querystringvalue"></a> `CRegKey::QueryStringValue`
612612
@@ -622,7 +622,7 @@ LONG QueryStringValue(
622622
### Parameters
623623
624624
*`pszValueName`*\
625-
Pointer to a `NULL` terminated string containing the name of the value to query.
625+
Pointer to a `NULL`-terminated string containing the name of the value to query.
626626
627627
*`pszValue`*\
628628
Pointer to a buffer that receives the string data.
@@ -639,7 +639,7 @@ If the method succeeds, `ERROR_SUCCESS` is returned. If the method fails to read
639639
This method makes use of `RegQueryValueEx` and confirms that the correct type of data is returned. See [`RegQueryValueEx`](/windows/win32/api/winreg/nf-winreg-regqueryvalueexw) for more details.
640640
641641
> [!IMPORTANT]
642-
> This method allows the caller to specify any registry location, potentially reading data which cannot be trusted. Also, the [`RegQueryValueEx`](/windows/win32/api/winreg/nf-winreg-regqueryvalueexw) function used by this method does not explicitly handle strings which are `NULL` terminated. Both conditions should be checked for by the calling code.
642+
> This method allows the caller to specify any registry location, potentially reading data which cannot be trusted. Also, the [`RegQueryValueEx`](/windows/win32/api/winreg/nf-winreg-regqueryvalueexw) function used by this method does not explicitly handle strings which are null-terminated. Both conditions should be checked for by the calling code.
643643
644644
## <a name="queryvalue"></a> `CRegKey::QueryValue`
645645
@@ -665,7 +665,7 @@ ATL_DEPRECATED LONG QueryValue(
665665
### Parameters
666666
667667
*`pszValueName`*\
668-
Pointer to a `NULL` terminated string containing the name of the value to query. If *`pszValueName`* is `NULL` or an empty string, `""`, the method retrieves the type and data for the key's unnamed or default value, if any.
668+
Pointer to a `NULL`-terminated string containing the name of the value to query. If *`pszValueName`* is `NULL` or an empty string, `""`, the method retrieves the type and data for the key's unnamed or default value, if any.
669669
670670
*`pdwType`*\
671671
Pointer to a variable that receives a code indicating the type of data stored in the specified value. The *`pdwType`* parameter can be `NULL` if the type code isn't required.
@@ -699,7 +699,7 @@ The two original versions of `QueryValue` are no longer supported and are marked
699699
The remaining method calls `RegQueryValueEx`.
700700
701701
> [!IMPORTANT]
702-
> This method allows the caller to specify any registry location, potentially reading data which cannot be trusted. Also, the `RegQueryValueEx` function used by this method does not explicitly handle strings which are `NULL` terminated. Both conditions should be checked for by the calling code.
702+
> This method allows the caller to specify any registry location, potentially reading data which cannot be trusted. Also, the `RegQueryValueEx` function used by this method does not explicitly handle strings which are null-terminated. Both conditions should be checked for by the calling code.
703703
704704
## <a name="recursedeletekey"></a> `CRegKey::RecurseDeleteKey`
705705
@@ -875,7 +875,7 @@ LONG SetMultiStringValue(LPCTSTR pszValueName, LPCTSTR pszValue) throw();
875875
Pointer to a string containing the name of the value to set. If a value with this name isn't already present, the method adds it to the key.
876876
877877
*`pszValue`*\
878-
Pointer to the multistring data to be stored with the specified value name. A multistring is an array of `NULL` terminated strings, terminated by two null characters.
878+
Pointer to the multistring data to be stored with the specified value name. A multistring is an array of `NULL`-terminated strings, terminated by two null characters.
879879
880880
### Return Value
881881

docs/build/cmake-remote-debugging.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Select the Visual Studio **Configuration** dropdown and select **Manage Configur
6060
![Choose Manage Configurations in the Visual Studio configurations drop-down.](media/vs2019-cmake-manage-configurations.png)
6161

6262
Add a new configuration by selecting **Add a new configuration** (the green **+** button).\
63-
In the **CMakeSettings** dialog that appears, select **arm64-debug**, and then press **Select**:
63+
In the **CMakeSettings** dialog that appears, select **arm64-debug**, and then choose **Select**:
6464

6565
![Add arm64-debug configuration.](media/cmake-add-config-icon-with-target-dialog.png)
6666

@@ -71,13 +71,12 @@ The **Toolset** dropdown is set to **msvc_arm64_x64**. Your settings should now
7171
![CMake settings dialog.](media/cmake-settings-editor2.png)
7272

7373
> [!Note]
74-
> In the **Toolset** dropdown, **msvc_arm64** selects 32-bit host tools to cross-compile to ARM64, whereas **msvc_arm64 x64** selects 64-bit host tools to cross-compile to ARM64, which is what you'll do in this tutorial.
74+
> In the **Toolset** dropdown, **msvc_arm64** selects 32-bit host tools to cross-compile to ARM64, whereas **msvc_arm64 x64** selects 64-bit host tools to cross-compile to ARM64, which is what you'll do in this tutorial. For more information about the available toolset environments, see [Pre-defined environments](cppproperties-schema-reference.md#pre-defined-environments).
7575
7676
Save the *`CMakeSettings.json`* file. In the configuration dropdown, select **arm64-debug**. (It may take a moment after saving the *`CMakeSettings.json`* file for it to appear in the list):
7777

7878
![Ensure that arm64-debug is selected in the Visual Studio configurations drop-down.](media/vs2019-cmake-manage-configurations-arm.png)
7979

80-
8180
## Add a debug configuration file
8281

8382
Next, add configuration information that tells Visual Studio where to find your remote machine, along with other configuration details.
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,42 @@
11
---
2-
description: "Learn more about: Formatting the Output of a Custom Build Step or Build Event"
3-
title: "Formatting the Output of a Custom Build Step or Build Event"
4-
ms.date: "08/27/2018"
2+
description: "Learn more about: Formatting the output of a custom build step or build event"
3+
title: "Formatting the output of a custom build step or build event"
4+
ms.date: 03/15/2022
55
helpviewer_keywords: ["builds [C++], build events", "custom build steps [C++], output format", "events [C++], build", "build events [C++], output format", "build steps [C++], output format", "builds [C++], custom build steps"]
66
ms.assetid: 92ad3e38-24d7-4b89-90e6-5a16f5f998da
77
---
8-
# Formatting the Output of a Custom Build Step or Build Event
8+
# Formatting the output of a custom build step or build event
99

1010
If the output of a custom build step or build event is formatted correctly, users get the following benefits:
1111

1212
- Warnings and errors are counted in the **Output** window.
1313

1414
- Output appears in the **Task List** window.
1515

16-
- Clicking on the output in the **Output** window displays the appropriate topic.
16+
- Clicking on the output in the **Output** window displays the appropriate location.
1717

18-
- F1 operations are enabled in the **Task List** window or **Output** window.
18+
- **F1** operations are enabled in the **Task List** window or **Output** window.
19+
20+
## Output format
1921

2022
The format of the output should be:
2123

22-
> {<em>filename</em>**(**<em>line#</em> \[**,** <em>column#</em>]**)** \| *toolname*} **:** \[ <em>any text</em> ] {**error** \| **warning**} <em>code+number</em>**:**<em>localizable string</em> \[ <em>any text</em> ]
24+
> { *filename*`(`*line-number* \[`,` *column-number*]`)` \| *tool-name* } `:` \[ *any-text* ] {`error` \| `warning`} *code-type-and-number* `:` *localizable-string* \[ *any-text* ]
2325
2426
Where:
2527

26-
- {*a* \| *b*} is a choice of either *a* or *b*.
28+
- { *a* \| *b* } is a choice of either *a* or *b*,
2729

28-
- \[<em>item</em>] is an optional string or parameter.
30+
- \[ *item* ] is an optional string or parameter,
2931

30-
- **Bold** represents a literal.
32+
- `text` represents a literal.
3133

3234
For example:
3335

34-
> C:\\*sourcefile.cpp*(134) : error C2143: syntax error : missing ';' before '}'
36+
> C:\\sourcefile.cpp(134) : error C2143: syntax error : missing ';' before '}'
3537
>
36-
> LINK : fatal error LNK1104: cannot open file '*somelib.lib*'
38+
> LINK : fatal error LNK1104: cannot open file 'some-library.lib'
3739
3840
## See also
3941

40-
[Understanding Custom Build Steps and Build Events](understanding-custom-build-steps-and-build-events.md)
42+
[Understanding custom build steps and build events](understanding-custom-build-steps-and-build-events.md)

0 commit comments

Comments
 (0)