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
Display the source diff
Display the rich diff
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
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -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.
@@ -501,7 +501,7 @@ LONG QueryDWORDValue(
501
501
### Parameters
502
502
503
503
*`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.
505
505
506
506
*`dwValue`*\
507
507
Pointer to a buffer that receives the `DWORD`.
@@ -530,7 +530,7 @@ LONG QueryGUIDValue(
530
530
### Parameters
531
531
532
532
*`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.
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.
@@ -592,7 +592,7 @@ LONG QueryQWORDValue(
592
592
### Parameters
593
593
594
594
*`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.
596
596
597
597
*`qwValue`*\
598
598
Pointer to a buffer that receives the `QWORD`.
@@ -622,7 +622,7 @@ LONG QueryStringValue(
622
622
### Parameters
623
623
624
624
*`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.
626
626
627
627
*`pszValue`*\
628
628
Pointer to a buffer that receives the string data.
@@ -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.
@@ -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.
0 commit comments