Skip to content

Fix various typos #4843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/atl-mfc-shared/cstring-argument-passing.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ When you define a class interface, you must determine the argument-passing conve

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

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.
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 an `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.

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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To resolve this problem, do the following:

Export `CStringA` and `CStringW` (and the necessary base classes) from MFC90.DLL. Projects that include MFC will always use the MFC DLL exported `CStringA` and `CStringW`, as in previous MFC implementations.

Then create a exportable derived class using the `CStringT` template, as `CStringT_Exported` is below, for example:
Then create an exportable derived class using the `CStringT` template, as `CStringT_Exported` is below, for example:

[!code-cpp[NVC_MFC_DLL#7](../atl-mfc-shared/codesnippet/cpp/exporting-string-classes-using-cstringt_2.cpp)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The following table lists the classes shared between MFC and ATL.
|[CRect](../../atl-mfc-shared/reference/crect-class.md)|A class similar to a Windows [RECT](/windows/win32/api/windef/ns-windef-rect) structure that also includes member functions to manipulate `CRect` objects and Windows `RECT` structures.|atltypes.h|
|[CSimpleStringT](../../atl-mfc-shared/reference/csimplestringt-class.md)|Represents a `CSimpleStringT` object.|atlsimpstr.h|
|[CSize](../../atl-mfc-shared/reference/csize-class.md)|A class similar to the Windows [SIZE](/windows/win32/api/windef/ns-windef-size) structure, which implements a relative coordinate or position.|atltypes.h|
|[CStrBufT](../../atl-mfc-shared/reference/cstrbuft-class.md)|Provides automatic resource cleanup for `GetBuffer` and `ReleaseBuffer` calls on a existing `CStringT` object.|atlsimpstr.h|
|[CStrBufT](../../atl-mfc-shared/reference/cstrbuft-class.md)|Provides automatic resource cleanup for `GetBuffer` and `ReleaseBuffer` calls on an existing `CStringT` object.|atlsimpstr.h|
|[CStringData](../../atl-mfc-shared/reference/cstringdata-class.md)|Represents the data of a string object.|atlsimpstr.h|
|[CStringT](../../atl-mfc-shared/reference/cstringt-class.md)|Represents a `CStringT` object.|cstringt.h (MFC dependent) atlstr.h (MFC independent)|
|[CTime](../../atl-mfc-shared/reference/ctime-class.md)|Represents an absolute time and date.|atltime.h|
Expand Down
2 changes: 1 addition & 1 deletion docs/build/open-folder-projects-cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ This configuration inherits the environment variables of the Visual Studio [x64

## Default configuration for MinGW-w64

If you add the MinGW-W64 configuration, the JSON looks this this:
If you add the MinGW-W64 configuration, the JSON looks this:

```json
{
Expand Down
2 changes: 1 addition & 1 deletion docs/build/reference/filealign.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ms.assetid: c1017a35-8d71-4ad9-934b-a3e3ea037fa0
---
# /FILEALIGN (Align sections in files)

The **/FILEALIGN** linker option lets you specify the alignment of sections written to your output file as a multiple of an specified size.
The **/FILEALIGN** linker option lets you specify the alignment of sections written to your output file as a multiple of a specified size.

## Syntax

Expand Down
2 changes: 1 addition & 1 deletion docs/build/walkthrough-build-debug-wsl2.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ If you have a MSBuild-based Linux project, then you can upgrade to the WSL 2 too

If you're targeting a WSL 2 distribution and you don't want to use the WSL 2 toolset, then in the **Platform Toolset** dropdown, select the **GCC for Windows Subsystem for Linux** or **Clang for Windows Subsystem for Linux** toolset. If either of these toolsets are selected, Visual Studio won't maintain a copy of your source files in the WSL file system and will instead access source files over the mounted Windows drive (`/mnt/`…). System headers are still automatically copied to the Windows file system to provide a native IntelliSense experience. Customize the headers that are included or excluded from this copy in **Property Pages** > **General**.

In most cases, it's best to use the WSL 2 toolset with WSL 2 distributions because WSL 2 is slower when project files are stored in the Windows file system. To to learn more, see [Comparing WSL 1 and WSL 2](/windows/wsl/compare-versions).
In most cases, it's best to use the WSL 2 toolset with WSL 2 distributions because WSL 2 is slower when project files are stored in the Windows file system. To learn more, see [Comparing WSL 1 and WSL 2](/windows/wsl/compare-versions).

## See also

Expand Down
2 changes: 1 addition & 1 deletion docs/c-language/escape-sequences.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Note that the question mark preceded by a backslash (**\\?**) specifies a litera

**Microsoft Specific**

If a backslash precedes a character that does not appear in the table, the compiler handles the undefined character as the character itself. For example, `\c` is treated as an `c`.
If a backslash precedes a character that does not appear in the table, the compiler handles the undefined character as the character itself. For example, `\c` is treated as a `c`.

**END Microsoft Specific**

Expand Down
2 changes: 1 addition & 1 deletion docs/code-quality/c26444.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ An unnamed variable declaration creates a temporary object that is discarded at
## Remarks

- This rule detects types with a hand-written destructor or a compiler-generated destructor that transitively calls a hand-written destructor.
- This rule can flag code that invokes a nontrivial constructor of a RAII type.
- This rule can flag code that invokes a nontrivial constructor of an RAII type.
- The logic skips temporaries if they're used in higher-level expressions. One example is temporaries that are passed as arguments or used to invoke a function.

Code analysis name: `NO_UNNAMED_RAII_OBJECTS`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ Because of the way the code analysis rules get loaded within Visual Studio 2015,

1. Select the Microsoft.CppCoreCheck package and then choose the **Install** button to add the rules to your project.

The NuGet package adds a MSBuild *`.targets`* file to your project that is invoked when you enable code analysis on your project. The *`.targets`* file adds the C++ Core Check rules as another extension to the Visual Studio Code analysis tool. When the package is installed, you can use the Property Pages dialog to enable or disable the released and experimental rules.
The NuGet package adds an MSBuild *`.targets`* file to your project that is invoked when you enable code analysis on your project. The *`.targets`* file adds the C++ Core Check rules as another extension to the Visual Studio Code analysis tool. When the package is installed, you can use the Property Pages dialog to enable or disable the released and experimental rules.

::: moniker-end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ In this walkthrough, you'll:

C6230: Implicit cast between semantically different types: using HRESULT in a Boolean context.

The code editor displays the line that caused the warning inside the function `bool ProcessDomain()`. This warning indicates that a `HRESULT` is being used in an 'if' statement where a Boolean result is expected. It's typically a mistake, because when the `S_OK` HRESULT is returned from a function it indicates success, but when converted into a boolean value it evaluates to **`false`**.
The code editor displays the line that caused the warning inside the function `bool ProcessDomain()`. This warning indicates that an `HRESULT` is being used in an 'if' statement where a Boolean result is expected. It's typically a mistake, because when the `S_OK` HRESULT is returned from a function it indicates success, but when converted into a boolean value it evaluates to **`false`**.

1. Correct this warning by using the `SUCCEEDED` macro, which converts to **`true`** when a `HRESULT` return value indicates success. Your code should resemble the following code:

Expand Down
2 changes: 1 addition & 1 deletion docs/cpp/arrays-cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ It specifies an array of type **`int`**, conceptually arranged in a two-dimensio

:::image type="content" source="../cpp/media/vc38rc1.gif" alt-text="Conceptual layout of a multidimensional array.":::

The image is a grid 7 cells wide and 5 cells high. Each cell contains the index of the cell. The first cell index is labeled 0,0. The next cell in that row is 0,1 and so on to the last cell in that row which is 0,6. The next row starts with the index 1,0. The cell after that has an index of 1,1. The last cell in that row is 1,6. This pattern repeats until the last row, which starts with the index 4,0. The the last cell in the last row has an index of 4,6.
The image is a grid 7 cells wide and 5 cells high. Each cell contains the index of the cell. The first cell index is labeled 0,0. The next cell in that row is 0,1 and so on to the last cell in that row which is 0,6. The next row starts with the index 1,0. The cell after that has an index of 1,1. The last cell in that row is 1,6. This pattern repeats until the last row, which starts with the index 4,0. The last cell in the last row has an index of 4,6.
:::image-end

You can declare multidimensioned arrays that have an initializer list (as described in [Initializers](../cpp/initializers.md)). In these declarations, the constant expression that specifies the bounds for the first dimension can be omitted. For example:
Expand Down
2 changes: 1 addition & 1 deletion docs/cpp/clrcall.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ When `/clr` (not `/clr:pure` or `/clr:safe`) is used and **__clrcall** is not us

[/clr (Common Language Runtime Compilation)](../build/reference/clr-common-language-runtime-compilation.md) implies that all functions and function pointers are **__clrcall** and the compiler will not permit a function inside the compiland to be marked anything other than **__clrcall**. When **/clr:pure** is used, **__clrcall** can only be specified on function pointers and external declarations.

You can directly call **__clrcall** functions from existing C++ code that was compiled by using **/clr** as long as that function has an MSIL implementation. **__clrcall** functions cannot be called directly from functions that have inline asm and call CPU-specific intrinisics, for example, even if those functions are compiled with `/clr`.
You can directly call **__clrcall** functions from existing C++ code that was compiled by using **/clr** as long as that function has an MSIL implementation. **__clrcall** functions cannot be called directly from functions that have inline asm and call CPU-specific intrinsics, for example, even if those functions are compiled with `/clr`.

**__clrcall** function pointers are only meant to be used in the application domain in which they were created. Instead of passing **__clrcall** function pointers across application domains, use <xref:System.CrossAppDomainDelegate>. For more information, see [Application Domains and Visual C++](../dotnet/application-domains-and-visual-cpp.md).

Expand Down
2 changes: 1 addition & 1 deletion docs/cpp/enumerations-cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ hand = account_num; // error C2440: '=' : cannot convert from 'int' to 'Suit'
A cast is required to convert an **`int`** to a scoped or unscoped enumerator. However, you can promote an unscoped enumerator to an integer value without a cast.

```cpp
int account_num = Hearts; //OK if Hearts is in a unscoped enum
int account_num = Hearts; //OK if Hearts is in an unscoped enum
```

Using implicit conversions in this way can lead to unintended side-effects. To help eliminate programming errors associated with unscoped enums, scoped enum values are strongly typed. Scoped enumerators must be qualified by the enum type name (identifier) and can't be implicitly converted, as shown in the following example:
Expand Down
2 changes: 1 addition & 1 deletion docs/cpp/static-assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static_assert( constant-expression ); // C++17 (Visual Studio 2017 and later)
An integral constant expression that can be converted to a Boolean. If the evaluated expression is zero (false), the *string-literal* parameter is displayed and the compilation fails with an error. If the expression is nonzero (true), the **`static_assert`** declaration has no effect.

*string-literal*\
An message that is displayed if the *constant-expression* parameter is zero. The message is a string of characters in the [base character set](../c-language/ascii-character-set.md) of the compiler; that is, not [multibyte or wide characters](../c-language/multibyte-and-wide-characters.md).
A message that is displayed if the *constant-expression* parameter is zero. The message is a string of characters in the [base character set](../c-language/ascii-character-set.md) of the compiler; that is, not [multibyte or wide characters](../c-language/multibyte-and-wide-characters.md).

## Remarks

Expand Down
2 changes: 1 addition & 1 deletion docs/cpp/templates-and-name-resolution.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ A type is dependent if it depends on the template arguments. Specifically, a typ

## Type Dependence and Value Dependence

Names and expressions dependent on a template parameter are categorized as type dependent or value dependent, depending on whether the template parameter is a type parameter or a value parameter. Also, any identifiers declared in a template with a type dependent on the template argument are considered value dependent, as is a integral or enumeration type initialized with a value-dependent expression.
Names and expressions dependent on a template parameter are categorized as type dependent or value dependent, depending on whether the template parameter is a type parameter or a value parameter. Also, any identifiers declared in a template with a type dependent on the template argument are considered value dependent, as is an integral or enumeration type initialized with a value-dependent expression.

Type-dependent and value-dependent expressions are expressions that involve variables that are type dependent or value dependent. These expressions can have semantics that differ, depending on the parameters used for the template.

Expand Down
2 changes: 1 addition & 1 deletion docs/cpp/tutorial-named-modules-cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ module; // optional. Defines the beginning of the global module fragment
export module [module-name]; // Required. Marks the beginning of the module preamble

// import statements go here. They're available to all files that belong to the named module
// Put #includes in in the global module fragment, above
// Put #includes in the global module fragment, above

// After any import statements, the module purview begins here
// Put exported functions, types, and templates here
Expand Down
2 changes: 1 addition & 1 deletion docs/cpp/variant-t-variant-t.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ A `BYTE` value to be copied into the new `_variant_t` object.
A **`char`** value to be copied into the new `_variant_t` object.

*`usSrc`*\
A **`unsigned short`** value to be copied into the new `_variant_t` object.
An **`unsigned short`** value to be copied into the new `_variant_t` object.

*`ulSrc`*\
A **`unsigned long`** value to be copied into the new `_variant_t` object.
Expand Down
2 changes: 1 addition & 1 deletion docs/cppcx/casting-c-cx.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ If you use **`reinterpret_cast`** to convert from one Windows Runtime interface

- Conversions between a Windows Runtime interface type and its equivalent ABI type are always safe—that is, `IBuffer^` to `ABI::IBuffer*`.

- A Windows Runtime runtime class should always be converted to `IInspectable*` or its default interface, if that is known.
- A Windows Runtime class should always be converted to `IInspectable*` or its default interface, if that is known.

- After you convert to ABI types, you own the lifetime of the type and must follow the COM rules. We recommend that you use `WRL::ComPtr` to simplify lifetime management of ABI pointers.

Expand Down
Loading