Skip to content

Commit 3878e54

Browse files
changes after review
1 parent 51e7b2b commit 3878e54

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
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/reference/cregkey-class.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
@@ -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`.
@@ -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.
@@ -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`.
@@ -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.
@@ -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.
@@ -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

0 commit comments

Comments
 (0)