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/atl-mfc-shared/cstring-argument-passing.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,9 @@ When you define a class interface, you must determine the argument-passing conve
14
14
15
15
## <aname="_core_strings_as_function_inputs"></a> Strings as Function Inputs
16
16
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.
18
18
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.
20
20
21
21
If the string contents are to be changed by a function, declare the parameter as a nonconstant `CString` reference (`CString&`).
Copy file name to clipboardExpand all lines: docs/atl/reference/cregkey-class.md
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,7 @@ class CRegKey
83
83
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.
84
84
85
85
> [!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.
87
87
88
88
## Requirements
89
89
@@ -469,7 +469,7 @@ LONG QueryBinaryValue(
469
469
### Parameters
470
470
471
471
*`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.
473
473
474
474
*`pValue`*\
475
475
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
486
486
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.
487
487
488
488
> [!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.
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.
505
505
506
506
*`dwValue`*\
507
507
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
515
515
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.
516
516
517
517
> [!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.
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.
534
534
535
535
*`guidValue`*\
536
536
Pointer to a variable that receives the GUID.
@@ -560,10 +560,10 @@ LONG QueryMultiStringValue(
560
560
### Parameters
561
561
562
562
*`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.
564
564
565
565
*`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.
567
567
568
568
*`pnChars`*\
569
569
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
577
577
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.
578
578
579
579
> [!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.
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.
596
596
597
597
*`qwValue`*\
598
598
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
606
606
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.
607
607
608
608
> [!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.
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.
626
626
627
627
*`pszValue`*\
628
628
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
639
639
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.
640
640
641
641
> [!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.
@@ -665,7 +665,7 @@ ATL_DEPRECATED LONG QueryValue(
665
665
### Parameters
666
666
667
667
*`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.
669
669
670
670
*`pdwType`*\
671
671
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
699
699
The remaining method calls `RegQueryValueEx`.
700
700
701
701
> [!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.
@@ -875,7 +875,7 @@ LONG SetMultiStringValue(LPCTSTR pszValueName, LPCTSTR pszValue) throw();
875
875
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.
876
876
877
877
*`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.
> 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).
75
75
76
76
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):
77
77
78
78

79
79
80
-
81
80
## Add a debug configuration file
82
81
83
82
Next, add configuration information that tells Visual Studio where to find your remote machine, along with other configuration details.
0 commit comments