diff --git a/.acrolinx-config.edn b/.acrolinx-config.edn
index f6076b5196..78cdd0e4df 100644
--- a/.acrolinx-config.edn
+++ b/.acrolinx-config.edn
@@ -21,7 +21,7 @@
"
**More info about Acrolinx**
-- [Install Acrolinx locally for VSCode](https://review.docs.microsoft.com/en-us/help/contribute/contribute-acrolinx-vscode)
+- [Install Acrolinx locally for VS Code](https://review.docs.microsoft.com/en-us/help/contribute/contribute-acrolinx-vscode)
- [Report false positives or issues](https://aka.ms/acrolinxbug)
"}
diff --git a/.github/ISSUE_TEMPLATE/new-c---2017-stl-library-documentation-topic-.md b/.github/ISSUE_TEMPLATE/new-c---2017-stl-library-documentation-topic-.md
deleted file mode 100644
index 701e5a16cc..0000000000
--- a/.github/ISSUE_TEMPLATE/new-c---2017-stl-library-documentation-topic-.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-name: 'New C++ 2017 STL library documentation topic '
-about: Create a C++ 2017 doc tracking work item
-title: ''
-labels: C++17, STL doc work
-assignees: ''
-
----
-
-ISO paper for this feature: [PaperID]()
-First implemented in: VS 20YY major.minor
diff --git a/.github/ISSUE_TEMPLATE/new-c---2020-stl-library-documentation-topic-.md b/.github/ISSUE_TEMPLATE/new-c---2020-stl-library-documentation-topic-.md
deleted file mode 100644
index 766ca6ee40..0000000000
--- a/.github/ISSUE_TEMPLATE/new-c---2020-stl-library-documentation-topic-.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-name: 'New C++ 2020 STL library documentation topic '
-about: Create a C++ 2020 doc tracking work item
-title: ''
-labels: C++20, STL doc work
-assignees: ''
-
----
-
-ISO paper for this feature: [PaperID]()
-First implemented in: VS 20YY major.minor
diff --git a/.github/ISSUE_TEMPLATE/new-c---2023-stl-library-documentation-topic.md b/.github/ISSUE_TEMPLATE/new-c---2023-stl-library-documentation-topic.md
deleted file mode 100644
index 0fbcd1114a..0000000000
--- a/.github/ISSUE_TEMPLATE/new-c---2023-stl-library-documentation-topic.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-name: New C++ 2023 STL library documentation topic
-about: Create an issue to track C++ 2023 STL doc work
-title: ''
-labels: C++23
-assignees: ''
-
----
-
-ISO paper for this feature: [PaperID](http link to iso paper)
-First implemented in: VS 20YY major.minor
diff --git a/.github/ISSUE_TEMPLATE/new-c---stl-library-doc-topic-.md b/.github/ISSUE_TEMPLATE/new-c---stl-library-doc-topic-.md
deleted file mode 100644
index 77b51776c3..0000000000
--- a/.github/ISSUE_TEMPLATE/new-c---stl-library-doc-topic-.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-name: 'New C++ STL library documentation topic '
-about: Create a C++ doc tracking work item
-title: ''
-labels: STL doc work
-assignees: ''
-
----
-
-ISO paper for this feature: [PaperID]()
-First implemented in: VS YYYY major.minor
diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md
new file mode 100644
index 0000000000..75dc5da1e0
--- /dev/null
+++ b/.github/copilot-instructions.md
@@ -0,0 +1,118 @@
+When writing documentation, follow these guidelines:
+
+## General style tips
+
+* Get to the point fast. Be concise and clear.
+* Talk like a person.
+* Simpler is better.
+* Be brief. Give customers just enough information to make decisions confidently. Prune excess words.
+* Break up long sentences.
+* Follow the style of the [Microsoft Writing Style Guide](https://learn.microsoft.com/style-guide/welcome/). If there's a conflict between the following guidelines and the Microsoft Writing Style Guide, ask how to resolve it.
+
+## Grammar
+
+* Use present tense verbs (is, open) instead of past tense (was, opened). For example, "The method returns a value" instead of "The method will return a value."
+* Write factual statements and direct commands. Avoid hypotheticals.
+* Use active voice where the subject performs the action.
+* Write in second person (you) to speak directly to readers.
+* Use gender-neutral language.
+* Avoid multiple -ing words that could create ambiguity.
+* Keep prepositional phrases simple and clear.
+* Place modifiers close to what they modify.
+* Use a conversational tone with contractions.
+* Don't use "we" or "our" to refer to the authors of the documentation.
+* Use the imperative mood for instructions. For example, "Call the method" instead of "You should call the method."
+* Use "might" instead of "may" to indicate possibility. For example, "This method might throw an exception" instead of "This method may throw an exception."
+* Use the Oxford comma in lists of three or more items.
+
+## Capitalization
+
+* Use sentence-style capitalization for everything except proper nouns.
+* Always capitalize proper nouns.
+* Don’t capitalize the spelled-out form of an acronym unless it's a proper noun.
+* Use title-style capitalization for product and service names.
+* Don't use all uppercase for emphasis.
+
+## Numbers
+
+* Spell out numbers for zero through nine, unless space is limited. Use numerals for 10 and above.
+* Spell out numbers at the beginning of a sentence.
+* Spell out ordinal numbers such as first, second, and third. Don't add -ly to form adverbs from ordinal numbers.
+* Number ordered list items all as "1." instead of "1.", "2.", etc. Use bullets for unordered lists.
+
+## Punctuation
+
+* Use short, simple sentences.
+* End all sentences with a period.
+* Use one space after punctuation marks.
+* After a colon, capitalize only proper nouns.
+* Avoid semicolons - use separate sentences instead.
+* Use question marks sparingly.
+* Don't use slashes (/) - use "or" instead.
+
+## Text formatting
+
+* UI elements, like menu items, dialog names, and names of text boxes, should be in **bold** text.
+* Use `code style` for:
+ * Code elements, like method names, property names, and language keywords.
+ * SQL commands.
+ * NuGet package names.
+ * Command-line commands.
+ * Database table and column names.
+ * Resource names (like virtual machine names) that shouldn't be localized.
+ * URLs that you don't want to be selectable.
+ * File names and folders, custom types, and other text that should never be localized.
+* For code placeholders, if you want users to replace part of an input string with their own values, use angle brackets (less than < and greater than > characters) on that placeholder text.
+
+## Headings
+
+* Headings should be in sentence case, not title case. Don't use gerunds in titles.
+* Don't apply an inline style like italic, or bold to headings. But do use inline code style for headings that are code elements, like method names or property names.
+
+## Alerts
+
+* Alerts are a Markdown extension to create block quotes that render with colors and icons that indicate the significance of the content. The following alert types are supported:
+
+ * `[!NOTE]` Information the user should notice even if skimming.
+ * `[!TIP]` Optional information to help a user be more successful.
+ * `[!IMPORTANT]` Essential information required for user success.
+ * `[!CAUTION]` Negative potential consequences of an action.
+ * `[!WARNING]` Dangerous certain consequences of an action.
+
+## Adding links
+
+* Add links to related topics and resources where appropriate.
+* Links to other documentation articles should be relative, not absolute. Start relative links with `/docs/` and include the `.md` suffix. If you add a link to another page on learn.microsoft.com that's not in this repo, remove https://learn.microsoft.com/en-us from the link.
+* Links to bookmarks within the same article should be relative and start with `#`.
+* Link descriptions should be descriptive and make sense on their own. Don't use "click here" or "this link" or "here".
+* When you are going to refer to another file or an article on the web, use this format: "For more information, see [descriptive name of link](link path)." The exception to this is the See Also links at the end of an article. Those should be markdown links and contain the title of the article you link to as the descriptive portion of the link.
+
+## Adding new files
+
+* If you add a new Markdown file, it should be named in all lowercase with hyphens separating words. Also, omit any filler words such as "the" or "a" from the file name.
+* If you're adding a new Markdown file, the following indicates where it should go the folder structure. If you aren't sure, ask.
+ If the new file is about Linux, put it in the docs/linux folder.
+ If the new file is about the C++ Standard Template Library (STL), put it in the docs/standard-library folder.
+ If the new file is about the C runtime, put it in the docs/c-runtime-library folder.
+ If the new file is about the C++ language, put it in the docs/cpp folder.
+ If the new file is about a C++ feature specific to the Visual Studio IDE, put it in the docs/ide folder.
+ If the new file is about the build process or modules, put it in the docs/build\reference folder.
+ If the new file is about Build Insights, put it in the docs/build-insights folder.
+
+## Images
+
+* Use images only when they add value.
+* Images have a descriptive and meaningful alt text that starts with "Screenshot showing" and ends with ".".
+* Videos have a descriptive and meaningful alt text or title that starts with "Video showing" and ends with ".".
+
+## Numbered steps
+
+* Write complete sentences with capitalization and periods
+* Use imperative verbs
+* Clearly indicate where actions take place (UI location)
+* For single steps, use a bullet instead of a number
+* When allowed, use angle brackets for menu sequences (File > Open)
+
+## Terminology
+
+* Use "Select" instead of "Click" for UI elements like buttons, menu items, links, dropdowns, and checkboxes.
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 50628e8f13..10b0192bf5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,7 +7,7 @@ _themes.MSDN.Modern/
_themes.VS.Modern/
# Ignore local configuration changes
-.github/
+#.github/
.openpublishing.buildcore.ps1
.vscode/
diff --git a/.openpublishing.build.ps1 b/.openpublishing.build.ps1
deleted file mode 100644
index aadef76202..0000000000
--- a/.openpublishing.build.ps1
+++ /dev/null
@@ -1,17 +0,0 @@
-param(
- [string]$buildCorePowershellUrl = "https://opbuildstorageprod.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1",
- [string]$parameters
-)
-# Main
-$errorActionPreference = 'Stop'
-
-# Step-1: Download buildcore script to local
-echo "download build core script to local with source url: $buildCorePowershellUrl"
-$repositoryRoot = Split-Path -Parent $MyInvocation.MyCommand.Definition
-$buildCorePowershellDestination = "$repositoryRoot\.openpublishing.buildcore.ps1"
-Invoke-WebRequest $buildCorePowershellUrl -OutFile "$buildCorePowershellDestination"
-
-# Step-2: Run build core
-echo "run build core script with parameters: $parameters"
-& "$buildCorePowershellDestination" "$parameters"
-exit $LASTEXITCODE
diff --git a/.openpublishing.publish.config.json b/.openpublishing.publish.config.json
index f5a51a2a9d..296bfe4f38 100644
--- a/.openpublishing.publish.config.json
+++ b/.openpublishing.publish.config.json
@@ -25,14 +25,11 @@
}
],
"notification_subscribers": [],
- "sync_notification_subscribers": null,
+ "sync_notification_subscribers": [],
"branches_to_filter": [],
- "git_repository_url_open_to_public_contributors": "https://github.com/Microsoft/cpp-docs",
- "git_repository_branch_open_to_public_contributors": "master",
- "skip_source_output_uploading": false,
+ "git_repository_url_open_to_public_contributors": "https://github.com/MicrosoftDocs/cpp-docs",
+ "git_repository_branch_open_to_public_contributors": "main",
"need_preview_pull_request": true,
- "enable_incremental_build": true,
- "contribution_branch_mappings": null,
"dependent_repositories": [
{
"path_to_root": "_themes",
@@ -57,15 +54,16 @@
"Pdf"
]
},
- "need_generate_pdf_url_template": true,
"targets": {
"Pdf": {
"template_folder": "_themes.pdf"
}
},
+ "docs_build_engine": {},
+ "skip_source_output_uploading": false,
+ "enable_incremental_build": true,
+ "contribution_branch_mappings": null,
+ "need_generate_pdf_url_template": true,
"need_generate_pdf": false,
- "need_generate_intellisense": false,
- "docs_build_engine": {
- "name": "docfx_v3"
- }
+ "need_generate_intellisense": false
}
\ No newline at end of file
diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json
index d1cfe5032a..e6910b5922 100644
--- a/.openpublishing.redirection.json
+++ b/.openpublishing.redirection.json
@@ -1,5 +1,10 @@
{
"redirections": [
+ {
+ "source_path": "docs/windows/desktop-applications-visual-cpp.md",
+ "redirect_url": "/cpp/windows/overview-of-windows-programming-in-cpp",
+ "redirect_document_id": true
+ },
{
"source_path": "docs/cpp-conformance-improvements-2017.md",
"redirect_url": "/cpp/overview/cpp-conformance-improvements",
@@ -860,6 +865,21 @@
"redirect_url": "/cpp/build/reference/running-nmake",
"redirect_document_id": false
},
+ {
+ "source_path": "docs/build/manifest-generation-in-visual-studio.md",
+ "redirect_url": "/cpp/build/understanding-manifest-generation-for-c-cpp-programs#manifest-generation-in-visual-studio",
+ "redirect_document_id": false
+ },
+ {
+ "source_path": "docs/build/manifest-generation-at-the-command-line.md",
+ "redirect_url": "/cpp/build/understanding-manifest-generation-for-c-cpp-programs#manifest-generation-at-the-command-line",
+ "redirect_document_id": false
+ },
+ {
+ "source_path": "docs/build/how-to-embed-a-manifest-inside-a-c-cpp-application.md",
+ "redirect_url": "/cpp/build/understanding-manifest-generation-for-c-cpp-programs#how-to-embed-a-manifest-inside-a-c-cpp-application",
+ "redirect_document_id": false
+ },
{
"source_path": "docs/build/unwind-data-for-exception-handling-debugger-support.md",
"redirect_url": "/cpp/build/exception-handling-x64",
@@ -7730,6 +7750,21 @@
"redirect_url": "/cpp/error-messages/compiler-errors-2/compiler-errors-c2500-through-c2599",
"redirect_document_id": false
},
+ {
+ "source_path": "docs/error-messages/compiler-errors-1/fatal-error-c999.md",
+ "redirect_url": "/cpp/error-messages/compiler-errors-1/c-cpp-build-errors",
+ "redirect_document_id": false
+ },
+ {
+ "source_path": "docs/error-messages/compiler-errors-1/fatal-error-c1000-c1999.md",
+ "redirect_url": "/cpp/error-messages/compiler-errors-1/c-cpp-build-errors",
+ "redirect_document_id": false
+ },
+ {
+ "source_path": "docs/error-messages/compiler-warnings/compiler-warning-level-1-c4999.md",
+ "redirect_url": "/cpp/error-messages/compiler-errors-1/c-cpp-build-errors",
+ "redirect_document_id": false
+ },
{
"source_path": "docs/error-messages/compiler-warnings/index.md",
"redirect_url": "/cpp/error-messages/compiler-warnings/compiler-warnings-c4000-through-c4199",
@@ -13724,6 +13759,11 @@
"source_path": "docs/c-runtime-library/operator-new-crt.md",
"redirect_url": "docs/c-runtime-library/new-operator-crt",
"redirect_document_id": false
+ },
+ {
+ "source_path": "docs/overview/whats-new-cpp-docs.md",
+ "redirect_url": "../../cpp/overview/what-s-new-for-visual-cpp-in-visual-studio",
+ "redirect_document_id": false
}
]
-}
+}
\ No newline at end of file
diff --git a/.whatsnew.json b/.whatsnew.json
index 6c3360626c..a5807f933e 100644
--- a/.whatsnew.json
+++ b/.whatsnew.json
@@ -1,5 +1,5 @@
{
- "$schema": "https://whatsnewapi.azurewebsites.net/schema",
+ "$schema": "https://github.com/dotnet/docs-tools/blob/main/WhatsNew.Infrastructure/Configuration/reposettings.schema.json",
"docSetProductName": "C++, C, and Assembler",
"rootDirectory": "docs/",
"docLinkSettings": {
@@ -10,10 +10,18 @@
"minAdditionsToFile": 2,
"pullRequestTitlesToIgnore": [
"^Confirm merge from FromPublicMasterBranch",
- "^Repo sync for protected CLA branch"
+ "^Repo sync for protected CLA branch",
+ "^Repo sync for protected branch"
],
"omitPullRequestTitles": false
},
+ "navigationOptions": {
+ "maximumNumberOfArticles": 2,
+ "tocParentNode": " ",
+ "repoTocFolder": " ",
+ "indexParentNode": " ",
+ "repoIndexFolder": " "
+ },
"areas": [
{"names": ["assembler", "intrinsics"], "heading": "C/C++ compiler intrinsics and assembly language"},
{"names": ["atl", "atl-mfc-shared", "mfc"], "heading": "Active Template Library (ATL), Microsoft Foundation Classes (MFC)"},
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index a52d3bc599..bbfa443111 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,13 +2,13 @@
Thank you for your interest in contributing to the Visual C++ documentation!
-In this topic, you'll see the basic process for adding or updating content in the [Visual C++ documentation site](https://docs.microsoft.com/cpp).
+In this topic, you'll see the basic process for adding or updating content in the [Visual C++ documentation site](https://learn.microsoft.com/cpp/).
In this topic, we'll cover:
- [Process for contributing](#process-for-contributing)
- [DOs and DON'Ts](#dos-and-donts)
-- [Building the docs](#building-the-docs)
+- [Building the documentation](#building-the-documentation)
- [Contributing to samples](#contributing-to-samples)
- [Contributor license agreement](#contributor-license-agreement)
@@ -44,7 +44,7 @@ docs
wstring-conversion.png
```
-**Step 5:** Submit a Pull Request (PR) from your branch to `MicrosoftDocs/cpp-docs/master`.
+**Step 5:** Submit a Pull Request (PR) from your branch to `MicrosoftDocs/cpp-docs/main`.
If your PR is addressing an existing issue, add the `Fixes #Issue_Number` keyword to the commit message or PR description, so the issue can be automatically closed when the PR is merged. For more information, see [Closing issues via commit messages](https://help.github.com/articles/closing-issues-via-commit-messages/).
@@ -52,9 +52,9 @@ The Visual Studio team will review your PR and let you know if the change looks
**Step 6:** Make any necessary updates to your branch as discussed with the team.
-The maintainers will merge your PR into the master branch once feedback has been applied and your change looks good.
+The maintainers will merge your PR into the main branch once feedback has been applied and your change looks good.
-On a certain cadence, we push all commits from master branch into the live branch and then you'll be able to see your contribution live on [docs.microsoft.com](https://docs.microsoft.com/cpp/).
+On a certain cadence, we push all commits from main branch into the live branch and then you'll be able to see your contribution on [Microsoft Learn](https://learn.microsoft.com/cpp/).
## DOs and DON'Ts
@@ -70,11 +70,11 @@ Below is a short list of guiding rules that you should keep in mind when you are
> [!NOTE]
> You might notice that some of the topics are not currently following all the guidelines specified here and on the [style guide](./styleguide/template.md) as well. We're working towards achieving consistency throughout the site. Check the list of [open issues](https://github.com/MicrosoftDocs/cpp-docs/issues?q=is%3Aissue+is%3Aopen+label%3Aguidelines-adherence) we're currently tracking for that specific goal.
-## Building the docs
+## Building the documentation
-The documentation is written in [GitHub Flavored Markdown](https://help.github.com/categories/writing-on-github/) and built using [DocFX](https://dotnet.github.io/docfx/) and other internal publishing/building tools. It is hosted at [docs.microsoft.com](https://docs.microsoft.com/).
+The documentation is written in [GitHub-Flavored Markdown](https://help.github.com/categories/writing-on-github/) and built using [DocFX](https://dotnet.github.io/docfx/) and other internal publishing and build tools. It's published to [Microsoft Learn](https://learn.microsoft.com/).
-If you want to build the docs locally, you need to install [DocFX](https://dotnet.github.io/docfx/); latest versions are the best.
+If you want to build the documentation locally, you need to install the latest version of [DocFX](https://dotnet.github.io/docfx/).
There are several ways to use DocFX, and most of them are covered in the [DocFX getting started guide](https://dotnet.github.io/docfx/tutorial/docfx_getting_started.html). The following instructions use the [command-line based](https://dotnet.github.io/docfx/tutorial/docfx_getting_started.html#2-use-docfx-as-a-command-line-tool) version of the tool. If you are comfortable with other ways listed on the link above, feel free to use those.
@@ -94,6 +94,6 @@ For now, include required sample code as inline code blocks in your article. The
## Contributor license agreement
-You must sign the [Contribution License Agreement (CLA)](LICENSE) before your PR is merged. This is a one-time requirement for projects in docs.microsoft.com. You can read more about [Contribution License Agreements (CLA)](https://en.wikipedia.org/wiki/Contributor_License_Agreement) on Wikipedia.
+You must sign the [Contribution License Agreement (CLA)](LICENSE) before your PR is merged. This is a one-time requirement for projects on Microsoft Learn. You can read more about [Contribution License Agreements (CLA)](https://en.wikipedia.org/wiki/Contributor_License_Agreement) on Wikipedia.
You don't have to sign the agreement up-front. You can clone, fork, and submit your PR as usual. When your PR is created, it is classified by a CLA bot. If the change is trivial (for example, you fixed a typo), then the PR is labeled with CLA-not-required. Otherwise, it's classified as CLA-required. Once you signed the CLA, the current and all future pull requests are labeled as CLA-signed.
diff --git a/README.md b/README.md
index a02389709b..816a2293bf 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,14 @@
-# Visual Studio documentation for Microsoft C++
+# Microsoft C++, C, and Assembler documentation
-Welcome! This repository contains source files for the work-in-progress Microsoft C++ (MSVC or Visual C++) technical documentation. The articles are published on the [C++ in Visual Studio documentation site](https://docs.microsoft.com/cpp).
+Welcome! This repository contains source files for the technical documentation published on [https://learn.microsoft.com/cpp](https://learn.microsoft.com/cpp).
-The documentation for Visual Basic and Visual C# are located in a separate repository at [https://github.com/dotnet/core-docs](https://github.com/dotnet/core-docs), and the Visual Studio documentation is located in the repository located at [https://github.com/Microsoft/visualstudio-docs](https://github.com/Microsoft/visualstudio-docs).
+The documentation for [.NET](https://github.com/dotnet/docs) and [Visual Studio](https://github.com/MicrosoftDocs/visualstudio-docs) are located in separate repositories.
## Contributing to the documentation
-We welcome your contributions to help us improve the MSVC docs. For a comprehensive guide to contributing to docs.microsoft.com, see the [Microsoft Docs contributor guide overview](https://docs.microsoft.com/contribute). For details on how to make a contribution to the MSVC documentation, see the [Contributing guide](CONTRIBUTING.md).
+We welcome your contributions to help us improve the MSVC docs. For a comprehensive guide to contributing, see the [Microsoft Docs contributor guide](https://learn.microsoft.com/contribute). For details on how to make a contribution to the MSVC documentation, see our [Contributing guidance](CONTRIBUTING.md).
-Several feature areas of MSVC have their own folders in this repository, such as `standard-library` for articles on the C++ Standard Library, `ide` for C++-specific articles on the Visual Studio interactive development environment (IDE), and so forth. The `/media` subfolder in each folder contains art files for the articles. The [Contributing guide](CONTRIBUTING.md) has more information.
+Several feature areas of MSVC have their own folders in this repository, such as `standard-library` for articles on the C++ Standard Library, `ide` for C++-specific articles on the Visual Studio integrated development environment (IDE), and so forth. The `/media` subfolder in each folder contains art files for the articles. The [Contributing guide](CONTRIBUTING.md) has more information.
## Microsoft Open Source Code of Conduct
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 0000000000..675ad2a215
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,41 @@
+
+
+## Security
+
+Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, such as [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), and [our GitHub organizations](https://opensource.microsoft.com/).
+
+If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
+
+## Reporting Security Issues
+
+**Please do not report security vulnerabilities through public GitHub issues.**
+
+Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
+
+If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
+
+You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
+
+Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
+
+ * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
+ * Full paths of source file(s) related to the manifestation of the issue
+ * The location of the affected source code (tag/branch/commit or direct URL)
+ * Any special configuration required to reproduce the issue
+ * Step-by-step instructions to reproduce the issue
+ * Proof-of-concept or exploit code (if possible)
+ * Impact of the issue, including how an attacker might exploit the issue
+
+This information will help us triage your report more quickly.
+
+If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
+
+## Preferred Languages
+
+We prefer all communications to be in English.
+
+## Policy
+
+Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
+
+
diff --git a/docs/_breadcrumb/toc.yml b/docs/_breadcrumb/toc.yml
index efaed4b8a9..363d1dad6b 100644
--- a/docs/_breadcrumb/toc.yml
+++ b/docs/_breadcrumb/toc.yml
@@ -1,129 +1,3 @@
-items:
-- name: Docs
- tocHref: /
- topicHref: /
- items:
- - name: Microsoft C++, C, and Assembler
- tocHref: /cpp/
- topicHref: /cpp/index
- items:
- - name: Compiler intrinsics and assembly language
- tocHref: /cpp/intrinsics/
- topicHref: /cpp/intrinsics/index
- items:
- - name: Compiler intrinsics
- tocHref: /cpp/intrinsics/
- topicHref: /cpp/intrinsics/compiler-intrinsics
- - name: ARM and ARM64 assembler
- tocHref: /cpp/assembler/arm/
- topicHref: /cpp/assembler/arm/arm-assembler-reference
- - name: C/C++ x86 inline assembler
- tocHref: /cpp/assembler/inline/
- topicHref: /cpp/assembler/inline/inline-assembler
- - name: x86 and x64 assembler
- tocHref: /cpp/assembler/masm/
- topicHref: /cpp/assembler/masm/microsoft-macro-assembler-reference
- - name: ATL
- tocHref: /cpp/atl/
- topicHref: /cpp/atl/atl-com-desktop-components
- - name: ATL/MFC shared classes
- tocHref: /cpp/atl-mfc-shared/
- topicHref: /cpp/atl-mfc-shared/atl-mfc-shared-classes
- items:
- - name: ATL/MFC reference
- tocHref: /cpp/atl-mfc-shared/reference/
- topicHref: /cpp/atl-mfc-shared/reference/classes-shared-by-mfc-and-atl
- - name: Build C/C++ projects
- tocHref: /cpp/build/
- topicHref: /cpp/build/building-c-cpp-programs
- items:
- - name: Build reference
- tocHref: /cpp/build/reference/
- topicHref: /cpp/build/reference/c-cpp-building-reference
- - name: Build insights
- tocHref: /cpp/build-insights/
- topicHref: /cpp/build-insights/index
- - name: C language
- tocHref: /cpp/c-language/
- topicHref: /cpp/c-language/index
- - name: C runtime library
- tocHref: /cpp/c-runtime-library/
- topicHref: /cpp/c-runtime-library/c-run-time-library-reference
- items:
- - name: UCRT reference
- tocHref: /cpp/c-runtime-library/reference/
- topicHref: /cpp/c-runtime-library/reference/crt-alphabetical-function-reference
- - name: Cloud and web
- tocHref: /cpp/cloud/
- topicHref: /cpp/cloud/cloud-and-web-programming-in-visual-cpp
- - name: Code analysis
- tocHref: /cpp/code-quality/
- topicHref: /cpp/code-quality/index
- - name: Code sanitizers
- tocHref: /cpp/sanitizers/
- topicHref: /cpp/sanitizers/index
- - name: C++ language
- tocHref: /cpp/cpp/
- topicHref: /cpp/cpp/index
- - name: C++/CX
- tocHref: /cpp/cppcx/
- topicHref: /cpp/cppcx/visual-c-language-reference-c-cx
- - name: Cross-platform mobile development
- tocHref: /cpp/cross-platform/
- topicHref: /cpp/cross-platform/index
- - name: Data access
- tocHref: /cpp/data/
- topicHref: /cpp/data/data-access-in-cpp
- items:
- - name: OLEDB
- tocHref: /cpp/data/oledb/
- topicHref: /cpp/data/oledb/ole-db-programming
- - name: ODBC
- tocHref: /cpp/data/odbc/
- topicHref: /cpp/data/odbc/open-database-connectivity-odbc
- - name: C++/CLI for .NET
- tocHref: /cpp/dotnet/
- topicHref: /cpp/dotnet/dotnet-programming-with-cpp-cli-visual-cpp
- - name: Errors and warnings
- tocHref: /cpp/error-messages/
- topicHref: /cpp/error-messages/compiler-errors-1/c-cpp-build-errors
- - name: Edit, navigate, and refactor code
- tocHref: /cpp/ide/
- topicHref: /cpp/ide/read-and-understand-code-cpp
- - name: Linux
- tocHref: /cpp/linux/
- topicHref: /cpp/linux/index
- - name: Linux
- tocHref: /cpp/build/configure-cmake-debugging-sessions
- topicHref: /cpp/linux/index
- - name: MFC
- tocHref: /cpp/mfc/
- topicHref: /cpp/mfc/mfc-desktop-applications
- items:
- - name: MFC reference
- tocHref: /cpp/mfc/reference/
- topicHref: /cpp/mfc/reference/mfc-classes
- - name: Microsoft C/C++
- tocHref: /cpp/overview/
- topicHref: /cpp/overview/visual-cpp-in-visual-studio
- - name: Parallel programming
- tocHref: /cpp/parallel/
- topicHref: /cpp/parallel/parallel-programming-in-visual-cpp
- - name: Porting and upgrading
- tocHref: /cpp/porting/
- topicHref: /cpp/porting/visual-cpp-porting-and-upgrading-guide
- - name: C/C++ preprocessor
- tocHref: /cpp/preprocessor/
- topicHref: /cpp/preprocessor/c-cpp-preprocessor-reference
- - name: Security
- tocHref: /cpp/security/
- topicHref: /cpp/security/security-best-practices-for-cpp
- - name: C++ standard library
- tocHref: /cpp/standard-library/
- topicHref: /cpp/standard-library/cpp-standard-library-reference
- - name: Text and strings
- tocHref: /cpp/text/
- topicHref: /cpp/text/text-and-strings-in-visual-cpp
- - name: Windows
- tocHref: /cpp/windows/
- topicHref: /cpp/windows/overview-of-windows-programming-in-cpp
+- name: C++, C, and Assembler
+ tocHref: /cpp/
+ topicHref: /cpp/index
diff --git a/docs/assembler/arm/arm-assembler-command-line-reference.md b/docs/assembler/arm/arm-assembler-command-line-reference.md
index 1d38d10575..6c79ceaf15 100644
--- a/docs/assembler/arm/arm-assembler-command-line-reference.md
+++ b/docs/assembler/arm/arm-assembler-command-line-reference.md
@@ -1,78 +1,119 @@
---
title: "ARM Assembler command-line reference"
description: "Reference guide to the Microsoft ARM assembler command-line options."
-ms.date: "02/09/2020"
-ms.assetid: f7b89478-1ab5-4995-8cde-a805f0462c45
+ms.date: 05/09/2022
---
# ARM Assembler command-line reference
-This article provides command-line information about the Microsoft ARM assembler, **armasm**. **armasm** assembles ARMv7 Thumb assembly language into the Microsoft implementation of the Common Object File Format (COFF). The linker can link COFF code objects produced by both the ARM assembler and the C compiler. It can link either together with object libraries created by the librarian.
+The Microsoft ARM assemblers, **armasm** and **armasm64**, support several command-line options. By default, **armasm** assembles ARMv7 Thumb assembly language into the Microsoft implementation of the Common Object File Format (COFF). The **armasm64** assembler creates COFF object code for ARM64 and ARM64EC targets. The linker can link COFF code objects produced by both the ARM assembler and the C/C++ compiler. It can link either together with object libraries created by the librarian.
## Syntax
> **`armasm`** [*options*] *source_file* *object_file*\
-> **`armasm`** [*options*] **`-o`** *object_file* *source_file*
+> **`armasm`** [*options*] *source_file*
+
+> **`armasm64`** [*options*] *source_file* *object_file*\
+> **`armasm64`** [*options*] *source_file*
### Parameters
*options*\
A combination of zero or more of the following options:
+- **`-16`**\
+ Available only in **armasm**. Assemble source as 16-bit Thumb instructions. This option is the default.
+
+- **`-32`**\
+ Available only in **armasm**. Assemble source as 32-bit ARM instructions.
+
+- **`-coff_thumb2_only`**\
+ Available only in **armasm**. Allow only Thumb-2 code.
+
+- **`-errorReport:`** *option*\
+ This option is deprecated. In Windows Vista and later, error reporting is controlled by [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings.
+
- **`-errors`** *filename*\
- Redirect error and warning messages to *filename*.
+ **`-e`** *filename*\
+ Redirect error and warning messages to *filename*. By default, these messages are sent to `stdout`.
-- **`-i`** *dir*[**`;`**dir]\
- Add the specified directories to the include search path.
+- **`-funcOverride:`** *function_name*\
+ Available only in **armasm64**. Emit function overriding support for *function_name*.
-- **`-predefine`** *directive*\
- Specify a SETA, SETL, or SETS directive to predefine a symbol.\
- Example: `armasm.exe -predefine "COUNT SETA 150" source.asm`\
- For more information, see the [ARM Compiler armasm Reference Guide](https://developer.arm.com/documentation/dui0802/latest/).
+- **`-g`**\
+ Generate debugging information.
-- **`-nowarn`**\
- Disable all warning messages.
+- **`-gh:SHA1`**\
+ Use the SHA-1 cryptographic hash algorithm to generate a checksum of each source file in debug info. Overrides **`-gh:SHA256`**.
-- **`-ignore`** *warning*\
- Disable the specified warning. For possible values, see the section about warnings.
+- **`-gh:SHA256`**\
+ Use the SHA-256 cryptographic hash algorithm to generate a checksum of each source file in debug info. This option is on by default in Visual Studio 2022 version 17.0 and later.
+
+- **`-guard:ehcont`**[**`-`**]\
+ Generate a sorted list of the relative virtual addresses (RVA) of all the valid exception handling continuation targets for a binary. It's used at runtime for `NtContinue` and `SetThreadContext` instruction pointer validation. By default, **`-guard:ehcont`** is off and must be explicitly enabled. To explicitly disable this option, use **`-guard:ehcont-`**. This option is available in Visual Studio 2019 version 16.7 and later. The feature is supported for 64-bit processes on a 64-bit OS.
- **`-help`**\
- Print the command-line help message.
+ **`-h`**\
+ Print the command-line help message.
+
+- **`-i`** *dir*[**`;`** *dir*]\
+ Add one or more specified directories to the include search path. Separate directories by using a semi-colon (`;`).
+
+- **`-ignore`** *warning_number*\
+ Disable the specified warning number. For possible values, see [ARM Assembler diagnostic messages](arm-assembler-diagnostic-messages.md).
+
+- **`-list`** *list_file*\
+ Create a detailed listing of the generated assembly language to *list_file*. The *list_file* parameter is optional. If it's omitted, the assembler appends *`.lst`* to the base name of *source_file* to create the listing file.
- **`-machine`** *machine*\
- Specify the machine type to set in the PE header. Possible values for *machine* are:\
- **ARM**—Sets the machine type to IMAGE_FILE_MACHINE_ARMNT. This option is the default.\
- **THUMB**—Sets the machine type to IMAGE_FILE_MACHINE_THUMB.
+ Specify the machine type to set in the PE header. In **armasm**, possible values for *machine* are:
+ - **ARM**—Sets the machine type to `IMAGE_FILE_MACHINE_ARMNT`. This option is the default.
+ - **THUMB**—Sets the machine type to `IMAGE_FILE_MACHINE_THUMB`.
-- **`-oldit`**\
- Generate ARMv7-style IT blocks. By default, ARMv8-compatible IT blocks are generated.
+ In **armasm64**, possible values are:
+ - **ARM64**—Sets the machine type to `IMAGE_FILE_MACHINE_ARM64`. This option is the default.
+ - **ARM64EC**—Sets the machine type to `IMAGE_FILE_MACHINE_ARM64EC`.
-- **`-via`** *filename*\
- Read additional command-line arguments from *filename*.
+- **`-noesc`**\
+ **`-noe`**\
+ Ignore C-style escaped special characters, such as `\n` or `\t`.
-- **`-16`**\
- Assemble source as 16-bit Thumb instructions. This option is the default.
+- **`-nologo`**\
+ Suppress the copyright banner.
-- **`-32`**\
- Assemble source as 32-bit ARM instructions.
+- **`-nowarn`**\
+ **`-now`**\
+ Disable all warning messages.
-- **`-g`**\
- Generate debugging information.
+- **`-o`** *object_file*\
+ Specify the name of the object (output) file. The **`-o`** option is optional; you can instead specify an object file name as the last element of the command line.
-- **`-errorReport:`** *option*\
- This option is deprecated. Starting in Windows Vista, error reporting is controlled by [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings.
+- **`-oldit`**\
+ Available only in **armasm**. Generate ARMv7-style IT blocks. By default, ARMv8-compatible IT blocks are generated.
+
+- **`-predefine`** *directive*\
+ **`-pd`** *directive*\
+ Specify a SETA, SETL, or SETS directive to predefine a symbol.\
+ Example: `armasm.exe -predefine "COUNT SETA 150" source.asm`\
+ For more information, see the [ARM Compiler armasm Reference Guide](https://developer.arm.com/documentation/dui0802/latest/).
+
+- **`-sourcelink:`** *sourcelink_filename*\
+ *sourcelink_filename* specifies a JSON-formatted configuration file that contains a simple mapping of local file paths to URLs for source files to display in the debugger. For more information on the format of this file, see [Source Link JSON Schema](https://github.com/dotnet/designs/blob/main/accepted/2020/diagnostics/source-link.md#source-link-json-schema). Source Link is a language- and source-control agnostic system for providing source debugging for binaries. Source Link is supported for native binaries starting in Visual Studio 2017 version 15.8. For an overview of Source Link, see [Source Link](https://github.com/dotnet/designs/blob/main/accepted/2020/diagnostics/source-link.md). For information on how to use Source Link in your projects, and how to generate the SourceLink file as part of your project, see [Using Source Link](https://github.com/dotnet/sourcelink#using-source-link-in-c-projects).
+
+- **`-via`** *filename*\
+ Read extra command-line arguments from *filename*.
*source_file*\
The name of the source file.
*object_file*\
-The name of the object (output) file.
+The last element of the command line can specify the name of the object (output) file. If it's omitted, and no **`-o`** option is specified, the assembler appends *`.obj`* to the base name of *source_file* to create the object file.
## Remarks
The following example demonstrates how to use armasm in a typical scenario. First, use armasm to build an assembly language source (.asm) file to an object (.obj) file. Then, use the CL command-line C compiler to compile a source (.c) file, and also specify the linker option to link the ARM object file.
```cmd
-armasm myasmcode.asm -o myasmcode.obj
+armasm -o myasmcode.obj myasmcode.asm
cl myccode.c /link myasmcode.obj
```
diff --git a/docs/assembler/arm/arm-assembler-diagnostic-messages.md b/docs/assembler/arm/arm-assembler-diagnostic-messages.md
index 1215580189..ebe3253ac4 100644
--- a/docs/assembler/arm/arm-assembler-diagnostic-messages.md
+++ b/docs/assembler/arm/arm-assembler-diagnostic-messages.md
@@ -1,24 +1,24 @@
---
description: "Learn more about: ARM Assembler diagnostic messages"
title: "ARM Assembler diagnostic messages"
-ms.date: "08/30/2018"
+ms.date: 05/09/2022
f1_keywords: ["A2193", "A2196", "A2202", "A2513", "A2557", "A4228", "A4508", "A4509"]
helpviewer_keywords: ["A2193", "A2196", "A2202", "A2513", "A2557", "A4228", "A4508", "A4509"]
ms.assetid: 52b38267-6023-4bdc-a0ef-863362f48eec
---
# ARM Assembler diagnostic messages
-The Microsoft ARM assembler (*armasm*) emits diagnostic warnings and errors when it encounters them. This article describes the most commonly-encountered messages.
+The Microsoft ARM assemblers, **armasm** and **armasm64**, emit diagnostic warnings and errors when they encounter them. This article describes the most commonly encountered messages.
## Syntax
-> filename**(**line-number**) :** \[**error**|**warning**] **A**number**:** *message*
+> *filename* **(** *line-number* **) :** \[**error**|**warning**] **A** *number* **:** *message*
## Diagnostic messages - Errors
> A2193: this instruction generates unpredictable behavior
-The ARM architecture cannot guarantee what happens when this instruction is executed. For details about the well-defined forms of this instruction, consult the [ARM Architecture Reference Manual](https://go.microsoft.com/fwlink/p/?linkid=246464).
+The ARM architecture can't guarantee what happens when this instruction is executed. For details about the well-defined forms of this instruction, consult the [ARM Architecture Reference Manual](https://go.microsoft.com/fwlink/p/?linkid=246464).
```asm
ADD r0, r8, pc ; A2193: this instruction generates unpredictable behavior
@@ -26,22 +26,22 @@ The ARM architecture cannot guarantee what happens when this instruction is exec
> A2196: instruction cannot be encoded in 16 bits
-The specified instruction cannot be encoded as a 16-bit Thumb instruction. Specify a 32-bit instruction, or rearrange code to bring the target label into the range of a 16-bit instruction.
+The specified instruction can't be encoded as a 16-bit Thumb instruction. Specify a 32-bit instruction, or rearrange code to bring the target label into the range of a 16-bit instruction.
The assembler may attempt to encode a branch in 16 bits and fail with this error, even though a 32-bit branch is encodable. You can solve this problem by using the `.W` specifier to explicitly mark the branch as 32-bit.
```asm
- ADD.N r0, r1, r2 ; A2196: instruction cannot be encoded in 16 bits
+ ADD.N r0, r1, r2 ; A2196: instruction can't be encoded in 16 bits
B.W label ; OK
- B.N label ; A2196: instruction cannot be encoded in 16 bits
+ B.N label ; A2196: instruction can't be encoded in 16 bits
SPACE 10000
label
```
> A2202: Pre-UAL instruction syntax not allowed in THUMB region
-Thumb code must use the Unified Assembler Language (UAL) syntax. The old syntax is no longer accepted
+Thumb code must use the Unified Assembler Language (UAL) syntax. The old syntax is no longer accepted
```asm
ADDEQS r0, r1 ; A2202: Pre-UAL instruction syntax not allowed in THUMB region
@@ -50,7 +50,7 @@ Thumb code must use the Unified Assembler Language (UAL) syntax. The old syntax
> A2513: Rotation must be even
-In ARM mode, there is an alternate syntax for specifying constants. Instead of writing `#`, you can write `#,#`, which represents the constant value that is obtained by rotating the value `` right by ``. When you use this syntax, you must make the value of `` even.
+In ARM mode, there's an alternate syntax for specifying constants. Instead of writing `#`, you can write `#,#`, which represents the constant value that's obtained by rotating the value `` right by ``. When you use this syntax, you must make the value of `` even.
```asm
MOV r0, #4, #2 ; OK
@@ -59,7 +59,7 @@ In ARM mode, there is an alternate syntax for specifying constants. Instead of
> A2557: Incorrect number of bytes to write back
-On the NEON structure load and store instructions (`VLDn`, `VSTn`), there is an alternate syntax for specifying writeback to the base register. Instead of putting an exclamation point (!) after the address, you can specify an immediate value that indicates the offset to be added to the base register. If you use this syntax, you must specify the exact number of bytes that were loaded or stored by the instruction.
+On the NEON structure load and store instructions (`VLDn`, `VSTn`), there's an alternate syntax for specifying writeback to the base register. Instead of putting an exclamation point (!) after the address, you can specify an immediate value that indicates the offset to be added to the base register. If you use this syntax, you must specify the exact number of bytes that were loaded or stored by the instruction.
```asm
VLD1.8 {d0-d3}, [r0]! ; OK
@@ -71,9 +71,9 @@ On the NEON structure load and store instructions (`VLDn`, `VSTn`), there is an
> A4228: Alignment value exceeds AREA alignment; alignment not guaranteed
-The alignment that is specified in an `ALIGN` directive is greater than the alignment of the enclosing `AREA`. As a result, the assembler cannot guarantee that the `ALIGN` directive will be honored.
+The alignment that's specified in an `ALIGN` directive is greater than the alignment of the enclosing `AREA`. As a result, the assembler can't guarantee that the `ALIGN` directive will be honored.
-To fix this, you can specify on the `AREA` directive an `ALIGN` attribute that is equal to or greater than the desired alignment.
+To fix this warning, you can specify on the `AREA` directive an `ALIGN` attribute that's equal to or greater than the desired alignment.
```asm
AREA |.myarea1|
@@ -85,7 +85,7 @@ ALIGN 8 ; OK
> A4508: Use of this rotated constant is deprecated
-In ARM mode, there is an alternate syntax for specifying constants. Instead of writing `#`, you can write `#,#`, which represents the constant value that is obtained by rotating the value `` right by ``. In some contexts, ARM has deprecated the use of these rotated constants. In these cases, use the basic `#` syntax instead.
+In ARM mode, there's an alternate syntax for specifying constants. Instead of writing `#`, you can write `#,#`, which represents the constant value that's obtained by rotating the value `` right by ``. In some contexts, ARM has deprecated the use of these rotated constants. In these cases, use the basic `#` syntax instead.
```asm
ANDS r0, r0, #1 ; OK
@@ -96,7 +96,7 @@ In ARM mode, there is an alternate syntax for specifying constants. Instead of
This form of conditional instruction has been deprecated by ARM in the ARMv8 architecture. We recommend that you change the code to use conditional branches. To see which conditional instructions are still supported, consult the [ARM Architecture Reference Manual](https://go.microsoft.com/fwlink/p/?linkid=246464).
-This warning is not emitted when the **-oldit** command-line switch is used.
+This warning isn't emitted when the **`-oldit`** command-line switch is used.
```asm
ADDEQ r0, r1, r8 ; A4509: This form of conditional instruction is deprecated
diff --git a/docs/assembler/arm/arm-assembler-reference.md b/docs/assembler/arm/arm-assembler-reference.md
index 2503bb20ca..905ab3a72a 100644
--- a/docs/assembler/arm/arm-assembler-reference.md
+++ b/docs/assembler/arm/arm-assembler-reference.md
@@ -1,20 +1,20 @@
---
-description: "Learn more about: ARM Assembler Reference"
-title: "ARM Assembler Reference"
-ms.date: "08/28/2017"
+description: "Learn more about: ARM Assembler reference"
+title: "ARM Assembler reference"
+ms.date: 05/09/2022
ms.assetid: f8a076cc-9627-4328-a34a-9c44f7a3aab1
---
-# ARM Assembler Reference
+# ARM Assembler reference
-The articles in this section of the documentation provide reference material for the Microsoft ARM assembler (armasm) and related tools.
+The articles in this section of the documentation provide reference material for the Microsoft ARM assembler (**armasm** or **armasm64**) and related tools.
-## Related Articles
+## Related articles
|Title|Description|
|-----------|-----------------|
-|[ARM Assembler Command-Line Reference](../../assembler/arm/arm-assembler-command-line-reference.md)|Describes the armasm command-line options.|
-|[ARM Assembler Diagnostic Messages](../../assembler/arm/arm-assembler-diagnostic-messages.md)|Describes commonly seen armasm warning and error messages.|
-|[ARM Assembler Directives](../../assembler/arm/arm-assembler-directives.md)|Describes the ARM directives that are different in armasm.|
+|[ARM Assembler command-line reference](../../assembler/arm/arm-assembler-command-line-reference.md)|Describes the Microsoft armasm and armasm64 command-line options.|
+|[ARM Assembler diagnostic messages](../../assembler/arm/arm-assembler-diagnostic-messages.md)|Describes commonly seen armasm and armasm64 warning and error messages.|
+|[ARM Assembler directives](../../assembler/arm/arm-assembler-directives.md)|Describes the ARM directives that are different in Microsoft armasm and armasm64.|
|[ARM Architecture Reference Manual](https://developer.arm.com/search#q=ARM%20Architecture%20Reference%20Manual) on the ARM Developer website.|Choose the relevant manual for your ARM architecture. Each contains reference sections about ARM, Thumb, NEON, and VFP, and additional information about the ARM assembly language.|
|[ARM Compiler armasm User Guide](https://developer.arm.com/search#q=ARM%20Compiler%20armasm%20User%20Guide) on the ARM Developer website.|Choose a recent version to find up-to-date information about the ARM assembly language.|
diff --git a/docs/assembler/inline/asm.md b/docs/assembler/inline/asm.md
index edc958759c..0aa4253ef7 100644
--- a/docs/assembler/inline/asm.md
+++ b/docs/assembler/inline/asm.md
@@ -10,20 +10,20 @@ ms.assetid: 77ff3bc9-a492-4b5e-85e1-fa4e414e79cd
**Microsoft Specific**
-The **`__asm`** keyword invokes the inline assembler and can appear wherever a C or C++ statement is legal. It cannot appear by itself. It must be followed by an assembly instruction, a group of instructions enclosed in braces, or, at the very least, an empty pair of braces. The term "**`__asm`** block" here refers to any instruction or group of instructions, whether or not in braces.
+The **`__asm`** keyword invokes the inline assembler and can appear wherever a C or C++ statement is legal. It can't appear by itself. It must be followed by an assembly instruction, a group of instructions enclosed in braces, or, at minimum, an empty pair of braces. The term "**`__asm`** block" here refers to any instruction or group of instructions, whether or not in braces.
> [!NOTE]
> Visual C++ support for the Standard C++ **`asm`** keyword is limited to the fact that the compiler will not generate an error on the keyword. However, an **`asm`** block will not generate any meaningful code. Use **`__asm`** instead of **`asm`**.
## Grammar
-*asm-block*:
- **`__asm`** *assembly-instruction* **`;`**opt
- **`__asm {`** *assembly-instruction-list* **`}`** **`;`**opt
+*asm-block*:\
+ **`__asm`** *assembly-instruction* **`;`**opt\
+ **`__asm {`** *assembly-instruction-list* **`}`** **`;`**opt
-*assembly-instruction-list*:
- *assembly-instruction* **`;`**opt
- *assembly-instruction* **`;`** *assembly-instruction-list* **`;`**opt
+*assembly-instruction-list*:\
+ *assembly-instruction* **`;`**opt\
+ *assembly-instruction* **`;`** *assembly-instruction-list* **`;`**opt
## Remarks
@@ -37,7 +37,7 @@ Before Visual Studio 2005, the instruction
__asm int 3
```
-did not cause native code to be generated when compiled with **/clr**; the compiler translated the instruction to a CLR break instruction.
+didn't cause native code to be generated when compiled with **/clr**; the compiler translated the instruction to a CLR break instruction.
`__asm int 3` now results in native code generation for the function. If you want a function to cause a break point in your code and if you want that function compiled to MSIL, use [__debugbreak](../../intrinsics/debugbreak.md).
@@ -69,9 +69,9 @@ Because the **`__asm`** keyword is a statement separator, you can also put assem
__asm mov al, 2 __asm mov dx, 0xD007 __asm out dx, al
```
-All three examples generate the same code, but the first style (enclosing the **`__asm`** block in braces) has some advantages. The braces clearly separate assembly code from C or C++ code and avoid needless repetition of the **`__asm`** keyword. Braces can also prevent ambiguities. If you want to put a C or C++ statement on the same line as an **`__asm`** block, you must enclose the block in braces. Without the braces, the compiler cannot tell where assembly code stops and C or C++ statements begin. Finally, because the text in braces has the same format as ordinary MASM text, you can easily cut and paste text from existing MASM source files.
+All three examples generate the same code, but the first style (enclosing the **`__asm`** block in braces) has some advantages. The braces clearly separate assembly code from C or C++ code and avoid needless repetition of the **`__asm`** keyword. Braces can also prevent ambiguities. If you want to put a C or C++ statement on the same line as an **`__asm`** block, you must enclose the block in braces. Without the braces, the compiler can't tell where assembly code stops and C or C++ statements begin. Finally, because the text in braces has the same format as ordinary MASM text, you can easily cut and paste text from existing MASM source files.
-Unlike braces in C and C++, the braces enclosing an **`__asm`** block don't affect variable scope. You can also nest **`__asm`** blocks; nesting does not affect variable scope.
+Unlike braces in C and C++, the braces enclosing an **`__asm`** block don't affect variable scope. You can also nest **`__asm`** blocks; nesting doesn't affect variable scope.
**END Microsoft Specific**
diff --git a/docs/assembler/inline/data-directives-and-operators-in-inline-assembly.md b/docs/assembler/inline/data-directives-and-operators-in-inline-assembly.md
index 94f04a2e7e..364313604c 100644
--- a/docs/assembler/inline/data-directives-and-operators-in-inline-assembly.md
+++ b/docs/assembler/inline/data-directives-and-operators-in-inline-assembly.md
@@ -1,18 +1,22 @@
---
description: "Learn more about: Data Directives and Operators in Inline Assembly"
title: "Data Directives and Operators in Inline Assembly"
-ms.date: "08/30/2018"
+ms.date: 06/03/2022
helpviewer_keywords: ["data directives [C++]", "__asm keyword [C++], referencing limitations", "MASM (Microsoft Macro Assembler), directives", "directives [C++], MASM", "MASM (Microsoft Macro Assembler), structures", "operators [MASM]", "inline assembly, operators", "inline assembly, data directives", "MASM (Microsoft Macro Assembler), operators", "structures [C++], MASM"]
ms.assetid: fb7410c7-156a-4131-bcfc-211aa70533e3
---
-# Data Directives and Operators in Inline Assembly
+# Data directives and operators in inline assembly
**Microsoft Specific**
-Although an **`__asm`** block can reference C or C++ data types and objects, it cannot define data objects with MASM directives or operators. Specifically, you cannot use the definition directives **DB**, `DW`, **DD**, `DQ`, `DT`, and `DF`, or the operators `DUP` or **THIS**. MASM structures and records are also unavailable. The inline assembler doesn't accept the directives `STRUC`, `RECORD`, **WIDTH**, or **MASK**.
+The inline assembler doesn't support all the data directives and operators available in MASM.
+
+## Remarks
+
+Although an **`__asm`** block can reference C or C++ data types and objects, it can't define data objects with MASM directives or operators. Specifically, you can't use the definition directives **`DB`**, **`DW`**, **`DD`**, **`DQ`**, **`DT`**, and **`DF`**, or the operators **`DUP`** or **`THIS`**. MASM structures and records are also unavailable. The inline assembler doesn't accept the directives **`STRUC`**, **`RECORD`**, **`WIDTH`**, or **`MASK`**.
**END Microsoft Specific**
## See also
-[Using Assembly Language in __asm Blocks](../../assembler/inline/using-assembly-language-in-asm-blocks.md)
+[Using Assembly Language in `__asm` blocks](../../assembler/inline/using-assembly-language-in-asm-blocks.md)
diff --git a/docs/assembler/inline/defining-asm-blocks-as-c-macros.md b/docs/assembler/inline/defining-asm-blocks-as-c-macros.md
index 0a5d4df127..2e5305a93c 100644
--- a/docs/assembler/inline/defining-asm-blocks-as-c-macros.md
+++ b/docs/assembler/inline/defining-asm-blocks-as-c-macros.md
@@ -1,9 +1,8 @@
---
-description: "Learn more about: Defining __asm Blocks as C Macros"
title: "Defining __asm Blocks as C Macros"
-ms.date: "08/30/2018"
+description: "Learn more about: Defining __asm Blocks as C Macros"
+ms.date: 08/30/2018
helpviewer_keywords: ["macros, __asm blocks", "Visual C, macros", "__asm keyword [C++], as C macros"]
-ms.assetid: 677ba11c-21c8-4609-bba7-cd47312243b0
---
# Defining __asm Blocks as C Macros
@@ -15,7 +14,7 @@ C macros offer a convenient way to insert assembly code into your source code, b
- Put the **`__asm`** keyword in front of each assembly instruction.
-- Use old-style C comments ( `/* comment */`) instead of assembly-style comments ( `; comment`) or single-line C comments ( `// comment`).
+- Use old-style C comments (`/* comment */`) instead of assembly-style comments (`; comment`) or single-line C comments (`// comment`).
To illustrate, the following example defines a simple macro:
@@ -39,7 +38,7 @@ The third and fourth **`__asm`** keywords are needed as statement separators. Th
The braces are essential as well. If you omit them, the compiler can be confused by C or C++ statements on the same line to the right of the macro invocation. Without the closing brace, the compiler cannot tell where assembly code stops, and it sees C or C++ statements after the **`__asm`** block as assembly instructions.
-Assembly-style comments that start with a semicolon (**;**) continue to the end of the line. This causes problems in macros because the compiler ignores everything after the comment, all the way to the end of the logical line. The same is true of single-line C or C++ comments ( `// comment`). To prevent errors, use old-style C comments ( `/* comment */`) in **`__asm`** blocks defined as macros.
+Assembly-style comments that start with a semicolon (**;**) continue to the end of the line. This causes problems in macros because the compiler ignores everything after the comment, all the way to the end of the logical line. The same is true of single-line C or C++ comments (`// comment`). To prevent errors, use old-style C comments (`/* comment */`) in **`__asm`** blocks defined as macros.
An **`__asm`** block written as a C macro can take arguments. Unlike an ordinary C macro, however, an **`__asm`** macro cannot return a value. So you cannot use such macros in C or C++ expressions.
diff --git a/docs/assembler/inline/masm-macro-directives-in-inline-assembly.md b/docs/assembler/inline/masm-macro-directives-in-inline-assembly.md
index b2d74c12ef..323a67036e 100644
--- a/docs/assembler/inline/masm-macro-directives-in-inline-assembly.md
+++ b/docs/assembler/inline/masm-macro-directives-in-inline-assembly.md
@@ -9,10 +9,10 @@ ms.assetid: 83643a09-1699-40a8-8ef2-13502bc4ac2c
**Microsoft Specific**
-The inline assembler is not a macro assembler. You cannot use MASM macro directives (**MACRO**, `REPT`, **IRC**, `IRP`, and `ENDM`) or macro operators (**<>**, **!**, **&**, `%`, and `.TYPE`). An **`__asm`** block can use C preprocessor directives, however. See [Using C or C++ in __asm Blocks](../../assembler/inline/using-c-or-cpp-in-asm-blocks.md) for more information.
+The inline assembler isn't a macro assembler. You can't use MASM macro directives (`MACRO`, `REPT`, `IRC`, `IRP`, and `ENDM`) or macro operators (**`<>`**, **`!`**, **`&`**, **`%`**, and `.TYPE`). An **`__asm`** block can use C preprocessor directives, however. For more information, see [Using C or C++ in `__asm` blocks](../../assembler/inline/using-c-or-cpp-in-asm-blocks.md).
**END Microsoft Specific**
## See also
-[Using Assembly Language in __asm Blocks](../../assembler/inline/using-assembly-language-in-asm-blocks.md)
+[Using assembly language in `__asm` blocks](../../assembler/inline/using-assembly-language-in-asm-blocks.md)
diff --git a/docs/assembler/inline/writing-functions-with-inline-assembly.md b/docs/assembler/inline/writing-functions-with-inline-assembly.md
index adef94e4ad..65e852819f 100644
--- a/docs/assembler/inline/writing-functions-with-inline-assembly.md
+++ b/docs/assembler/inline/writing-functions-with-inline-assembly.md
@@ -1,39 +1,46 @@
---
-description: "Learn more about: Writing Functions with Inline Assembly"
-title: "Writing Functions with Inline Assembly"
-ms.date: "08/30/2018"
+description: "Learn more about: Writing functions with inline assembly"
+title: "Writing functions with inline assembly"
+ms.date: 02/11/2022
helpviewer_keywords: ["functions [C++], inline assembly", "inline assembly [C++], writing functions", "assembler [C++], writing functions", "__asm keyword [C++], in functions"]
ms.assetid: b5df8a04-fdc7-4622-8c9e-e4b618927497
---
-# Writing Functions with Inline Assembly
+# Writing functions with inline assembly
**Microsoft Specific**
-If you write a function with inline assembly code, it's easy to pass arguments to the function and return a value from it. The following examples compare a function first written for a separate assembler and then rewritten for the inline assembler. The function, called `power2`, receives two parameters, multiplying the first parameter by 2 to the power of the second parameter. Written for a separate assembler, the function might look like this:
+> [!NOTE]
+> Inline assembly is only available for x86 targets. For similar functionality in x64 or ARM64 code, use [compiler intrinsics](../../intrinsics/compiler-intrinsics.md).
+
+If you write a function with inline assembly code, it's easy to pass arguments to the function and return a value from it. The following examples compare a function first written for a separate assembler and then rewritten for the inline assembler. The function, called `power2`, receives two parameters, multiplying the first parameter by 2 to the power of the second parameter. As a separate assembler file, the function might look like this:
```asm
-; POWER.ASM
-; Compute the power of an integer
-;
- PUBLIC _power2
-_TEXT SEGMENT WORD PUBLIC 'CODE'
+; power2.asm
+; x86 code for C interop
+; Command line: ml /c /Cx /W3 /WX power2.asm
+ .686P
+ .XMM
+ .MODEL flat
+
+PUBLIC _power2
+; int power2(int num, int power);
+; computes num x 2^power
+_TEXT SEGMENT
_power2 PROC
-
- push ebp ; Save EBP
- mov ebp, esp ; Move ESP into EBP so we can refer
- ; to arguments on the stack
- mov eax, [ebp+4] ; Get first argument
- mov ecx, [ebp+6] ; Get second argument
- shl eax, cl ; EAX = EAX * ( 2 ^ CL )
- pop ebp ; Restore EBP
- ret ; Return with sum in EAX
-
+ push ebp ; save EBP
+ mov ebp, esp ; Move ESP into EBP so we can refer
+ ; to arguments on the stack
+ mov eax, [ebp+8] ; load first argument
+ mov ecx, [ebp+12] ; load second argument
+ shl eax, cl ; compute result in EAX
+ pop ebp ; restore EBP
+ ret
_power2 ENDP
_TEXT ENDS
- END
+END
```
-Since it's written for a separate assembler, the function requires a separate source file and assembly and link steps. C and C++ function arguments are usually passed on the stack, so this version of the `power2` function accesses its arguments by their positions on the stack. (Note that the **MODEL** directive, available in MASM and some other assemblers, also allows you to access stack arguments and local stack variables by name.)
+Since it's written as a separate assembler file, the function requires separate assembly and link steps. C and C++ function arguments are usually passed on the stack, so this version of the `power2` function accesses its arguments by their positions on the stack. (The **`MODEL`** directive, available in MASM and some other assemblers, also allows you to access stack arguments and local stack variables by name.)
## Example
@@ -67,10 +74,10 @@ int power2( int num, int power )
The inline version of the `power2` function refers to its arguments by name and appears in the same source file as the rest of the program. This version also requires fewer assembly instructions.
-Because the inline version of `power2` doesn't execute a C **`return`** statement, it causes a harmless warning if you compile at warning level 2 or higher. The function does return a value, but the compiler cannot tell that in the absence of a **`return`** statement. You can use [#pragma warning](../../preprocessor/warning.md) to disable the generation of this warning.
+Because the inline version of `power2` doesn't execute a C **`return`** statement, it causes a harmless warning if you compile at warning level 2 or higher. The function does return a value, but the compiler can't tell it does in the absence of a **`return`** statement. You can use [`#pragma warning`](../../preprocessor/warning.md) to disable the generation of this warning.
**END Microsoft Specific**
## See also
-[Using C or C++ in __asm Blocks](../../assembler/inline/using-c-or-cpp-in-asm-blocks.md)
+[Using C or C++ in `__asm` Blocks](../../assembler/inline/using-c-or-cpp-in-asm-blocks.md)
diff --git a/docs/assembler/masm/dot-code.md b/docs/assembler/masm/dot-code.md
index c8167f89f3..9bf447e91b 100644
--- a/docs/assembler/masm/dot-code.md
+++ b/docs/assembler/masm/dot-code.md
@@ -1,20 +1,21 @@
---
-description: "Learn more about: .CODE"
title: ".CODE"
+description: "Learn more about: .CODE"
ms.date: "12/17/2019"
f1_keywords: [".CODE"]
helpviewer_keywords: [".CODE directive"]
-ms.assetid: 2b8c882c-c0d2-4fa3-8335-e6b12717a4f4
---
# .CODE
-(32-bit MASM only.) When used with [.MODEL](dot-model.md), indicates the start of a code segment.
+Indicates the start of a code segment.
+
+When using 32-bit MASM, this should be used along with [.MODEL](dot-model.md).
## Syntax
> **.CODE** ⟦*name*⟧\
> ⟦ *segmentItem* ⟧...\
-> ⟦ *codesegmentnameId* **ENDS**;;⟧\
+> ⟦ *codesegmentnameId* **ENDS**;;⟧
### Parameters
diff --git a/docs/assembler/masm/dot-data.md b/docs/assembler/masm/dot-data.md
index cf080270da..c36eb3fee1 100644
--- a/docs/assembler/masm/dot-data.md
+++ b/docs/assembler/masm/dot-data.md
@@ -8,7 +8,9 @@ ms.assetid: 32797935-9c79-46e0-bf6f-07d0c2bf1dc1
---
# .DATA
- (32-bit MASM only.) When used with [.MODEL](dot-model.md), starts a near data segment for initialized data (segment name _DATA).
+Indicates the start of a data segment.
+
+When using 32-bit MASM, this starts a near data segment for initialized data (segment name _DATA) and should be used along with [.MODEL](dot-model.md).
## Syntax
diff --git a/docs/assembler/masm/dot-nolistif.md b/docs/assembler/masm/dot-nolistif.md
index bb4996f2ad..37703a53fb 100644
--- a/docs/assembler/masm/dot-nolistif.md
+++ b/docs/assembler/masm/dot-nolistif.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: .NOLISTIF"
title: ".NOLISTIF"
+description: "Learn more about: .NOLISTIF"
ms.date: "12/16/2019"
f1_keywords: [".NOLISTIF"]
helpviewer_keywords: [".NOLISTIF directive"]
-ms.assetid: 9243af7a-7221-4531-bbc3-281b6b292bfd
---
# .NOLISTIF
@@ -20,5 +19,5 @@ This is the default. Same as [.SFCOND](dot-sfcond.md).
## See also
-[Directives reference](directives-reference.md)
+[Directives reference](directives-reference.md)\
[MASM BNF Grammar](masm-bnf-grammar.md)
diff --git a/docs/assembler/masm/dot-xmm.md b/docs/assembler/masm/dot-xmm.md
index 72b1af9e0a..9c0eae78b0 100644
--- a/docs/assembler/masm/dot-xmm.md
+++ b/docs/assembler/masm/dot-xmm.md
@@ -8,7 +8,7 @@ ms.assetid: db3062b6-8b2f-469b-aa02-df6571eab3ba
---
# .XMM (32-bit MASM)
-Enables assembly of Internet Streaming SIMD Extension instructions. (32-bit MASM only.)
+Enables assembly of Streaming SIMD Extension instructions. (32-bit MASM only.)
## Syntax
diff --git a/docs/assembler/masm/extern-masm.md b/docs/assembler/masm/extern-masm.md
index dc0325534e..d261390d68 100644
--- a/docs/assembler/masm/extern-masm.md
+++ b/docs/assembler/masm/extern-masm.md
@@ -1,9 +1,8 @@
---
-description: "Learn more about: EXTERN"
+description: "Learn more about the MASM directive: EXTERN"
title: "EXTERN (MASM)"
-ms.date: "12/06/2019"
+ms.date: 1/10/2025
helpviewer_keywords: ["EXTERN directive"]
-ms.assetid: 667d703d-3aaf-4139-a586-29bc5dab1aff
---
# EXTERN
@@ -17,7 +16,9 @@ Defines one or more external variables, labels, or symbols called *name* whose t
The *language-type* argument is valid in 32-bit MASM only.
-The *type* can be [ABS](operator-abs.md), which imports *name* as a constant. Same as [EXTRN](extrn.md).
+The *type* can be [`ABS`](operator-abs.md), which imports *name* as a constant. Same as [`EXTRN`](extrn.md).
+
+The *type* can also be [`PROC`](proc.md), in which case *name* is treated as an external procedure.
## See also
diff --git a/docs/assembler/masm/masm-bnf-grammar.md b/docs/assembler/masm/masm-bnf-grammar.md
index d725146caf..65eea98ce0 100644
--- a/docs/assembler/masm/masm-bnf-grammar.md
+++ b/docs/assembler/masm/masm-bnf-grammar.md
@@ -22,7 +22,7 @@ The BNF grammar allows recursive definitions. For example, the grammar uses *`qu
*`endOfLine`* | *`comment`*
*`=Dir`*\
- *`id`* = *`immExpr`* *`;;`*
+ *`id`* **`=`** *`immExpr`* *`;;`*
*`addOp`*\
**`+`** | **`-`**
@@ -492,7 +492,7 @@ The BNF grammar allows recursive definitions. For example, the grammar uses *`qu
*`immExpr`*\
| *`string`*\
| **`?`**\
- | *`constExpr`* **`DUP`** ( *`scalarInstList`* )\
+ | *`constExpr`* **`DUP`** **`(`** *`scalarInstList`* **`)`**\
| *`floatNumber`*\
| *`bcdConst`*
@@ -591,7 +591,7 @@ The BNF grammar allows recursive definitions. For example, the grammar uses *`qu
*`macroCall`*\
*`id`* *`macroArgList`* *`;;`*\
- | *`id`* ( *`macroArgList`* )
+ | *`id`* **`(`** *`macroArgList`* **`)`**
*`macroDir`*\
*`id`* **`MACRO`** ⟦ *`macroParmList`* ⟧ *`;;`*\
@@ -716,7 +716,7 @@ The BNF grammar allows recursive definitions. For example, the grammar uses *`qu
| **`OLDMACROS`** | **`NOOLDMACROS`**\
| **`OLDSTRUCTS`** | **`NOOLDSTRUCTS`**\
| **`PROC`** **`:`** *`oVisibility`*\
- | **`PROLOGUE`** : *`macroId`*\
+ | **`PROLOGUE`** **`:`** *`macroId`*\
| **`READONLY`** | **`NOREADONLY`**\
| **`SCOPED`** | **`NOSCOPED`**\
| **`SEGMENT`** **`:`** *`segSize`*\
diff --git a/docs/assembler/masm/masm-for-x64-ml64-exe.md b/docs/assembler/masm/masm-for-x64-ml64-exe.md
index 95c7e53149..840b002083 100644
--- a/docs/assembler/masm/masm-for-x64-ml64-exe.md
+++ b/docs/assembler/masm/masm-for-x64-ml64-exe.md
@@ -3,11 +3,10 @@ description: "Learn more about: Microsoft Macro Assembler (MASM) for x64 (ml64.e
title: "MASM for x64 (ml64.exe)"
ms.date: 09/21/2021
helpviewer_keywords: ["ml64", "ml64.exe", "masm for x64"]
-ms.assetid: 89059103-f372-4968-80ea-0c7f90bb9c91
---
# MASM for x64 (ml64.exe)
-Visual Studio includes both 32-bit and 64-bit hosted versions of MASM (the Microsoft Macro Assembler) to target x64 code. Named ml64.exe, it's the assembler that accepts x64 assembler language. The MASM command-line tools are installed when you choose a C++ workload during Visual Studio installation. The MASM tools aren't available as a separate download. For instructions on how to download and install a copy of Visual Studio, see [Install Visual Studio](/visualstudio/install/install-visual-studio). If you only want the command-line tools, not the full IDE, download the [Build Tools for Visual Studio](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022).
+Visual Studio includes both 32-bit and 64-bit hosted versions of MASM (the Microsoft Macro Assembler) to target x64 code. Named ml64.exe, it's the assembler that accepts x64 assembly language. The MASM command-line tools are installed when you choose a C++ workload during Visual Studio installation. The MASM tools aren't available as a separate download. For instructions on how to download and install a copy of Visual Studio, see [Install Visual Studio](/visualstudio/install/install-visual-studio). If you only want the command-line tools, not the full IDE, download the [Build Tools for Visual Studio](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022).
To use ml64.exe on the command line, start a developer command prompt for x64 targets. A developer command prompt sets the required path and other environment variables. For information on how to start a developer command prompt, see [Build C/C++ code on the command line](../../build/building-on-the-command-line.md).
diff --git a/docs/assembler/masm/microsoft-macro-assembler-reference.md b/docs/assembler/masm/microsoft-macro-assembler-reference.md
index 5765386231..1cf7f09461 100644
--- a/docs/assembler/masm/microsoft-macro-assembler-reference.md
+++ b/docs/assembler/masm/microsoft-macro-assembler-reference.md
@@ -6,11 +6,11 @@ helpviewer_keywords: ["MASM (Microsoft Macro Assembler), reference", "MASM (Micr
---
# Microsoft Macro Assembler reference
-The Microsoft Macro Assembler (MASM) provides several advantages over inline assembly. MASM contains a macro language that has features such as looping, arithmetic, and text string processing. MASM gives you greater control over the hardware. By using MASM, you also can reduce time and memory overhead in your code.
+The Microsoft Macro Assembler (MASM) provides several advantages over inline assembly. MASM contains a macro language that has features such as looping, arithmetic, and string processing. MASM gives you greater control over the hardware. By using MASM, you also can reduce time and memory overhead in your code.
## In This Section
-[ML and ML64 command-line option](ml-and-ml64-command-line-reference.md)\
+[ML and ML64 command-line options](ml-and-ml64-command-line-reference.md)\
Describes the ML and ML64 command-line options.
[MASM for x64 (ml64.exe)](masm-for-x64-ml64-exe.md)\
@@ -34,8 +34,7 @@ Describes fatal and nonfatal error messages and warnings.
[Processor Manufacturer Programming Manuals](processor-manufacturer-programming-manuals.md)\
Provides links to programming information about processors not manufactured, sold, or supported by Microsoft.
-[MASM BNF Grammar](masm-bnf-grammar.md)
-
+[MASM BNF Grammar](masm-bnf-grammar.md)\
Formal BNF description of MASM for x64.
## Related Sections
diff --git a/docs/assembler/masm/ml-and-ml64-command-line-reference.md b/docs/assembler/masm/ml-and-ml64-command-line-reference.md
index a14b954932..e4ea469e36 100644
--- a/docs/assembler/masm/ml-and-ml64-command-line-reference.md
+++ b/docs/assembler/masm/ml-and-ml64-command-line-reference.md
@@ -1,10 +1,9 @@
---
title: "ML and ML64 command-line reference"
description: "Reference guide to the Microsoft MASM ML and ML64 assembler command-line options."
-ms.date: "02/09/2020"
+ms.date: 7/3/2023
f1_keywords: ["ML"]
-helpviewer_keywords: ["/W* MASM compiler option", "/c MASM compiler option", "/EP MASM compiler option", "/Fe MASM compiler option", "/Zp MASM compiler option", "/AT MASM compiler option", "/Zm MASM compiler option", "/Sf MASM compiler option", "/Sp MASM compiler option", "/w MASM compiler option", "/Fl MASM compiler option", "/coff MASM compiler option", "/St MASM compiler option", "/Cx MASM compiler option", "/Sl MASM compiler option", "/Cu MASM compiler option", "MASM (Microsoft Macro Assembler), ML command-line reference", "/FPi MASM compiler option", "/Zf MASM compiler option", "ML environment variable", "/Fr MASM compiler option", "/help MASM compiler option", "/Sa MASM compiler option", "/Zd MASM compiler option", "/I MASM compiler option", "/? MASM compiler option", "/Bl MASM compiler option", "/Fm MASM compiler option", "/Fo MASM compiler option", "command-line reference [ML]", "/Sn MASM compiler option", "/Gd MASM compiler option", "/D* MASM compiler option", "environment variables, ML", "/Gc MASM compiler option", "/F* MASM compiler option", "/Sc MASM compiler option", "/H MASM compiler option", "/Zs MASM compiler option", "/omf MASM compiler option", "/Sg MASM compiler option", "/Cp MASM compiler option", "/Zi MASM compiler option", "/nologo MASM compiler option", "/Sx MASM compiler option", "/WX MASM compiler option", "/Ss MASM compiler option", "command line, reference [ML]", "/Ta MASM compiler option"]
-ms.assetid: 712623c6-f77e-47ea-a945-089e57c50b40
+helpviewer_keywords: ["/W* MASM compiler option", "/c MASM compiler option", "/EP MASM compiler option", "/Fe MASM compiler option", "/Zp MASM compiler option", "/AT MASM compiler option", "/Zm MASM compiler option", "/Sf MASM compiler option", "/Sp MASM compiler option", "/w MASM compiler option", "/Fl MASM compiler option", "/coff MASM compiler option", "/St MASM compiler option", "/Cx MASM compiler option", "/Sl MASM compiler option", "/Cu MASM compiler option", "MASM (Microsoft Macro Assembler), ML command-line reference", "/FPi MASM compiler option", "/Zf MASM compiler option", "ML environment variable", "/Fr MASM compiler option", "/help MASM compiler option", "/Sa MASM compiler option", "/Zd MASM compiler option", "/I MASM compiler option", "/? MASM compiler option", "/Bl MASM compiler option", "/Fm MASM compiler option", "/Fo MASM compiler option", "command-line reference [ML]", "/Sn MASM compiler option", "/Gd MASM compiler option", "/D* MASM compiler option", "environment variables, ML", "/Gc MASM compiler option", "/F* MASM compiler option", "/Sc MASM compiler option", "/H MASM compiler option", "/Zs MASM compiler option", "/omf MASM compiler option", "/quiet MASM compiler option", "/Sg MASM compiler option", "/Cp MASM compiler option", "/Zi MASM compiler option", "/nologo MASM compiler option", "/Sx MASM compiler option", "/WX MASM compiler option", "/Ss MASM compiler option", "command line, reference [ML]", "/Ta MASM compiler option"]
---
# ML and ML64 command-line reference
@@ -14,74 +13,77 @@ For more information on ml64.exe, see [MASM for x64 (ml64.exe)](masm-for-x64-ml6
## Syntax
-> ML \[*options*] *filename* \[ \[*options*] *filename*]
+> **`ML`** \[*`options`*] *`filename`* \[ \[*`options`*] *`filename`*]
>
-> ML64 \[*options*] *filename* \[ \[*options*] *filename*] ... \[/link *link_options*]
+> **`ML64`** \[*`options`*] *`filename`* \[ \[*`options`*] *`filename`*] ... \[**`/link`** *`link_options`*]
### Parameters
-*options*\
-The options listed in the following table.
-
-|Option|Action|
-|------------|------------|
-|**/AT**|Enables tiny-memory-model support. Enables error messages for code constructs that violate the requirements for .com format files. This option isn't equivalent to the [.MODEL](dot-model.md) **TINY** directive.
Not available in ml64.exe.|
-|**/Bl** *filename*|Selects an alternate linker.|
-|**/c**|Assembles only. Does no linking.|
-|**/coff**|Generates common object file format (COFF) type of object module. Required for Win32 assembly language development.
Not available in ml64.exe.|
-|**/Cp**|Preserves case of all user identifiers.|
-|**/Cu**|Maps all identifiers to upper case (default).
Not available in ml64.exe.|
-|**/Cx**|Preserves case in public and extern symbols.|
-|**/D** *symbol*⟦=*value*⟧|Defines a text macro with the given name. If *value* is missing, it's blank. Multiple tokens separated by spaces must be enclosed in quotation marks.|
-|**/EP**|Generates a preprocessed source listing (sent to STDOUT). See **/Sf**.|
-|**/ERRORREPORT** [ **NONE** | **PROMPT** | **QUEUE** | **SEND** ]| Deprecated. Error reporting is controlled by [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings. |
-|**/F** *hexnum*|Sets stack size to *hexnum* bytes (the same as **/link /STACK**:*number*). The value must be expressed in hexadecimal notation. There must be a space between **/F** and *hexnum*.|
-|**/Fe** *filename*|Names the executable file.|
-|**/Fl**⟦*filename*⟧|Generates an assembled code listing. See **/Sf**.|
-|**/Fm**⟦*filename*⟧|Creates a linker map file.|
-|**/Fo** *filename*|Names an object file. For more information, see [Remarks](#remarks).|
-|**/FPi**|Generates emulator fix-ups for floating-point arithmetic (mixed language only).
Not available in ml64.exe.|
-|**/Fr**⟦*filename*⟧|Generates a source browser .sbr file.|
-|**/FR**⟦*filename*⟧|Generates an extended form of a source browser .sbr file.|
-|**/Gc**|Specifies use of FORTRAN- or Pascal-style function calling and naming conventions. Same as **OPTION LANGUAGE:PASCAL**.
Not available in ml64.exe.|
-|**/Gd**|Specifies use of C-style function calling and naming conventions. Same as **OPTION LANGUAGE:C**.
Not available in ml64.exe.|
-|**/GZ**|Specifies use of __stdcall function calling and naming conventions. Same as **OPTION LANGUAGE:STCALL**.
Not available in ml64.exe.|
-|**/H** *number*|Restricts external names to number significant characters. The default is 31 characters.
Not available in ml64.exe.|
-|**/help**|Calls QuickHelp for help on ML.|
-|**/I** *pathname*|Sets path for include file. A maximum of 10 **/I** options is allowed.|
-|**/nologo**|Suppresses messages for successful assembly.|
-|**/omf**|Generates object module file format (OMF) type of object module. **/omf** implies **/c**; ML.exe doesn't support linking OMF objects.
Not available in ml64.exe.|
-|**/Sa**|Turns on listing of all available information.|
-|**/safeseh**|Marks the object as either containing no exception handlers or containing exception handlers that are all declared with [.SAFESEH](dot-safeseh.md).
Not available in ml64.exe.|
-|**/Sf**|Adds first-pass listing to listing file.|
-|**/Sl** *width*|Sets the line width of source listing in characters per line. Range is 60 to 255 or 0. Default is 0. Same as [PAGE](page.md) width.|
-|**/Sn**|Turns off symbol table when producing a listing.|
-|**/Sp** *length*|Sets the page length of source listing in lines per page. Range is 10 to 255 or 0. Default is 0. Same as [PAGE](page.md) length.|
-|**/Ss** *text*|Specifies text for source listing. Same as [SUBTITLE](subtitle.md) text.|
-|**/St** *text*|Specifies title for source listing. Same as [TITLE](title.md) text.|
-|**/Sx**|Turns on false conditionals in listing.|
-|**/Ta** *filename*|Assembles source file whose name doesn't end with the .asm extension.|
-|**/w**|Same as **/W0/WX**.|
-|**/W** *level*|Sets the warning level, where *level* = 0, 1, 2, or 3.|
-|**/WX**|Returns an error code if warnings are generated.|
-|**/X**|Ignore INCLUDE environment path.|
-|**/Zd**|Generates line-number information in object file.|
-|**/Zf**|Makes all symbols public.|
-|**/Zi**|Generates CodeView information in object file.|
-|**/Zm**|Enables**M510** option for maximum compatibility with MASM 5.1.
Not available in ml64.exe.|
-|**/Zp**⟦*alignment*⟧|Packs structures on the specified byte boundary. The *alignment* can be 1, 2, or 4.|
-|**/Zs**|Performs a syntax check only.|
-|**/?**|Displays a summary of ML command-line syntax.|
-
-*filename*\
+*`options`*\
+The options listed in the following table:
+
+| Option | Action |
+|--|--|
+| **`/AT`** | Enables tiny-memory-model support. Enables error messages for code constructs that violate the requirements for *`.com`* format files. This option isn't equivalent to the [`.MODEL`](dot-model.md) **`TINY`** directive.
Not available in ml64.exe. |
+| **`/Bl`** *`filename`* | Selects an alternate linker in *`filename`*. |
+| **`/c`** | Assembles only. Does no linking. |
+| **`/coff`** | Generates common object file format (COFF) type of object module. Required for Win32 assembly language development.
Not available in ml64.exe. |
+| **`/Cp`** | Preserves case of all user identifiers. |
+| **`/Cu`** | Maps all identifiers to upper case (default).
Not available in ml64.exe. |
+| **`/Cx`** | Preserves case in public and extern symbols. |
+| **`/D`** *`symbol`*⟦=*`value`*⟧ | Defines a text macro with the given name *`symbol`*. If *`value`* is missing, it's blank. Multiple tokens separated by spaces must be enclosed in quotation marks. |
+| **`/EP`** | Generates a preprocessed source listing (sent to `STDOUT`). See **`/Sf`**. |
+| **`/ERRORREPORT`** [ **`NONE`** \| **`PROMPT`** \| **`QUEUE`** \| **`SEND`** ] | Deprecated. Error reporting is controlled by [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings. |
+| **`/F`** *`hexnum`* | Sets stack size to *`hexnum`* bytes (the same as **`/link /STACK:`**). The value must be expressed in hexadecimal notation. There must be a space between **`/F`** and *`hexnum`*. |
+| **`/Fe`** *`filename`* | Names the executable file. |
+| **`/Fl`**⟦*`filename`*⟧ | Generates an assembled code listing. See **/Sf**. |
+| **`/Fm`**⟦*`filename`*⟧ | Creates a linker map file. |
+| **`/Fo`** *`filename`* | Names an object file. For more information, see [Remarks](#remarks). |
+| **`/FPi`** | Generates emulator fix-ups for floating-point arithmetic (mixed language only).
Not available in ml64.exe. |
+| **`/Fr`**⟦*`filename`*⟧ | Generates a source browser *`.sbr`* file. |
+| **`/FR`**⟦*`filename`*⟧ | Generates an extended form of a source browser *`.sbr`* file. |
+| **`/Gc`** | Specifies use of FORTRAN- or Pascal-style conventions for function calls and names. Same as **`OPTION LANGUAGE:PASCAL`**.
Not available in ml64.exe. |
+| **`/Gd`** | Specifies use of C-style conventions for function calls and names. Same as **`OPTION LANGUAGE:C`**.
Not available in ml64.exe. |
+| **`/Gz`** | Specifies use of `__stdcall` conventions for function calls and names. Same as **`OPTION LANGUAGE:STDCALL`**.
Not available in ml64.exe. |
+| **`/H`** *`number`* | Restricts external names to *`number`* significant characters. The default is 31 characters.
Not available in ml64.exe. |
+| **`/help`** | Displays a summary of ML command-line syntax and options. |
+| **`/I`** *`pathname`* | Sets path for include file. A maximum of 10 **`/I`** options is allowed. |
+| **`/nologo`** | Suppresses messages for successful assembly. |
+| **`/omf`** | Generates object module file format (OMF) type of object module. **`/omf`** implies **`/c`**. ML.exe doesn't support linking OMF objects.
Not available in ml64.exe. |
+| **`/quiet`** | Suppresses 'Assembling' message. Available in Visual Studio 17.6 and later. |
+| **`/Sa`** | Turns on listing of all available information. |
+| **`/safeseh`** | Marks the object file: either it contains no exception handlers, or it contains exception handlers that are all declared with [`.SAFESEH`](dot-safeseh.md).
Not available in ml64.exe. |
+| **`/Sf`** | Adds the first-pass listing to the listing file. |
+| **`/Sl`** *`width`* | Sets the line width of source listing in characters per line to *`width`*. Range is 60-255 or 0. Default is 0. Same as [`PAGE`](page.md) *`width`*. |
+| **`/Sn`** | Turns off symbol table when a listing is produced. |
+| **`/Sp`** *`length`* | Sets the page length of source listing in lines per page to *`length`*. Range is 10-255 or 0. Default is 0. Same as [`PAGE`](page.md) *`length`*. |
+| **`/Ss`** *`text`* | Specifies text for source listing. Same as [`SUBTITLE`](subtitle.md) text. |
+| **`/St`** *`text`* | Specifies title for source listing. Same as [`TITLE`](title.md) text. |
+| **`/Sx`** | Turns on false conditionals in listing. |
+| **`/Ta`** *`filename`* | Assembles source file whose name doesn't end with the *`.asm`* extension. |
+| **`/w`** | Same as **`/W0 /WX`**. |
+| **`/W`** *`level`* | Sets the warning level, where *`level`* = 0, 1, 2, or 3. |
+| **`/WX`** | If warnings are generated, returns an error code. |
+| **`/X`** | Ignore `INCLUDE` environment path. |
+| **`/Zd`** | Generates line-number information in object file. |
+| **`/Zf`** | Makes all symbols public. |
+| **`/ZH:MD5`** | Use MD5 for checksum in debug info. |
+| **`/ZH:SHA_256`** | Use SHA256 for checksum in debug info (default in Visual Studio 2022 version 17.0 and later). |
+| **`/Zi`** | Generates CodeView information in object file. |
+| **`/Zm`** | Enables **`M510`** option for maximum compatibility with MASM 5.1.
Not available in ml64.exe. |
+| **`/Zp`**⟦*`alignment`*⟧ | Packs structures on the specified byte boundary. The *`alignment`* can be 1, 2, 4, 8, or 16. |
+| **`/Zs`** | Performs a syntax check only. |
+| **`/?`** | Displays a summary of ML command-line syntax and options. |
+
+*`filename`*\
The name of the file.
-*link_options*\
+*`link_options`*\
The link options. For more information, see [Linker options](../../build/reference/linker-options.md).
## Remarks
-Some command-line options to ML and ML64 are placement-sensitive. For example, because ML and ML64 can accept several **/c** options, any corresponding **/Fo** options must be specified before **/c**. The following command-line example illustrates an object file specification for each assembly file specification:
+Some command-line options to ML and ML64 are placement-sensitive. For example, because ML and ML64 can accept several **`/c`** options, any corresponding **`/Fo`** options must be specified before **`/c`**. The following command-line example illustrates an object file specification for each assembly file specification:
```cmd
ml.exe /Fo a1.obj /c a.asm /Fo b1.obj /c b.asm
@@ -89,13 +91,13 @@ ml.exe /Fo a1.obj /c a.asm /Fo b1.obj /c b.asm
## Environment Variables
-|Variable|Description|
-|--------------|-----------------|
-|INCLUDE|Specifies search path for include files.|
-|ML|Specifies default command-line options.|
-|TMP|Specifies path for temporary files.|
+| Variable | Description |
+|--|--|
+| `INCLUDE` | Specifies search path for include files. |
+| `ML` | Specifies default command-line options. |
+| `TMP` | Specifies path for temporary files. |
## See also
-[ML Error Messages](ml-error-messages.md)\
-[Microsoft Macro Assembler Reference](microsoft-macro-assembler-reference.md)
+[ML error messages](ml-error-messages.md)\
+[Microsoft Macro Assembler reference](microsoft-macro-assembler-reference.md)
diff --git a/docs/assembler/masm/ml-error-messages.md b/docs/assembler/masm/ml-error-messages.md
index fa05763b6c..60ef663335 100644
--- a/docs/assembler/masm/ml-error-messages.md
+++ b/docs/assembler/masm/ml-error-messages.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Error Messages"
title: "ML Error Messages"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["vc.errors.ml"]
helpviewer_keywords: ["MASM (Microsoft Macro Assembler), ML error messages"]
ms.assetid: e7e164b3-6d65-4b5b-8925-bfbebc043523
diff --git a/docs/assembler/masm/ml-fatal-error-a1000.md b/docs/assembler/masm/ml-fatal-error-a1000.md
index 58b8730b20..64c18b9e37 100644
--- a/docs/assembler/masm/ml-fatal-error-a1000.md
+++ b/docs/assembler/masm/ml-fatal-error-a1000.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Fatal Error A1000"
title: "ML Fatal Error A1000"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A1000"]
helpviewer_keywords: ["A1000"]
ms.assetid: 4fc77a83-8796-4dcf-9c37-6395d635b817
diff --git a/docs/assembler/masm/ml-fatal-error-a1005.md b/docs/assembler/masm/ml-fatal-error-a1005.md
index 8dbccfde31..26a5522b82 100644
--- a/docs/assembler/masm/ml-fatal-error-a1005.md
+++ b/docs/assembler/masm/ml-fatal-error-a1005.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Fatal Error A1005"
title: "ML Fatal Error A1005"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A1005"]
helpviewer_keywords: ["A1005"]
ms.assetid: 42c7a6c5-277d-417c-acc1-d84c370e8d24
diff --git a/docs/assembler/masm/ml-fatal-error-a1007.md b/docs/assembler/masm/ml-fatal-error-a1007.md
index dddac87749..8f6c7940ef 100644
--- a/docs/assembler/masm/ml-fatal-error-a1007.md
+++ b/docs/assembler/masm/ml-fatal-error-a1007.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Fatal Error A1007"
title: "ML Fatal Error A1007"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A1007"]
helpviewer_keywords: ["A1007"]
ms.assetid: bcf9c826-beb3-4e93-91fe-1ffd34995fbf
diff --git a/docs/assembler/masm/ml-fatal-error-a1008.md b/docs/assembler/masm/ml-fatal-error-a1008.md
index 64c30f7b55..c18d2492c9 100644
--- a/docs/assembler/masm/ml-fatal-error-a1008.md
+++ b/docs/assembler/masm/ml-fatal-error-a1008.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Fatal Error A1008"
title: "ML Fatal Error A1008"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A1008"]
helpviewer_keywords: ["A1008"]
ms.assetid: fe592f9d-c37b-4cd8-a51d-e3c15ddcab83
diff --git a/docs/assembler/masm/ml-fatal-error-a1009.md b/docs/assembler/masm/ml-fatal-error-a1009.md
index b3395c7b59..23fe9aee2c 100644
--- a/docs/assembler/masm/ml-fatal-error-a1009.md
+++ b/docs/assembler/masm/ml-fatal-error-a1009.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Fatal Error A1009"
title: "ML Fatal Error A1009"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A1009"]
helpviewer_keywords: ["A1009"]
ms.assetid: f7a962a6-4280-485e-95cb-2ab8922c66c2
diff --git a/docs/assembler/masm/ml-fatal-error-a1010.md b/docs/assembler/masm/ml-fatal-error-a1010.md
index 7c0b1733fc..0229ad3136 100644
--- a/docs/assembler/masm/ml-fatal-error-a1010.md
+++ b/docs/assembler/masm/ml-fatal-error-a1010.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Fatal Error A1010"
title: "ML Fatal Error A1010"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A1010"]
helpviewer_keywords: ["A1010"]
ms.assetid: 9e0b5241-67f4-4740-8701-3b2d2d1ad9e4
diff --git a/docs/assembler/masm/ml-fatal-error-a1011.md b/docs/assembler/masm/ml-fatal-error-a1011.md
index e64d7bef96..6a5e3ea920 100644
--- a/docs/assembler/masm/ml-fatal-error-a1011.md
+++ b/docs/assembler/masm/ml-fatal-error-a1011.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Fatal Error A1011"
title: "ML Fatal Error A1011"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A1011"]
helpviewer_keywords: ["A1011"]
ms.assetid: 7fbf092d-4189-4330-a884-dfa2268fc3dd
diff --git a/docs/assembler/masm/ml-fatal-error-a1016.md b/docs/assembler/masm/ml-fatal-error-a1016.md
index c0281f0d1c..193e1af425 100644
--- a/docs/assembler/masm/ml-fatal-error-a1016.md
+++ b/docs/assembler/masm/ml-fatal-error-a1016.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Fatal Error A1016"
title: "ML Fatal Error A1016"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A1016"]
helpviewer_keywords: ["A1016"]
ms.assetid: 440b3750-ba0b-44d8-b82d-d581f62c08b2
diff --git a/docs/assembler/masm/ml-fatal-error-a1017.md b/docs/assembler/masm/ml-fatal-error-a1017.md
index 024e05953a..186314b280 100644
--- a/docs/assembler/masm/ml-fatal-error-a1017.md
+++ b/docs/assembler/masm/ml-fatal-error-a1017.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Fatal Error A1017"
title: "ML Fatal Error A1017"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A1017"]
helpviewer_keywords: ["A1017"]
ms.assetid: bef0b312-5431-4e5a-b637-c19919acf01b
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2004.md b/docs/assembler/masm/ml-nonfatal-error-a2004.md
index c6b906e562..cb40f2e8d3 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2004.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2004.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2004"
title: "ML Nonfatal Error A2004"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2004"]
helpviewer_keywords: ["A2004"]
ms.assetid: 74e219ba-4dec-467a-b121-18a76aa57230
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2006.md b/docs/assembler/masm/ml-nonfatal-error-a2006.md
index 43c8f5a860..5eb17a38e6 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2006.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2006.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2006"
title: "ML Nonfatal Error A2006"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2006"]
helpviewer_keywords: ["A2006"]
ms.assetid: b8a8f096-95df-42b5-85ed-d2530560a84c
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2008.md b/docs/assembler/masm/ml-nonfatal-error-a2008.md
index fe1bb27488..b648e40ee5 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2008.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2008.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2008"
title: "ML Nonfatal Error A2008"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2008"]
helpviewer_keywords: ["A2008"]
ms.assetid: ca24157f-c88a-4678-ae06-3bc3cd956001
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2010.md b/docs/assembler/masm/ml-nonfatal-error-a2010.md
index 9b8e63a98d..0037f31377 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2010.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2010.md
@@ -2,16 +2,18 @@
description: "Learn more about: ML Nonfatal Error A2010"
title: "ML Nonfatal Error A2010"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2010"]
helpviewer_keywords: ["A2010"]
ms.assetid: 8bcd57f4-1e3f-421f-9ef8-e702daf57fcb
---
# ML Nonfatal Error A2010
-**invalid type expression**
+> **invalid type expression**
-The operand to [THIS](operator-this.md) or [PTR](operator-ptr.md) was not a valid type expression.
+## Remarks
+
+The operand to [`THIS`](operator-this.md) or [`PTR`](operator-ptr.md) wasn't a valid type expression.
## See also
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2019.md b/docs/assembler/masm/ml-nonfatal-error-a2019.md
index ba6c9f21dd..90bd405bec 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2019.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2019.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2019"
title: "ML Nonfatal Error A2019"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2019"]
helpviewer_keywords: ["A2019"]
ms.assetid: 7dff209b-6d91-4e39-88a3-5d6329bac537
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2022.md b/docs/assembler/masm/ml-nonfatal-error-a2022.md
index df9fae2891..8751e3f61e 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2022.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2022.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2022"
title: "ML Nonfatal Error A2022"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2022"]
helpviewer_keywords: ["A2022"]
ms.assetid: 3f4b1017-543e-4236-820f-61070ab58920
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2031.md b/docs/assembler/masm/ml-nonfatal-error-a2031.md
index f82a717e43..ca2b604bdc 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2031.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2031.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2031"
title: "ML Nonfatal Error A2031"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2031"]
helpviewer_keywords: ["A2031"]
ms.assetid: d5b11f58-4a00-42be-9062-8fa8728e6306
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2034.md b/docs/assembler/masm/ml-nonfatal-error-a2034.md
index c1759d7f64..3f39de593f 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2034.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2034.md
@@ -2,30 +2,32 @@
description: "Learn more about: ML Nonfatal Error A2034"
title: "ML Nonfatal Error A2034"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2034"]
helpviewer_keywords: ["A2034"]
ms.assetid: 6438970c-0aee-4f14-a058-5fe47d0ee216
---
# ML Nonfatal Error A2034
-**must be in segment block**
+> **must be in segment block**
-One of the following was found outside of a segment block:
+## Remarks
+
+The assembler found one of the following items outside of a segment block:
- An instruction
- A label definition
-- A [THIS](operator-this.md) operator
+- A [`THIS`](operator-this.md) operator
-- A [$](dollar.md) operator
+- A [`$`](dollar.md) operator
- A procedure definition
-- An [ALIGN](align-masm.md) directive
+- An [`ALIGN`](align-masm.md) directive
-- An [ORG](org.md) directive
+- An [`ORG`](org.md) directive
## See also
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2037.md b/docs/assembler/masm/ml-nonfatal-error-a2037.md
index 38416a396a..8f3aa5c882 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2037.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2037.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2037"
title: "ML Nonfatal Error A2037"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2037"]
helpviewer_keywords: ["A2037"]
ms.assetid: e7fdb98b-3ce9-4e1f-99fc-1b1ea10b6961
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2038.md b/docs/assembler/masm/ml-nonfatal-error-a2038.md
index e80aebd1bb..cc8d4dc964 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2038.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2038.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2038"
title: "ML Nonfatal Error A2038"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2038"]
helpviewer_keywords: ["A2038"]
ms.assetid: 001bf60a-58ac-4654-97eb-b734f2999f8e
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2039.md b/docs/assembler/masm/ml-nonfatal-error-a2039.md
index f281ad154f..055cb0540a 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2039.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2039.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2039"
title: "ML Nonfatal Error A2039"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2039"]
helpviewer_keywords: ["A2039"]
ms.assetid: ad8cdaae-b20d-45f0-acb1-79880979c6b7
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2044.md b/docs/assembler/masm/ml-nonfatal-error-a2044.md
index bd6b47e17f..0997887d02 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2044.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2044.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2044"
title: "ML Nonfatal Error A2044"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2044"]
helpviewer_keywords: ["A2044"]
ms.assetid: 7cf144ac-408c-4e35-9a15-38656a4e87cd
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2047.md b/docs/assembler/masm/ml-nonfatal-error-a2047.md
index 31611b75c2..6896fe8592 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2047.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2047.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2047"
title: "ML Nonfatal Error A2047"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2047"]
helpviewer_keywords: ["A2047"]
ms.assetid: 7799f988-6c2e-4022-a447-c56b48473f0c
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2050.md b/docs/assembler/masm/ml-nonfatal-error-a2050.md
index dba465efd8..924f38d3f9 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2050.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2050.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2050"
title: "ML Nonfatal Error A2050"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2050"]
helpviewer_keywords: ["A2050"]
ms.assetid: 16f3a58f-4bde-48f1-b0e3-2ed9612780a5
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2054.md b/docs/assembler/masm/ml-nonfatal-error-a2054.md
index d4b0d750d7..febf4f6c4e 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2054.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2054.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2054"
title: "ML Nonfatal Error A2054"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2054"]
helpviewer_keywords: ["A2054"]
ms.assetid: 878a2ced-0b88-49e5-bea5-0a014efb08b6
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2055.md b/docs/assembler/masm/ml-nonfatal-error-a2055.md
index 057ed4ca3b..54e57104a9 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2055.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2055.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2055"
title: "ML Nonfatal Error A2055"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2055"]
helpviewer_keywords: ["A2055"]
ms.assetid: b4c3585f-6e55-4127-ba84-e68a41f1ada8
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2057.md b/docs/assembler/masm/ml-nonfatal-error-a2057.md
index 39029959c4..98ba11536a 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2057.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2057.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2057"
title: "ML Nonfatal Error A2057"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2057"]
helpviewer_keywords: ["A2057"]
ms.assetid: 13c47848-3f4d-4145-a00c-5418ff176ba3
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2059.md b/docs/assembler/masm/ml-nonfatal-error-a2059.md
index aa648c9909..4f563d54ac 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2059.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2059.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2059"
title: "ML Nonfatal Error A2059"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2059"]
helpviewer_keywords: ["A2059"]
ms.assetid: fadabbce-3054-4758-aeae-34d8540ce410
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2060.md b/docs/assembler/masm/ml-nonfatal-error-a2060.md
index eb4c2bca21..3e74b86485 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2060.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2060.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2060"
title: "ML Nonfatal Error A2060"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2060"]
helpviewer_keywords: ["A2060"]
ms.assetid: 435d5b32-9b4f-4f4e-8142-af0ce7676e89
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2063.md b/docs/assembler/masm/ml-nonfatal-error-a2063.md
index ad369aba9e..2da91f339b 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2063.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2063.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2063"
title: "ML Nonfatal Error A2063"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2063"]
helpviewer_keywords: ["A2063"]
ms.assetid: 12976b25-2159-4e0c-9df3-dcfac61091ee
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2064.md b/docs/assembler/masm/ml-nonfatal-error-a2064.md
index 21bf975dca..ed06a37737 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2064.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2064.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2064"
title: "ML Nonfatal Error A2064"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2064"]
helpviewer_keywords: ["A2064"]
ms.assetid: 553a5ec5-b404-4321-ab2c-b9ccec6471fc
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2065.md b/docs/assembler/masm/ml-nonfatal-error-a2065.md
index 336fdc4b63..316f95333e 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2065.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2065.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2065"
title: "ML Nonfatal Error A2065"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2065"]
helpviewer_keywords: ["A2065"]
ms.assetid: 836e46c7-461a-4abc-8d48-03952c5b25f4
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2066.md b/docs/assembler/masm/ml-nonfatal-error-a2066.md
index 529b93d4f7..f1583f30b5 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2066.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2066.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2066"
title: "ML Nonfatal Error A2066"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2066"]
helpviewer_keywords: ["A2066"]
ms.assetid: 58220fdf-fb8f-47fc-a36d-737867361185
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2069.md b/docs/assembler/masm/ml-nonfatal-error-a2069.md
index 7403f746f1..5ebda337f1 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2069.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2069.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2069"
title: "ML Nonfatal Error A2069"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2069"]
helpviewer_keywords: ["A2069"]
ms.assetid: 57dbf072-da61-4306-8d41-a4d9c97fec1a
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2070.md b/docs/assembler/masm/ml-nonfatal-error-a2070.md
index 0ceafc257e..2267b0ccdd 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2070.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2070.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2070"
title: "ML Nonfatal Error A2070"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2070"]
helpviewer_keywords: ["A2070"]
ms.assetid: f6025e2c-b142-426f-88c8-7160df4c1631
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2074.md b/docs/assembler/masm/ml-nonfatal-error-a2074.md
index d3fd8fe842..50f575f954 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2074.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2074.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2074"
title: "ML Nonfatal Error A2074"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2074"]
helpviewer_keywords: ["A2074"]
ms.assetid: d19600d8-785b-4afb-af77-9dbbeb6a1275
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2078.md b/docs/assembler/masm/ml-nonfatal-error-a2078.md
index 636fed7832..0b287e79bd 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2078.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2078.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2078"
title: "ML Nonfatal Error A2078"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2078"]
helpviewer_keywords: ["A2078"]
ms.assetid: 42ac48fd-ac7f-4e74-a11e-20181d443faf
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2079.md b/docs/assembler/masm/ml-nonfatal-error-a2079.md
index cc2dd601f5..f04053fcc4 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2079.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2079.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2079"
title: "ML Nonfatal Error A2079"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2079"]
helpviewer_keywords: ["A2079"]
ms.assetid: 87003fa1-ce71-4572-9efc-06a4404860ab
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2083.md b/docs/assembler/masm/ml-nonfatal-error-a2083.md
index 6d5a9e0898..0e852033cd 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2083.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2083.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2083"
title: "ML Nonfatal Error A2083"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2083"]
helpviewer_keywords: ["A2083"]
ms.assetid: d2715877-1702-44e5-ab8f-6ef1fb6069f1
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2085.md b/docs/assembler/masm/ml-nonfatal-error-a2085.md
index 78664076a6..70def6928d 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2085.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2085.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2085"
title: "ML Nonfatal Error A2085"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2085"]
helpviewer_keywords: ["A2085"]
ms.assetid: c2fef415-a32b-4249-896c-6d981fc6e327
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2096.md b/docs/assembler/masm/ml-nonfatal-error-a2096.md
index 100cf67596..f670b73aca 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2096.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2096.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2096"
title: "ML Nonfatal Error A2096"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2096"]
helpviewer_keywords: ["A2096"]
ms.assetid: bab0b5ee-b39f-4e44-a41a-3f949fab4297
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2097.md b/docs/assembler/masm/ml-nonfatal-error-a2097.md
index 9f35dcdc76..abeea9f8f9 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2097.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2097.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2097"
title: "ML Nonfatal Error A2097"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2097"]
helpviewer_keywords: ["A2097"]
ms.assetid: 52f6f1f8-4eb4-4264-8619-7b9ccb20c0c7
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2107.md b/docs/assembler/masm/ml-nonfatal-error-a2107.md
index 5f26d5f2e6..0c7b3ad230 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2107.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2107.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2107"
title: "ML Nonfatal Error A2107"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2107"]
helpviewer_keywords: ["A2107"]
ms.assetid: 0385b9f2-36df-4e30-a905-ab49bdc504d1
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2119.md b/docs/assembler/masm/ml-nonfatal-error-a2119.md
index e487e73215..e19e92eb19 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2119.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2119.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2119"
title: "ML Nonfatal Error A2119"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2119"]
helpviewer_keywords: ["A2119"]
ms.assetid: 4d4ee6da-3a58-495c-a1da-c3a405c4c18d
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2133.md b/docs/assembler/masm/ml-nonfatal-error-a2133.md
index 69b444fba7..fa9872a213 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2133.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2133.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2133"
title: "ML Nonfatal Error A2133"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2133"]
helpviewer_keywords: ["A2133"]
ms.assetid: 5ba50911-22c8-43b7-90e2-946fc612e05f
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2137.md b/docs/assembler/masm/ml-nonfatal-error-a2137.md
index a06ef7e218..d9c908f94f 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2137.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2137.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2137"
title: "ML Nonfatal Error A2137"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2137"]
helpviewer_keywords: ["A2137"]
ms.assetid: 913172e3-866e-49c3-9502-e49d1f0df4b0
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2189.md b/docs/assembler/masm/ml-nonfatal-error-a2189.md
index 4b5ed1af16..2fca4c0dc4 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2189.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2189.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2189"
title: "ML Nonfatal Error A2189"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2189"]
helpviewer_keywords: ["A2189"]
ms.assetid: 39649f39-57bc-4ceb-ab16-53f9b2a8d2d5
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2206.md b/docs/assembler/masm/ml-nonfatal-error-a2206.md
index 688342d02b..8a1264fe6c 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2206.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2206.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2206"
title: "ML Nonfatal Error A2206"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2206"]
helpviewer_keywords: ["A2206"]
ms.assetid: 711846d0-5a09-4353-8857-60588c25526a
diff --git a/docs/assembler/masm/ml-nonfatal-error-a2219.md b/docs/assembler/masm/ml-nonfatal-error-a2219.md
index efe52667e4..7d6dc6b457 100644
--- a/docs/assembler/masm/ml-nonfatal-error-a2219.md
+++ b/docs/assembler/masm/ml-nonfatal-error-a2219.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Nonfatal Error A2219"
title: "ML Nonfatal Error A2219"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A2219"]
helpviewer_keywords: ["A2219"]
ms.assetid: 5ebc2f40-e47e-4f8e-b7b9-960b9cfc9f6d
diff --git a/docs/assembler/masm/ml-warning-a4004.md b/docs/assembler/masm/ml-warning-a4004.md
index d1631f84d9..ee4e7df825 100644
--- a/docs/assembler/masm/ml-warning-a4004.md
+++ b/docs/assembler/masm/ml-warning-a4004.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Warning A4004"
title: "ML Warning A4004"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A4004"]
helpviewer_keywords: ["A4004"]
ms.assetid: f11b13c9-fa8d-49f2-b816-a6b7871c7261
diff --git a/docs/assembler/masm/ml-warning-a4012.md b/docs/assembler/masm/ml-warning-a4012.md
index bb5ff35a53..52fe3645e8 100644
--- a/docs/assembler/masm/ml-warning-a4012.md
+++ b/docs/assembler/masm/ml-warning-a4012.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Warning A4012"
title: "ML Warning A4012"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A4012"]
helpviewer_keywords: ["A4012"]
ms.assetid: 842b1259-9679-4eeb-a02d-672a583a94e5
diff --git a/docs/assembler/masm/ml-warning-a4014.md b/docs/assembler/masm/ml-warning-a4014.md
index 9550b5f042..dbecdeb23c 100644
--- a/docs/assembler/masm/ml-warning-a4014.md
+++ b/docs/assembler/masm/ml-warning-a4014.md
@@ -2,7 +2,7 @@
description: "Learn more about: ML Warning A4014"
title: "ML Warning A4014"
ms.date: "12/17/2019"
-ms.custom: "error-reference"
+ms.topic: error-reference
f1_keywords: ["A4014"]
helpviewer_keywords: ["A4014"]
ms.assetid: 11bc8920-3255-4ac8-999a-b9ea9c15bc81
diff --git a/docs/assembler/masm/operator-this.md b/docs/assembler/masm/operator-this.md
index 7f6640e917..bf1695d145 100644
--- a/docs/assembler/masm/operator-this.md
+++ b/docs/assembler/masm/operator-this.md
@@ -6,13 +6,13 @@ f1_keywords: ["this", "operator THIS"]
helpviewer_keywords: ["operator THIS", "THIS operator"]
ms.assetid: d795aa0e-6c01-49b7-8c64-8ab111fd82d3
---
-# operator THIS
+# operator `THIS`
Returns an operand of specified *type* whose offset and segment values are equal to the current location counter value.
## Syntax
-> **THIS** *type*
+> **`THIS`** *type*
## See also
diff --git a/docs/assembler/masm/option-avxencoding-masm.md b/docs/assembler/masm/option-avxencoding-masm.md
index c019dc5f8c..806b205a3b 100644
--- a/docs/assembler/masm/option-avxencoding-masm.md
+++ b/docs/assembler/masm/option-avxencoding-masm.md
@@ -1,9 +1,9 @@
---
title: "OPTION AVXENCODING"
+description: Describes how to select the preferred encoding of AVX instructions when more than one possibility will work
ms.date: "10/06/2020"
f1_keywords: ["avxencoding"]
helpviewer_keywords: ["OPTION AVXENCODING directive"]
-description: Describes how to select the preferred encoding of AVX instructions when more than one possibility will work
---
# OPTION AVXENCODING
@@ -47,7 +47,7 @@ The **`OPTION AVXENCODING`** directive is available in Visual Studio 2019 versio
### Example
-This example uses `VPDPBUSD` and `VPMADDWD` instructions to illustrate how the **`AVXENCODING`** option works. `VPDPBUSD` was first defined to be encoded only with `EVEX`, and was later extended with a VEX-encoded form for platforms without AVX-512 support, while `VPMADDWD` was AVX and extended to AVX-512. The listing output from assembling the example shows how changing the **`AVXENCODING`** mode affects the object code generated for each instruction. The prefix for each instruction ends at the '/".
+This example uses `VPDPBUSD` and `VPMADDWD` instructions to illustrate how the **`AVXENCODING`** option works. `VPDPBUSD` was first defined to be encoded only with `EVEX`, and was later extended with a VEX-encoded form for platforms without AVX-512 support, while `VPMADDWD` was AVX and extended to AVX-512. The listing output from assembling the example shows how changing the **`AVXENCODING`** mode affects the object code generated for each instruction. The prefix for each instruction ends at the "/".
```asm
00000000 62 F2 6D 08/ 50 vpdpbusd xmm1, xmm2, xmm3
diff --git a/docs/assembler/masm/processor-manufacturer-programming-manuals.md b/docs/assembler/masm/processor-manufacturer-programming-manuals.md
index 1414153abd..4774fdeeb7 100644
--- a/docs/assembler/masm/processor-manufacturer-programming-manuals.md
+++ b/docs/assembler/masm/processor-manufacturer-programming-manuals.md
@@ -1,22 +1,18 @@
---
description: "Learn more about: Processor manufacturer programming manuals"
title: "Processor manufacturer programming manuals"
-ms.date: "05/28/2020"
-ms.assetid: 61844163-de2f-419a-808e-04de39dfdddf
+ms.date: "12/6/2024"
---
# Processor manufacturer programming manuals
-This article provides links to websites that may contain programming info about processors that aren't made, sold, or supported by Microsoft. Microsoft doesn't control the websites or their content.
+This article provides links to websites that may contain programming info about processors that Microsoft doesn't make, sell, or support. Microsoft doesn't control the websites or their content.
## Processor manufacturer websites
-- [AMD Developer Guides, Manuals & ISA Documents](https://developer.amd.com/resources/developer-guides-manuals/)
-
+- [AMD Documentation Hub](https://www.amd.com/en/search/documentation/hub.html)
- [ARM Architecture Reference Manual](https://developer.arm.com/documentation/ddi0487/latest/)
-
-- [Intel 64 and IA-32 Architectures Software Developer Manuals](https://software.intel.com/articles/intel-sdm)
-
-- [Introduction to Intel Advanced Vector Extensions](https://software.intel.com/articles/introduction-to-intel-advanced-vector-extensions)
+- [Intel 64 and IA-32 Architectures Software Developer Manuals](https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html)
+- [Introducing Intel® Advanced Performance Extensions (Intel APX)](https://www.intel.com/content/www/us/en/developer/articles/technical/advanced-performance-extensions-apx.html)
## Remarks
diff --git a/docs/assembler/masm/purge.md b/docs/assembler/masm/purge.md
index 2e19584edd..9051b7fae9 100644
--- a/docs/assembler/masm/purge.md
+++ b/docs/assembler/masm/purge.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: PURGE"
title: "PURGE"
+description: "Learn more about: PURGE"
ms.date: "12/16/2019"
f1_keywords: ["PURGE"]
helpviewer_keywords: ["PURGE directive"]
-ms.assetid: 1e7ec2bf-f123-4ff9-97de-28b512ade2f9
---
# PURGE
@@ -16,5 +15,5 @@ Deletes the specified macros from memory.
## See also
-[Directives reference](directives-reference.md)
+[Directives reference](directives-reference.md)\
[MASM BNF Grammar](masm-bnf-grammar.md)
diff --git a/docs/assembler/masm/subttl.md b/docs/assembler/masm/subttl.md
index b59e41f224..a119b8eb14 100644
--- a/docs/assembler/masm/subttl.md
+++ b/docs/assembler/masm/subttl.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: SUBTTL"
title: "SUBTTL"
+description: "Learn more about: SUBTTL"
ms.date: "12/16/2019"
f1_keywords: ["SUBTTL"]
helpviewer_keywords: ["SUBTTL directive"]
-ms.assetid: 927efadd-ec99-4de9-b64d-229bb2df3bf4
---
# SUBTTL
@@ -16,5 +15,5 @@ See [SUBTITLE](subtitle.md).
## See also
-[Directives reference](directives-reference.md)
+[Directives reference](directives-reference.md)\
[MASM BNF Grammar](masm-bnf-grammar.md)
diff --git a/docs/atl-mfc-shared/allocating-and-releasing-memory-for-a-bstr.md b/docs/atl-mfc-shared/allocating-and-releasing-memory-for-a-bstr.md
index 8089fa46bc..b257f105f9 100644
--- a/docs/atl-mfc-shared/allocating-and-releasing-memory-for-a-bstr.md
+++ b/docs/atl-mfc-shared/allocating-and-releasing-memory-for-a-bstr.md
@@ -15,16 +15,16 @@ In general, the rules for allocating and releasing memory allocated for `BSTR`s
- When you call into a function that expects a `BSTR` argument, you must allocate the memory for the `BSTR` before the call and release it afterwards. For example:
[!code-cpp[NVC_ATLMFC_Utilities#192](../atl-mfc-shared/codesnippet/cpp/allocating-and-releasing-memory-for-a-bstr_1.cpp)]
-
+
[!code-cpp[NVC_ATLMFC_Utilities#193](../atl-mfc-shared/codesnippet/cpp/allocating-and-releasing-memory-for-a-bstr_2.cpp)]
- When you call into a function that returns a `BSTR`, you must free the string yourself. For example:
[!code-cpp[NVC_ATLMFC_Utilities#194](../atl-mfc-shared/codesnippet/cpp/allocating-and-releasing-memory-for-a-bstr_3.cpp)]
-
+
[!code-cpp[NVC_ATLMFC_Utilities#195](../atl-mfc-shared/codesnippet/cpp/allocating-and-releasing-memory-for-a-bstr_4.cpp)]
-- When you implement a function that returns a `BSTR`, allocate the string but do not free it. The receiving the function releases the memory. For example:
+- When you implement a function that returns a `BSTR`, allocate the string but do not free it. The receiving function releases the memory. For example:
[!code-cpp[NVC_ATLMFC_Utilities#196](../atl-mfc-shared/codesnippet/cpp/allocating-and-releasing-memory-for-a-bstr_5.cpp)]
diff --git a/docs/atl-mfc-shared/basic-cstring-operations.md b/docs/atl-mfc-shared/basic-cstring-operations.md
index 41926fe05b..047bd978b2 100644
--- a/docs/atl-mfc-shared/basic-cstring-operations.md
+++ b/docs/atl-mfc-shared/basic-cstring-operations.md
@@ -1,9 +1,8 @@
---
-description: "Learn more about: Basic CString Operations"
title: "Basic CString Operations"
-ms.date: "11/04/2016"
+description: "Learn more about: Basic CString Operations"
+ms.date: 11/04/2016
helpviewer_keywords: ["CString objects, basic operations", "string literals, CString operations", "literal strings, CString operations", "CString objects", "string comparison, CString operations", "characters, accessing in CStrings"]
-ms.assetid: 41db66b2-9427-4bb3-845a-9b6869159a6c
---
# Basic CString Operations
@@ -19,7 +18,7 @@ This topic explains the following basic [CString](../atl-mfc-shared/reference/cs
- [Converting CString objects](#_core_converting_cstring_objects)
-`Class CString` is based on class template [CStringT Class](../atl-mfc-shared/reference/cstringt-class.md). `CString` is a **`typedef`** of `CStringT`. More exactly, `CString` is a **`typedef`** of an *explicit specialization* of `CStringT`, which is a common way to use a class template to define a class. Similarly defined classes are `CStringA` and `CStringW`.
+`Class CString` is based on class template [`CStringT`](../atl-mfc-shared/reference/cstringt-class.md). `CString` is a **`typedef`** of `CStringT`. More exactly, `CString` is a **`typedef`** of an *explicit specialization* of `CStringT`, which is a common way to use a class template to define a class. Similarly defined classes are `CStringA` and `CStringW`.
`CString`, `CStringA`, and `CStringW` are defined in atlstr.h. `CStringT` is defined in cstringt.h.
diff --git a/docs/atl-mfc-shared/codesnippet/CPP/cstringt-class_2.cpp b/docs/atl-mfc-shared/codesnippet/CPP/cstringt-class_2.cpp
index 78a3ad3444..2b6ff825fd 100644
--- a/docs/atl-mfc-shared/codesnippet/CPP/cstringt-class_2.cpp
+++ b/docs/atl-mfc-shared/codesnippet/CPP/cstringt-class_2.cpp
@@ -1,5 +1,5 @@
// OEM character 252 on most IBM-compatible computers in
- // Western countries/regions is superscript n, as in 2^n.
+ // many countries/regions is superscript n, as in 2^n.
// Converting it to the ANSI English charset results in a
// normal character 'n', which is the closest possible
// representation.
@@ -14,4 +14,4 @@
// the character's value truly was.
str.AnsiToOem();
ASSERT(str[0] != 252);
- ASSERT(str[0] == 'n');
\ No newline at end of file
+ ASSERT(str[0] == 'n');
diff --git a/docs/atl-mfc-shared/codesnippet/CPP/cstringt-class_37.cpp b/docs/atl-mfc-shared/codesnippet/CPP/cstringt-class_37.cpp
index e9d808179a..2dd71b8650 100644
--- a/docs/atl-mfc-shared/codesnippet/CPP/cstringt-class_37.cpp
+++ b/docs/atl-mfc-shared/codesnippet/CPP/cstringt-class_37.cpp
@@ -3,6 +3,6 @@
// or an apostrophe(').
// typedef CStringT>> CAtlString;
- CAtlString src(_T("World Cup '98"));
+ CAtlString src(_T("abcdef"));
_tprintf_s(_T("%s"),src.SpanExcluding(_T(";,.-'")));
\ No newline at end of file
diff --git a/docs/atl-mfc-shared/cstring-argument-passing.md b/docs/atl-mfc-shared/cstring-argument-passing.md
index 763e4adea7..68ff5addc6 100644
--- a/docs/atl-mfc-shared/cstring-argument-passing.md
+++ b/docs/atl-mfc-shared/cstring-argument-passing.md
@@ -3,21 +3,20 @@ description: "Learn more about: CString Argument Passing"
title: "CString Argument Passing"
ms.date: "11/04/2016"
helpviewer_keywords: ["strings [C++], as function input/output", "argument passing [C++]", "arguments [C++], passing", "functions [C++], strings as input/output", "argument passing [C++], C strings", "passing arguments, C strings", "CString objects, passing arguments", "string arguments"]
-ms.assetid: a67bebff-edf1-4cf4-bbff-d1cc6a901099
---
-# CString Argument Passing
+# `CString` Argument Passing
-This article explains how to pass [CString](../atl-mfc-shared/reference/cstringt-class.md) objects to functions and how to return `CString` objects from functions.
+This article explains how to pass [`CString`](../atl-mfc-shared/reference/cstringt-class.md) objects to functions and how to return `CString` objects from functions.
-## CString Argument-Passing Conventions
+## `CString` Argument-Passing Conventions
-When you define a class interface, you must determine the argument-passing convention for your member functions. There are some standard rules for passing and returning `CString` objects. If you follow the rules described in [Strings as Function Inputs](#_core_strings_as_function_inputs) and [Strings as Function Outputs](#_core_strings_as_function_outputs), you will have efficient, correct code.
+When you define a class interface, you must determine the argument-passing convention for your member functions. There are some standard rules for passing and returning `CString` objects. If you follow the rules described in [Strings as Function Inputs](#_core_strings_as_function_inputs) and [Strings as Function Outputs](#_core_strings_as_function_outputs), you'll have efficient, correct code.
## 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 does not 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 does not 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.
+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.
If the string contents are to be changed by a function, declare the parameter as a nonconstant `CString` reference (`CString&`).
@@ -26,7 +25,7 @@ If the string contents are to be changed by a function, declare the parameter as
Typically you can return `CString` objects from functions because `CString` objects follow value semantics like primitive types. To return a read-only string, use a constant `CString` reference (`const CString&`). The following example illustrates the use of `CString` parameters and return types:
[!code-cpp[NVC_ATLMFC_Utilities#197](../atl-mfc-shared/codesnippet/cpp/cstring-argument-passing_1.cpp)]
-
+
[!code-cpp[NVC_ATLMFC_Utilities#198](../atl-mfc-shared/codesnippet/cpp/cstring-argument-passing_2.cpp)]
## See also
diff --git a/docs/atl-mfc-shared/date-and-time.md b/docs/atl-mfc-shared/date-and-time.md
index ccc38a2767..6285d86cb2 100644
--- a/docs/atl-mfc-shared/date-and-time.md
+++ b/docs/atl-mfc-shared/date-and-time.md
@@ -3,33 +3,32 @@ description: "Learn more about: Date and Time"
title: "Date and Time"
ms.date: "08/13/2019"
helpviewer_keywords: ["time, MFC programming", "time", "MFC, date and time", "dates, MFC"]
-ms.assetid: ecf56dc5-d418-4603-ad3e-af7e205a6403
---
# Date and Time
MFC supports several different ways of working with dates and times:
-- Support for the Automation [DATE data type](../atl-mfc-shared/date-type.md). DATE supports date, time, and date/time values. The [COleDateTime](../atl-mfc-shared/reference/coledatetime-class.md) and [COleDateTimeSpan](../atl-mfc-shared/reference/coledatetimespan-class.md) classes encapsulate this functionality. They work with the [COleVariant](../mfc/reference/colevariant-class.md) class using Automation support.
+- Support for the Automation [`DATE` data type](../atl-mfc-shared/date-type.md). `DATE` supports date, time, and date/time values. The [`COleDateTime`](../atl-mfc-shared/reference/coledatetime-class.md) and [`COleDateTimeSpan`](../atl-mfc-shared/reference/coledatetimespan-class.md) classes encapsulate this functionality. They work with the [`COleVariant`](../mfc/reference/colevariant-class.md) class using Automation support.
-- General-purpose time classes. The [CTime](../atl-mfc-shared/reference/ctime-class.md) and [CTimeSpan](../atl-mfc-shared/reference/ctimespan-class.md) classes encapsulate most of the functionality associated with the ANSI-standard time library, which is declared in TIME.H.
+- General-purpose time classes. The [`CTime`](../atl-mfc-shared/reference/ctime-class.md) and [`CTimeSpan`](../atl-mfc-shared/reference/ctimespan-class.md) classes encapsulate most of the functionality associated with the ANSI-standard time library, which is declared in `time.h`.
- Support for system clock. With MFC version 3.0, support was added to `CTime` for the Win32 `SYSTEMTIME` and `FILETIME` data types.
## Date and Time: Automation Support
-The [COleDateTime](../atl-mfc-shared/reference/coledatetime-class.md) class provides a way to represent date and time information. It provides finer granularity and a greater range than the [CTime](../atl-mfc-shared/reference/ctime-class.md) class. The [COleDateTimeSpan](../atl-mfc-shared/reference/coledatetimespan-class.md) class represents elapsed time, such as the difference between two `COleDateTime` objects.
+The [`COleDateTime`](../atl-mfc-shared/reference/coledatetime-class.md) class provides a way to represent date and time information. It provides finer granularity and a greater range than the [`CTime`](../atl-mfc-shared/reference/ctime-class.md) class. The [`COleDateTimeSpan`](../atl-mfc-shared/reference/coledatetimespan-class.md) class represents elapsed time, such as the difference between two `COleDateTime` objects.
-The `COleDateTime` and `COleDateTimeSpan` classes are designed for use with the `COleVariant` class. `COleDateTime` and `COleDateTimeSpan` are also useful in MFC database programming, but they can be used whenever you want to manipulate date and time values. Although the `COleDateTime` class has a greater range of values and finer granularity than the `CTime` class, it requires more storage per object than `CTime`. There are also some special considerations when working with the underlying DATE type. For more information on the implementation of DATE, see [The DATE Type](../atl-mfc-shared/date-type.md).
+The `COleDateTime` and `COleDateTimeSpan` classes are designed for use with the `COleVariant` class. `COleDateTime` and `COleDateTimeSpan` are also useful in MFC database programming, but they can be used whenever you want to manipulate date and time values. Although the `COleDateTime` class has a greater range of values and finer granularity than the `CTime` class, it requires more storage per object than `CTime`. There are also some special considerations when working with the underlying DATE type. For more information on the implementation of `DATE`, see [The `DATE` Type](../atl-mfc-shared/date-type.md).
-`COleDateTime` objects can be used to represent dates between January 1, 100, and December 31, 9999. `COleDateTime` objects are floating point values, with an approximate resolution of 1 millisecond. `COleDateTime` is based on the DATE data type, defined in the MFC documentation under [COleDateTime::operator DATE](../atl-mfc-shared/reference/coledatetime-class.md#operator_date). The actual implementation of DATE extends beyond these bounds. The `COleDateTime` implementation imposes these bounds to make it easier to work with the class.
+`COleDateTime` objects can be used to represent dates between January 1, 100, and December 31, 9999. `COleDateTime` objects are floating point values, with an approximate resolution of 1 millisecond. `COleDateTime` is based on the `DATE` data type, defined in the MFC documentation under [`COleDateTime::operator DATE`](../atl-mfc-shared/reference/coledatetime-class.md#operator_date). The actual implementation of `DATE` extends beyond these bounds. The `COleDateTime` implementation imposes these bounds to make it easier to work with the class.
`COleDateTime` doesn't support Julian dates. The Gregorian calendar is assumed to extend back in time to January 1, 100.
`COleDateTime` ignores Daylight Saving Time (DST). The following code example compares two methods of calculating a time span that crosses the DST switchover date: one using the CRT, and the other using `COleDateTime`.
-The first method sets two `CTime` objects, *time1* and *time2*, to April 5 and April 6 respectively, using the standard C type structures `tm` and `time_t`. The code displays *time1* and *time2* and the time span between them.
+The first method sets two `CTime` objects, *`time1`* and *`time2`*, to April 5 and April 6 respectively, using the standard C type structures `tm` and `time_t`. The code displays *`time1`* and *`time2`* and the time span between them.
-The second method creates two `COleDateTime` objects, `oletime1` and `oletime2`, and sets them to the same dates as *time1* and *time2*. It displays `oletime1` and `oletime2` and the time span between them.
+The second method creates two `COleDateTime` objects, `oletime1` and `oletime2`, and sets them to the same dates as *`time1`* and *`time2`*. It displays `oletime1` and `oletime2` and the time span between them.
The CRT correctly calculates a difference of 23 hours. `COleDateTimeSpan` calculates a difference of 24 hours.
@@ -69,21 +68,21 @@ This procedure shows how to calculate the difference between two `COleDateTime`
#### To format a time
-Use the `Format` member function of either [COleDateTime](../atl-mfc-shared/reference/coledatetime-class.md) or [COleDateTimeSpan](../atl-mfc-shared/reference/coledatetimespan-class.md) to create a character string representing the time or elapsed time.
+Use the `Format` member function of either [`COleDateTime`](../atl-mfc-shared/reference/coledatetime-class.md) or [`COleDateTimeSpan`](../atl-mfc-shared/reference/coledatetimespan-class.md) to create a character string representing the time or elapsed time.
[!code-cpp[NVC_ATLMFC_Utilities#179](../atl-mfc-shared/codesnippet/cpp/formatting-time-automation-classes_1.cpp)]
-For more information, see class [COleVariant](../mfc/reference/colevariant-class.md).
+For more information, see class [`COleVariant`](../mfc/reference/colevariant-class.md).
## Date and Time: Database Support
-Starting in version 4.0, MFC database programming uses the [COleDateTime](../atl-mfc-shared/reference/coledatetime-class.md) and [COleDateTimeSpan](../atl-mfc-shared/reference/coledatetimespan-class.md) classes to represent date and time data. These classes, also used in Automation, are derived from class [COleVariant](../mfc/reference/colevariant-class.md). They supply better support for managing date and time data than do [CTime](../atl-mfc-shared/reference/ctime-class.md) and [CTimeSpan](../atl-mfc-shared/reference/ctimespan-class.md).
+Starting in version 4.0, MFC database programming uses the [`COleDateTime`](../atl-mfc-shared/reference/coledatetime-class.md) and [`COleDateTimeSpan`](../atl-mfc-shared/reference/coledatetimespan-class.md) classes to represent date and time data. These classes, also used in Automation, are derived from class [`COleVariant`](../mfc/reference/colevariant-class.md). They supply better support for managing date and time data than do [`CTime`](../atl-mfc-shared/reference/ctime-class.md) and [`CTimeSpan`](../atl-mfc-shared/reference/ctimespan-class.md).
-## Date and Time: SYSTEMTIME Support
+## Date and Time: `SYSTEMTIME` Support
-The [COleDateTime](../atl-mfc-shared/reference/coledatetime-class.md) class has constructors that accept system and file times from Win32.
+The [`COleDateTime`](../atl-mfc-shared/reference/coledatetime-class.md) class has constructors that accept system and file times from Win32.
-The Win32 `FILETIME` structure represents time as a 64-bit value. It's a more convenient format for internal storage than a `SYSTEMTIME` structure, and the format used by Win32 to represent the time of file creation. For information about the SYSTEMTIME structure, see [SYSTEMTIME](/windows/desktop/api/minwinbase/ns-minwinbase-systemtime). For information about the FILETIME structure, see [FILETIME](/windows/desktop/api/minwinbase/ns-minwinbase-filetime).
+The Win32 `FILETIME` structure represents time as a 64-bit value. It's a more convenient format for internal storage than a `SYSTEMTIME` structure, and the format used by Win32 to represent the time of file creation. For information about the `SYSTEMTIME` structure, see [`SYSTEMTIME`](/windows/desktop/api/minwinbase/ns-minwinbase-systemtime). For information about the `FILETIME` structure, see [`FILETIME`](/windows/desktop/api/minwinbase/ns-minwinbase-filetime).
## See also
diff --git a/docs/atl-mfc-shared/exporting-string-classes-using-cstringt.md b/docs/atl-mfc-shared/exporting-string-classes-using-cstringt.md
index 43fae08362..3e5b794a88 100644
--- a/docs/atl-mfc-shared/exporting-string-classes-using-cstringt.md
+++ b/docs/atl-mfc-shared/exporting-string-classes-using-cstringt.md
@@ -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)]
diff --git a/docs/atl-mfc-shared/reference/cfixedstringt-class.md b/docs/atl-mfc-shared/reference/cfixedstringt-class.md
index f550ca44b9..c236dcb8d4 100644
--- a/docs/atl-mfc-shared/reference/cfixedstringt-class.md
+++ b/docs/atl-mfc-shared/reference/cfixedstringt-class.md
@@ -12,7 +12,7 @@ This class represents a string object with a fixed character buffer.
## Syntax
-```
+```cpp
template
class CFixedStringT : private CFixedStringMgr, public StringType
```
@@ -69,7 +69,7 @@ For more information on the customization of `CFixedStringT` and memory manageme
Constructs a `CFixedStringT` object.
-```
+```cpp
CFixedStringT() throw();
explicit CFixedStringT(IAtlStringMgr* pStringMgr) throw();
CFixedStringT(const CFixedStringT& strSrc);
@@ -98,7 +98,7 @@ Because the constructors copy the input data into new allocated storage, you sho
Reinitializes an existing `CFixedStringT` object with new data.
-```
+```cpp
CFixedStringT& operator=(
const CFixedStringT& strSrc);
CFixedStringT& operator=(const char* pszSrc);
diff --git a/docs/atl-mfc-shared/reference/cimage-class.md b/docs/atl-mfc-shared/reference/cimage-class.md
index bf3f47881b..0dd7899250 100644
--- a/docs/atl-mfc-shared/reference/cimage-class.md
+++ b/docs/atl-mfc-shared/reference/cimage-class.md
@@ -15,7 +15,7 @@ ms.assetid: 52861e3d-bf7e-481f-a240-90e88f76c490
## Syntax
-```
+```cpp
class CImage
```
@@ -148,7 +148,7 @@ You can use `CImage` from either MFC or ATL.
Displays bitmaps that have transparent or semitransparent pixels.
-```
+```cpp
BOOL AlphaBlend(
HDC hDestDC,
int xDest,
@@ -267,7 +267,7 @@ The bitmap can be either a non-DIB section bitmap or a DIB section bitmap. See [
Copies a bitmap from the source device context to this current device context.
-```
+```cpp
BOOL BitBlt(
HDC hDestDC,
int xDest,
@@ -343,7 +343,7 @@ For more information, see [`BitBlt`](/windows/win32/api/wingdi/nf-wingdi-bitblt)
Constructs a `CImage` object.
-```
+```cpp
CImage() throw();
```
@@ -359,7 +359,7 @@ Using global `CImage` objects in a DLL is not recommended. If you need to use a
Creates a `CImage` bitmap and attach it to the previously constructed `CImage` object.
-```
+```cpp
BOOL Create(
int nWidth,
int nHeight,
@@ -394,7 +394,7 @@ Nonzero if successful; otherwise 0.
Creates a `CImage` bitmap and attach it to the previously constructed `CImage` object.
-```
+```cpp
BOOL CreateEx(
int nWidth,
int nHeight,
@@ -458,7 +458,7 @@ void Destroy() throw();
Detaches a bitmap from a `CImage` object.
-```
+```cpp
HBITMAP Detach() throw();
```
@@ -470,7 +470,7 @@ A handle to the bitmap detached, or `NULL` if no bitmap is attached.
Copies a bitmap from the source device context to the current device context.
-```
+```cpp
BOOL Draw(
HDC hDestDC,
int xDest,
@@ -579,7 +579,7 @@ Using this pointer, along with the value returned by [`GetPitch`](#getpitch), yo
Retrieves the bits-per-pixel value.
-```
+```cpp
int GetBPP() const throw();
```
@@ -619,7 +619,7 @@ A pointer to the array of [`RGBQUAD`](/windows/win32/api/wingdi/ns-wingdi-rgbqua
Retrieves the device context that currently has the image selected into it.
-```
+```cpp
HDC GetDC() const throw();
```
@@ -635,7 +635,7 @@ For each call to `GetDC`, you must have a subsequent call to [`ReleaseDC`](#rele
Finds image formats available for saving images.
-```
+```cpp
static HRESULT GetExporterFilterString(
CSimpleString& strExporters,
CSimpleArray& aguidFileTypes,
@@ -691,7 +691,7 @@ Set of bit flags specifying which file types to exclude from the list. Allowable
- `excludeDefaultLoad` = 0 For load, all file types are included by default
-- `excludeDefaultSave` = `excludeIcon | excludeEMF | excludeWMF` For saving, these files are excluded by default because they usually have special requirements.
+- `excludeDefaultSave` = `excludeIcon | excludeEMF | excludeWMF` For saving, these files are excluded by default because they usually have special requirements.
*`chSeparator`*
The separator used between the image formats. See **Remarks** for more information.
@@ -706,19 +706,19 @@ You can pass the resulting format string to your MFC [`CFileDialog`](../../mfc/r
The parameter *`strExporter`* has the format:
-file description0|\*.ext0|filedescription1|\*.ext1|...file description *n*|\*.ext *n*||
+`file description 0|*.ext0|file description 1|*.ext1|...file description N|*.extN||`
-where '|' is the separator character specified by `chSeparator`. For example:
+where `|` is the separator character specified by `chSeparator`. For example:
`"Bitmap format|*.bmp|JPEG format|*.jpg|GIF format|*.gif|PNG format|*.png||"`
-Use the default separator '|' if you pass this string to an MFC `CFileDialog` object. Use the null separator '\0' if you pass this string to a common File Save dialog box.
+Use the default separator `|` if you pass this string to an MFC `CFileDialog` object. Use the null separator `'\0'` if you pass this string to a common File Save dialog box.
## `CImage::GetHeight`
Retrieves the height, in pixels, of an image.
-```
+```cpp
int GetHeight() const throw();
```
@@ -730,7 +730,7 @@ The height, in pixels, of an image.
Finds image formats available for loading images.
-```
+```cpp
static HRESULT GetImporterFilterString(
CSimpleString& strImporters,
CSimpleArray& aguidFileTypes,
@@ -786,7 +786,7 @@ Set of bit flags specifying which file types to exclude from the list. Allowable
- `excludeDefaultLoad` = 0 For load, all file types are included by default
-- `excludeDefaultSave` = `excludeIcon | excludeEMF | excludeWMF` For saving, these files are excluded by default because they usually have special requirements.
+- `excludeDefaultSave` = `excludeIcon | excludeEMF | excludeWMF` For saving, these files are excluded by default because they usually have special requirements.
*`chSeparator`*
The separator used between the image formats. See **Remarks** for more information.
@@ -797,19 +797,19 @@ You can pass the resulting format string to your MFC [`CFileDialog`](../../mfc/r
The parameter *`strImporter`* has the format:
-file description0|\*.ext0|filedescription1|\*.ext1|...file description *n*|\*.ext *n*||
+`file description 0|*.ext0|file description 1|*.ext1|...file description N|*.extN||
-where '|' is the separator character specified by *`chSeparator`*. For example:
+where `|` is the separator character specified by *`chSeparator`*. For example:
`"Bitmap format|*.bmp|JPEG format|*.jpg|GIF format|*.gif|PNG format|*.png||"`
-Use the default separator '|' if you pass this string to an MFC `CFileDialog` object. Use the null separator '\0' if you pass this string to a common **File Open** dialog box.
+Use the default separator `|` if you pass this string to an MFC `CFileDialog` object. Use the null separator `'\0'` if you pass this string to a common **File Open** dialog box.
## `CImage::GetMaxColorTableEntries`
Retrieves the maximum number of entries in the color table.
-```
+```cpp
int GetMaxColorTableEntries() const throw();
```
@@ -825,7 +825,7 @@ This method supports only DIB section bitmaps.
Retrieves the pitch of an image.
-```
+```cpp
int GetPitch() const throw();
```
@@ -846,7 +846,7 @@ Use `GetPitch` with [`GetBits`](#getbits) to find individual pixels of an image.
Retrieves the color of the pixel at the location specified by *x* and *y*.
-```
+```cpp
COLORREF GetPixel(int x, int y) const throw();
```
@@ -891,7 +891,7 @@ For formats that have less than 8 bits per pixel, this method returns the addres
Retrieves the indexed location of the transparent color in the color palette.
-```
+```cpp
LONG GetTransparentColor() const throw();
```
@@ -903,7 +903,7 @@ The index of the transparent color.
Retrieves the width, in pixels, of an image.
-```
+```cpp
int GetWidth() const throw();
```
@@ -915,7 +915,7 @@ The width of the bitmap, in pixels.
Determines if the attached bitmap is a DIB section.
-```
+```cpp
bool IsDIBSection() const throw();
```
@@ -945,7 +945,7 @@ If the bitmap is not a DIB section, you cannot use the following `CImage` method
Determines whether a bitmap's pixels are mapped to a color palette.
-```
+```cpp
bool IsIndexed() const throw();
```
@@ -964,7 +964,7 @@ This method returns `TRUE` only if the bitmap is 8-bit (256 colors) or less.
Determines if a bitmap is currently loaded.
-```
+```cpp
bool IsNull() const throw();
```
@@ -976,7 +976,7 @@ This method returns `TRUE` if a bitmap is not currently loaded; otherwise `FALSE
Indicates whether the application supports transparent bitmaps.
-```
+```cpp
static BOOL IsTransparencySupported() throw();
```
@@ -992,7 +992,7 @@ If the return value is nonzero, and transparency is supported, a call to [`Alpha
Loads an image.
-```
+```cpp
HRESULT Load(LPCTSTR pszFileName) throw();
HRESULT Load(IStream* pStream) throw();
```
@@ -1048,7 +1048,7 @@ The resource must be of type `BITMAP`.
Combines the color data for the source and destination bitmaps using the specified mask and raster operation.
-```
+```cpp
BOOL MaskBlt(
HDC hDestDC,
int xDest,
@@ -1147,7 +1147,7 @@ Use this operator to get the attached Windows GDI handle of the `CImage` object.
Performs a bit-block transfer from a rectangle in a source device context into a parallelogram in a destination device context.
-```
+```cpp
BOOL PlgBlt(
HDC hDestDC,
const POINT* pPoints,
@@ -1245,7 +1245,7 @@ This method must be called to free resources allocated by a global `CImage` obje
Saves an image to the specified stream or file on disk.
-```
+```cpp
HRESULT Save(
IStream* pStream,
REFGUID guidFileType) const throw();
@@ -1391,7 +1391,7 @@ The red, green, and blue parameters are each represented by a number between 0 a
Sets a color at a given indexed location as transparent.
-```
+```cpp
LONG SetTransparentColor(LONG iTransparentColor) throw();
```
@@ -1408,7 +1408,7 @@ The index of the color previously set as transparent.
Copies a bitmap from the source device context to this current device context.
-```
+```cpp
BOOL StretchBlt(
HDC hDestDC,
int xDest,
@@ -1491,7 +1491,7 @@ For more information, see [`StretchBlt`](/windows/win32/api/wingdi/nf-wingdi-str
Copies a bitmap from the source device context to this current device context.
-```
+```cpp
BOOL TransparentBlt(
HDC hDestDC,
int xDest,
diff --git a/docs/atl-mfc-shared/reference/classes-shared-by-mfc-and-atl.md b/docs/atl-mfc-shared/reference/classes-shared-by-mfc-and-atl.md
index dd93cb77f4..bbcb2af079 100644
--- a/docs/atl-mfc-shared/reference/classes-shared-by-mfc-and-atl.md
+++ b/docs/atl-mfc-shared/reference/classes-shared-by-mfc-and-atl.md
@@ -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|
diff --git a/docs/atl-mfc-shared/reference/codesnippet/CPP/cfiledialog-class_3.cpp b/docs/atl-mfc-shared/reference/codesnippet/CPP/cfiledialog-class_3.cpp
index 69b8fc155d..9c7f028ed7 100644
--- a/docs/atl-mfc-shared/reference/codesnippet/CPP/cfiledialog-class_3.cpp
+++ b/docs/atl-mfc-shared/reference/codesnippet/CPP/cfiledialog-class_3.cpp
@@ -1,7 +1,7 @@
void CMyClass::OnFileOpen()
{
// szFilters is a text string that includes two file name filters:
- // "*.my" for "MyType Files" and "*.*' for "All Files."
+ // "*.my" for "MyType Files" and "*.*" for "All Files."
TCHAR szFilters[]= _T("MyType Files (*.my)|*.my|All Files (*.*)|*.*||");
// Create an Open dialog; the default file name extension is ".my".
diff --git a/docs/atl-mfc-shared/reference/coledatetime-class.md b/docs/atl-mfc-shared/reference/coledatetime-class.md
index 0747ec07ed..5da193d9b9 100644
--- a/docs/atl-mfc-shared/reference/coledatetime-class.md
+++ b/docs/atl-mfc-shared/reference/coledatetime-class.md
@@ -1,10 +1,9 @@
---
title: "COleDateTime Class"
description: "API reference for the MFC COleDateTime class which Encapsulates the `DATE` data type used in OLE automation."
-ms.date: "08/27/2020"
+ms.date: 08/27/2020
f1_keywords: ["COleDateTime", "ATLCOMTIME/ATL::COleDateTime", "ATLCOMTIME/ATL::COleDateTime::COleDateTime", "ATLCOMTIME/ATL::COleDateTime::Format", "ATLCOMTIME/ATL::COleDateTime::GetAsDBTIMESTAMP", "ATLCOMTIME/ATL::COleDateTime::GetAsSystemTime", "ATLCOMTIME/ATL::COleDateTime::GetAsUDATE", "ATLCOMTIME/ATL::COleDateTime::GetCurrentTime", "ATLCOMTIME/ATL::COleDateTime::GetDay", "ATLCOMTIME/ATL::COleDateTime::GetDayOfWeek", "ATLCOMTIME/ATL::COleDateTime::GetDayOfYear", "ATLCOMTIME/ATL::COleDateTime::GetHour", "ATLCOMTIME/ATL::COleDateTime::GetMinute", "ATLCOMTIME/ATL::COleDateTime::GetMonth", "ATLCOMTIME/ATL::COleDateTime::GetSecond", "ATLCOMTIME/ATL::COleDateTime::GetStatus", "ATLCOMTIME/ATL::COleDateTime::GetYear", "ATLCOMTIME/ATL::COleDateTime::ParseDateTime", "ATLCOMTIME/ATL::COleDateTime::SetDate", "ATLCOMTIME/ATL::COleDateTime::SetDateTime", "ATLCOMTIME/ATL::COleDateTime::SetStatus", "ATLCOMTIME/ATL::COleDateTime::SetTime", "ATLCOMTIME/ATL::COleDateTime::m_dt", "ATLCOMTIME/ATL::COleDateTime::m_status"]
helpviewer_keywords: ["shared classes, COleDateTime", "time-only values", "Date data type, MFC encapsulation of", "COleDateTime class", "dates, handling in MFC", "time, handling in MFC"]
-ms.assetid: e718f294-16ec-4649-88b6-a4dbae5178fb
---
# COleDateTime Class
@@ -12,7 +11,7 @@ Encapsulates the `DATE` data type that is used in OLE automation.
## Syntax
-```
+```cpp
class COleDateTime
```
@@ -109,7 +108,7 @@ For more information about the `COleDateTime` and `COleDateTimeSpan` classes, se
Comparison operators.
-```
+```cpp
bool operator==(const COleDateTime& date) const throw();
bool operator!=(const COleDateTime& date) const throw();
bool operator<(const COleDateTime& date) const throw();
@@ -140,7 +139,7 @@ The operators **>=**, **\<=**, **>**, and **<**, will assert if the `COleDateTim
Constructs a `COleDateTime` object.
-```
+```cpp
COleDateTime() throw();
COleDateTime(const VARIANT& varSrc) throw();
COleDateTime(DATE dtSrc) throw();
@@ -211,7 +210,7 @@ Following is a brief description of each constructor:
- `COleDateTime(` `dateSrc` **)** Constructs a `COleDateTime` object from an existing `COleDateTime` object.
-- `COleDateTime(` *varSrc* **)** Constructs a `COleDateTime` object. Attempts to convert a `VARIANT` structure or [COleVariant](../../mfc/reference/colevariant-class.md) object to a date/time ( `VT_DATE`) value. If this conversion is successful, the converted value is copied into the new `COleDateTime` object. If it is not, the value of the `COleDateTime` object is set to 0 (midnight, 30 December 1899) and its status to invalid.
+- `COleDateTime(` *varSrc* **)** Constructs a `COleDateTime` object. Attempts to convert a `VARIANT` structure or [COleVariant](../../mfc/reference/colevariant-class.md) object to a date/time (`VT_DATE`) value. If this conversion is successful, the converted value is copied into the new `COleDateTime` object. If it is not, the value of the `COleDateTime` object is set to 0 (midnight, 30 December 1899) and its status to invalid.
- `COleDateTime(` `dtSrc` **)** Constructs a `COleDateTime` object from a `DATE` value.
@@ -242,7 +241,7 @@ For more information about the bounds for `COleDateTime` values, see the article
Creates a formatted representation of the date/time value.
-```
+```cpp
CString Format(DWORD dwFlags = 0, LCID lcid = LANG_USER_DEFAULT) const;
CString Format(LPCTSTR lpszFormat) const;
CString Format(UINT nFormatID) const;
@@ -263,7 +262,7 @@ Indicates one of the following locale flags:
Indicates locale ID to use for the conversion. For more information about language identifiers, see [Language Identifiers](/windows/win32/Intl/language-identifiers).
*lpszFormat*
-A formatting string similar to the `printf` formatting string. Each formatting code, preceded by a percent ( `%`) sign, is replaced by the corresponding `COleDateTime` component. Other characters in the formatting string are copied unchanged to the returned string. For more information, see the run-time function [strftime](../../c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l.md). The value and meaning of the formatting codes for `Format` are:
+A formatting string similar to the `printf` formatting string. Each formatting code, preceded by a percent (`%`) sign, is replaced by the corresponding `COleDateTime` component. Other characters in the formatting string are copied unchanged to the returned string. For more information, see the run-time function [strftime](../../c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l.md). The value and meaning of the formatting codes for `Format` are:
- `%H` Hours in the current day
@@ -303,7 +302,7 @@ This form formats the value by using the format string which contains special fo
Call this method to obtain the time in the `COleDateTime` object as a `DBTIMESTAMP` data structure.
-```
+```cpp
bool GetAsDBTIMESTAMP(DBTIMESTAMP& timeStamp) const throw();
```
@@ -328,7 +327,7 @@ Stores the resulting time in the referenced *timeStamp* structure. The `DBTIMEST
Call this method to obtain the time in the `COleDateTime` object as a `SYSTEMTIME` data structure.
-```
+```cpp
bool GetAsSystemTime(SYSTEMTIME& sysTime) const throw();
```
@@ -351,7 +350,7 @@ For more information on the status information held in a `COleDateTime` object,
Call this method to obtain the time in the `COleDateTime` object as a `UDATE` data structure.
-```
+```cpp
bool GetAsUDATE(UDATE& uDate) const throw();
```
@@ -372,7 +371,7 @@ A `UDATE` structure represents an "unpacked" date.
Call this static member function to return the current date/time value.
-```
+```cpp
static COleDateTime WINAPI GetCurrentTime() throw();
```
@@ -384,7 +383,7 @@ static COleDateTime WINAPI GetCurrentTime() throw();
Gets the day of the month represented by this date/time value.
-```
+```cpp
int GetDay() const throw();
```
@@ -420,7 +419,7 @@ For information on other member functions that query the value of this `COleDate
Gets the day of the week represented by this date/time value.
-```
+```cpp
int GetDayOfWeek() const throw();
```
@@ -456,7 +455,7 @@ For information on other member functions that query the value of this `COleDate
Gets the day of the year represented by this date/time value.
-```
+```cpp
int GetDayOfYear() const throw();
```
@@ -492,7 +491,7 @@ For information on other member functions that query the value of this `COleDate
Gets the hour represented by this date/time value.
-```
+```cpp
int GetHour() const throw();
```
@@ -528,7 +527,7 @@ For information on other member functions that query the value of this `COleDate
Gets the minute represented by this date/time value.
-```
+```cpp
int GetMinute() const throw();
```
@@ -564,7 +563,7 @@ See the example for [GetHour](#gethour).
Gets the month represented by this date/time value.
-```
+```cpp
int GetMonth() const throw();
```
@@ -600,7 +599,7 @@ See the example for [GetDay](#getday).
Gets the second represented by this date/time value.
-```
+```cpp
int GetSecond() const throw();
```
@@ -641,7 +640,7 @@ See the example for [GetHour](#gethour).
Gets the status (validity) of a given `COleDateTime` object.
-```
+```cpp
DateTimeStatus GetStatus() const throw();
```
@@ -653,7 +652,7 @@ Returns the status of this `COleDateTime` value. If you call `GetStatus` on a `C
The return value is defined by the `DateTimeStatus` enumerated type, which is defined within the `COleDateTime` class.
-```
+```cpp
enum DateTimeStatus
{
error = -1,
@@ -707,7 +706,7 @@ For more information about the bounds for `COleDateTime` values, see the article
Gets the year represented by this date/time value.
-```
+```cpp
int GetYear() const throw();
```
@@ -745,7 +744,7 @@ See the example for [GetDay](#getday).
The underlying `DATE` structure for this `COleDateTime` object.
-```
+```cpp
DATE m_dt;
```
@@ -760,7 +759,7 @@ For more information about the implementation of the `DATE` object, see the arti
Contains the status of this `COleDateTime` object.
-```
+```cpp
DateTimeStatus m_status;
```
@@ -775,7 +774,7 @@ The type of this data member is the enumerated type `DateTimeStatus`, which is d
Copies a `COleDateTime` value.
-```
+```cpp
COleDateTime& operator=(const VARIANT& varSrc) throw();
COleDateTime& operator=(DATE dtSrc) throw();
COleDateTime& operator=(const time_t& timeSrc) throw();
@@ -815,7 +814,7 @@ For more information about the bounds for `COleDateTime` values, see the article
Add and subtract `ColeDateTime` values.
-```
+```cpp
COleDateTime operator+(COleDateTimeSpan dateSpan) const throw();
COleDateTime operator-(COleDateTimeSpan dateSpan) const throw();
COleDateTimeSpan operator-(const COleDateTime& date) const throw();
@@ -845,7 +844,7 @@ For more information about the bounds for `COleDateTime` values, see the article
Add and subtract a `ColeDateTime` value from this `COleDateTime` object.
-```
+```cpp
COleDateTime& operator+=(COleDateTimeSpan dateSpan) throw();
COleDateTime& operator-=(COleDateTimeSpan dateSpan) throw();
```
@@ -868,7 +867,7 @@ For more information about the bounds for `COleDateTime` values, see the article
Converts a `ColeDateTime` value into a `DATE`.
-```
+```cpp
operator DATE() const throw();
```
@@ -882,7 +881,7 @@ The `DATE` operator will assert if the `COleDateTime` object is set to null. See
Parses a string to read a date/time value.
-```
+```cpp
bool ParseDateTime(
LPCTSTR lpszDate,
DWORD dwFlags = 0,
@@ -943,7 +942,7 @@ For more information about the bounds and implementation for `COleDateTime` valu
Sets the date of this `COleDateTime` object.
-```
+```cpp
int SetDate(
int nYear,
int nMonth,
@@ -1020,7 +1019,7 @@ For more information about the bounds for `COleDateTime` values, see the article
Sets the date and time of this `COleDateTime` object.
-```
+```cpp
int SetDateTime(
int nYear,
int nMonth,
@@ -1128,7 +1127,7 @@ See the example for [GetStatus](#getstatus).
Sets the time of this `COleDateTime` object.
-```
+```cpp
int SetTime(
int nHour,
int nMin,
diff --git a/docs/atl-mfc-shared/reference/coledatetimespan-class.md b/docs/atl-mfc-shared/reference/coledatetimespan-class.md
index 41f2f693c9..491074bbae 100644
--- a/docs/atl-mfc-shared/reference/coledatetimespan-class.md
+++ b/docs/atl-mfc-shared/reference/coledatetimespan-class.md
@@ -12,7 +12,7 @@ Represents a relative time, a time span.
## Syntax
-```
+```cpp
class COleDateTimeSpan
```
@@ -76,7 +76,7 @@ For more information on the `COleDateTime` and `COleDateTimeSpan` classes, see t
Comparison operators.
-```
+```cpp
bool operator==(const COleDateTimeSpan& dateSpan) const throw();
bool operator!=(const COleDateTimeSpan& dateSpan) const throw();
bool operator<(const COleDateTimeSpan& dateSpan) const throw();
@@ -102,14 +102,14 @@ These operators compare two date/time-span values and return TRUE if the conditi
### Example
[!code-cpp[NVC_ATLMFC_Utilities#25](../../atl-mfc-shared/codesnippet/cpp/coledatetimespan-class_1.cpp)]
-
+
[!code-cpp[NVC_ATLMFC_Utilities#26](../../atl-mfc-shared/codesnippet/cpp/coledatetimespan-class_2.cpp)]
## COleDateTimeSpan::COleDateTimeSpan
Constructs a `COleDateTimeSpan` object.
-```
+```cpp
COleDateTimeSpan() throw();
COleDateTimeSpan(double dblSpanSrc) throw();
COleDateTimeSpan(LONG lDays, int nHours, int nMins, int nSecs) throw();
@@ -145,7 +145,7 @@ For more information about the bounds for `COleDateTimeSpan` values, see the art
Generates a formatted string representation of a `COleDateTimeSpan` object.
-```
+```cpp
CString Format(LPCTSTR pFormat) const;
CString Format(UINT nID) const;
```
@@ -194,7 +194,7 @@ This form formats the value using the format string that contains special format
Retrieves the day portion of this date/time-span value.
-```
+```cpp
LONG GetDays() const throw();
```
@@ -230,7 +230,7 @@ For other functions that query the value of a `COleDateTimeSpan` object, see the
Retrieves the hour portion of this date/time-span value.
-```
+```cpp
LONG GetHours() const throw();
```
@@ -266,7 +266,7 @@ For other functions that query the value of a `COleDateTimeSpan` object, see the
Retrieves the minute portion of this date/time-span value.
-```
+```cpp
LONG GetMinutes() const throw();
```
@@ -302,7 +302,7 @@ For other functions that query the value of a `COleDateTimeSpan` object, see the
Retrieves the second portion of this date/time-span value.
-```
+```cpp
LONG GetSeconds() const throw();
```
@@ -338,7 +338,7 @@ For other functions that query the value of a `COleDateTimeSpan` object, see the
Gets the status (validity) of this `COleDateTimeSpan` object.
-```
+```cpp
DateTimeSpanStatus GetStatus() const throw();
```
@@ -350,7 +350,7 @@ The status of this `COleDateTimeSpan` value.
The return value is defined by the `DateTimeSpanStatus` enumerated type, which is defined within the `COleDateTimeSpan` class.
-```
+```cpp
enum DateTimeSpanStatus{
valid = 0,
invalid = 1,
@@ -382,7 +382,7 @@ For more information about the bounds for `COleDateTimeSpan` values, see the art
Retrieves this date/time-span value expressed in days.
-```
+```cpp
double GetTotalDays() const throw();
```
@@ -418,7 +418,7 @@ For other functions that query the value of a `COleDateTimeSpan` object, see the
Retrieves this date/time-span value expressed in hours.
-```
+```cpp
double GetTotalHours() const throw();
```
@@ -454,7 +454,7 @@ See the example for [GetTotalDays](#gettotaldays).
Retrieves this date/time-span value expressed in minutes.
-```
+```cpp
double GetTotalMinutes() const throw();
```
@@ -490,7 +490,7 @@ See the example for [GetTotalDays](#gettotaldays).
Retrieves this date/time-span value expressed in seconds.
-```
+```cpp
double GetTotalSeconds() const throw();
```
@@ -526,7 +526,7 @@ See the example for [GetTotalDays](#gettotaldays).
The underlying **`double`** value for this `COleDateTime` object.
-```
+```cpp
double m_span;
```
@@ -541,13 +541,13 @@ This value expresses the date/time-span in days.
The type for this data member is the enumerated type `DateTimeSpanStatus`, which is defined within the `COleDateTimeSpan` class.
-```
+```cpp
DateTimeSpanStatus m_status;
```
### Remarks
-```
+```cpp
enum DateTimeSpanStatus{
valid = 0,
invalid = 1,
@@ -582,7 +582,7 @@ For more information about the bounds for `COleDateTimeSpan` values, see the art
Copies a `COleDateTimeSpan` value.
-```
+```cpp
COleDateTimeSpan& operator=(double dblSpanSrc) throw();
```
@@ -594,7 +594,7 @@ This overloaded assignment operator copies the source date/time-span value into
Add, subtract, and change sign for `COleDateTimeSpan` values.
-```
+```cpp
COleDateTimeSpan operator+(const COleDateTimeSpan& dateSpan) const throw();
COleDateTimeSpan operator-(const COleDateTimeSpan& dateSpan) const throw();
COleDateTimeSpan operator-() const throw();
@@ -618,7 +618,7 @@ For more information on the valid, invalid, and null status values, see the [m_s
Add and subtract a `COleDateTimeSpan` value from this `COleDateTimeSpan` value.
-```
+```cpp
COleDateTimeSpan& operator+=(const COleDateTimeSpan dateSpan) throw();
COleDateTimeSpan& operator-=(const COleDateTimeSpan dateSpan) throw();
```
@@ -639,7 +639,7 @@ For more information on the valid, invalid, and null status values, see the [m_s
Converts this `COleDateTimeSpan` value to a **`double`**.
-```
+```cpp
operator double() const throw();
```
@@ -701,7 +701,7 @@ The new status value for this `COleDateTimeSpan` object.
The *Status* parameter value is defined by the `DateTimeSpanStatus` enumerated type, which is defined within the `COleDateTimeSpan` class.
-```
+```cpp
enum DateTimeSpanStatus{
valid = 0,
invalid = 1,
diff --git a/docs/atl-mfc-shared/reference/cpoint-class.md b/docs/atl-mfc-shared/reference/cpoint-class.md
index 94f05597be..1636a18f6d 100644
--- a/docs/atl-mfc-shared/reference/cpoint-class.md
+++ b/docs/atl-mfc-shared/reference/cpoint-class.md
@@ -4,15 +4,14 @@ title: "CPoint Class"
ms.date: "11/04/2016"
f1_keywords: ["CPoint", "ATLTYPES/ATL::CPoint", "ATLTYPES/ATL::CPoint::CPoint", "ATLTYPES/ATL::CPoint::Offset"]
helpviewer_keywords: ["LPPOINT structure", "POINT structure", "CPoint class"]
-ms.assetid: a6d4db93-35cc-444d-9221-c3e160f6edaa
---
-# CPoint Class
+# `CPoint` Class
Similar to the Windows `POINT` structure.
## Syntax
-```
+```cpp
class CPoint : public tagPOINT
```
@@ -22,30 +21,30 @@ class CPoint : public tagPOINT
|Name|Description|
|----------|-----------------|
-|[CPoint::CPoint](#cpoint)|Constructs a `CPoint`.|
+|[`CPoint::CPoint`](#cpoint)|Constructs a `CPoint`.|
### Public Methods
|Name|Description|
|----------|-----------------|
-|[CPoint::Offset](#offset)|Adds values to the `x` and `y` members of the `CPoint`.|
+|[`CPoint::Offset`](#offset)|Adds values to the `x` and `y` members of the `CPoint`.|
### Public Operators
|Name|Description|
|----------|-----------------|
-|[CPoint::operator -](#operator_-)|Returns the difference of a `CPoint` and a size, or the negation of a point, or the size difference between two points, or the offset by a negative size.|
-|[CPoint::operator !=](#operator_neq)|Checks for inequality between two points.|
-|[CPoint::operator +](#operator_add)|Returns the sum of a `CPoint` and a size or point, or a `CRect` offset by a size.|
-|[CPoint::operator +=](#operator_add_eq)|Offsets `CPoint` by adding a size or point.|
-|[CPoint::operator -=](#operator_-_eq)|Offsets `CPoint` by subtracting a size or point.|
-|[CPoint::operator ==](#operator_eq_eq)|Checks for equality between two points.|
+|[`CPoint::operator -`](#operator_-)|Returns the difference of a `CPoint` and a `SIZE`, or the negation of a `POINT`, or the `CSize` difference between two `POINT`s, or the offset by a negative `SIZE`.|
+|[`CPoint::operator !=`](#operator_neq)|Checks for inequality between two `POINT`s.|
+|[`CPoint::operator +`](#operator_add)|Returns the sum of a `CPoint` and a `SIZE` or `POINT`, or a `CRect` offset by a `SIZE`.|
+|[`CPoint::operator +=`](#operator_add_eq)|Offsets `CPoint` by adding a `SIZE` or `POINT`.|
+|[`CPoint::operator -=`](#operator_-_eq)|Offsets `CPoint` by subtracting a `SIZE` or `POINT`.|
+|[`CPoint::operator ==`](#operator_eq_eq)|Checks for equality between two `POINT`s.|
## Remarks
-It also includes member functions to manipulate `CPoint` and [POINT](/windows/win32/api/windef/ns-windef-point) structures.
+It also includes member functions to manipulate `CPoint` and [`POINT`](/windows/win32/api/windef/ns-windef-point) structures.
-A `CPoint` object can be used wherever a `POINT` structure is used. The operators of this class that interact with a "size" accept either [CSize](../../atl-mfc-shared/reference/csize-class.md) objects or [SIZE](/windows/win32/api/windef/ns-windef-size) structures, since the two are interchangeable.
+A `CPoint` object can be used wherever a `POINT` structure is used. The operators of this class that interact with a `SIZE` accept either [`CSize`](../../atl-mfc-shared/reference/csize-class.md) objects or [`SIZE`](/windows/win32/api/windef/ns-windef-size) structures, since the two are interchangeable.
> [!NOTE]
> This class is derived from the `tagPOINT` structure. (The name `tagPOINT` is a less commonly used name for the `POINT` structure.) This means that the data members of the `POINT` structure, `x` and `y`, are accessible data members of `CPoint`.
@@ -61,13 +60,13 @@ A `CPoint` object can be used wherever a `POINT` structure is used. The operator
## Requirements
-**Header:** atltypes.h
+**Header:** `atltypes.h`
-## CPoint::CPoint
+## `CPoint::CPoint`
Constructs a `CPoint` object.
-```
+```cpp
CPoint() throw();
CPoint(int initX, int initY) throw();
CPoint(POINT initPt) throw();
@@ -77,20 +76,20 @@ CPoint(LPARAM dwPoint) throw();
### Parameters
-*initX*
+*`initX`*\
Specifies the value of the `x` member of `CPoint`.
-*initY*
+*`initY`*\
Specifies the value of the `y` member of `CPoint`.
-*initPt*
-[POINT](/windows/win32/api/windef/ns-windef-point) structure or `CPoint` that specifies the values used to initialize `CPoint`.
+*`initPt`*\
+[`POINT`](/windows/win32/api/windef/ns-windef-point) structure or `CPoint` that specifies the values used to initialize `CPoint`.
-*initSize*
-[SIZE](/windows/win32/api/windef/ns-windef-size) structure or [CSize](../../atl-mfc-shared/reference/csize-class.md) that specifies the values used to initialize `CPoint`.
+*`initSize`*\
+[`SIZE`](/windows/win32/api/windef/ns-windef-size) structure or [`CSize`](../../atl-mfc-shared/reference/csize-class.md) that specifies the values used to initialize `CPoint`.
-*dwPoint*
-Sets the `x` member to the low-order word of *dwPoint* and the `y` member to the high-order word of *dwPoint*.
+*`dwPoint`*\
+Sets the `x` member to the low-order word of *`dwPoint`* and the `y` member to the high-order word of *`dwPoint`*.
### Remarks
@@ -123,7 +122,7 @@ CPoint ptFromDouble(dwSize);
ASSERT(ptFromDouble == ptMFCHere);
```
-## CPoint::Offset
+## `CPoint::Offset`
Adds values to the `x` and `y` members of the `CPoint`.
@@ -135,46 +134,46 @@ void Offset(SIZE size) throw();
### Parameters
-*xOffset*
+*`xOffset`*\
Specifies the amount to offset the `x` member of the `CPoint`.
-*yOffset*
+*`yOffset`*\
Specifies the amount to offset the `y` member of the `CPoint`.
-*point*
-Specifies the amount ( [POINT](/windows/win32/api/windef/ns-windef-point) or `CPoint`) to offset the `CPoint`.
+*`point`*\
+Specifies the amount ([`POINT`](/windows/win32/api/windef/ns-windef-point) or `CPoint`) to offset the `CPoint`.
-*size*
-Specifies the amount ( [SIZE](/windows/win32/api/windef/ns-windef-size) or [CSize](../../atl-mfc-shared/reference/csize-class.md)) to offset the `CPoint`.
+*`size`*\
+Specifies the amount ([`SIZE`](/windows/win32/api/windef/ns-windef-size) or [`CSize`](../../atl-mfc-shared/reference/csize-class.md)) to offset the `CPoint`.
### Example
[!code-cpp[NVC_ATLMFC_Utilities#28](../../atl-mfc-shared/codesnippet/cpp/cpoint-class_1.cpp)]
-## CPoint::operator ==
+## `CPoint::operator ==`
-Checks for equality between two points.
+Checks for equality between two `POINT`s.
-```
+```cpp
BOOL operator==(POINT point) const throw();
```
### Parameters
-*point*
-Contains a [POINT](/windows/win32/api/windef/ns-windef-point) structure or `CPoint` object.
+*`point`*\
+Contains a [`POINT`](/windows/win32/api/windef/ns-windef-point) structure or `CPoint` object.
### Return Value
-Nonzero if the points are equal; otherwise 0.
+Nonzero if the `POINT`s are equal; otherwise 0.
### Example
[!code-cpp[NVC_ATLMFC_Utilities#29](../../atl-mfc-shared/codesnippet/cpp/cpoint-class_2.cpp)]
-## CPoint::operator !=
+## `CPoint::operator !=`
-Checks for inequality between two points.
+Checks for inequality between two `POINT`s.
```
BOOL operator!=(POINT point) const throw();
@@ -182,20 +181,20 @@ BOOL operator!=(POINT point) const throw();
### Parameters
-*point*
-Contains a [POINT](/windows/win32/api/windef/ns-windef-point) structure or `CPoint` object.
+*`point`*\
+Contains a [`POINT`](/windows/win32/api/windef/ns-windef-point) structure or `CPoint` object.
### Return Value
-Nonzero if the points are not equal; otherwise 0.
+Nonzero if the `POINT`s aren't equal; otherwise 0.
### Example
[!code-cpp[NVC_ATLMFC_Utilities#30](../../atl-mfc-shared/codesnippet/cpp/cpoint-class_3.cpp)]
-## CPoint::operator +=
+## `CPoint::operator +=`
-The first overload adds a size to the `CPoint`.
+The first overload adds a `SIZE` to the `CPoint`.
```cpp
void operator+=(SIZE size) throw();
@@ -204,27 +203,27 @@ void operator+=(POINT point) throw();
### Parameters
-*size*
-Contains a [SIZE](/windows/win32/api/windef/ns-windef-size) structure or [CSize](../../atl-mfc-shared/reference/csize-class.md) object.
+*`size`*\
+Contains a [`SIZE`](/windows/win32/api/windef/ns-windef-size) structure or [`CSize`](../../atl-mfc-shared/reference/csize-class.md) object.
-*point*
-Contains a [POINT](/windows/win32/api/windef/ns-windef-point) structure or [CPoint](../../atl-mfc-shared/reference/cpoint-class.md) object.
+*`point`*\
+Contains a [`POINT`](/windows/win32/api/windef/ns-windef-point) structure or [`CPoint`](../../atl-mfc-shared/reference/cpoint-class.md) object.
### Remarks
-The second overload adds a point to the `CPoint`.
+The second overload adds a `POINT` to the `CPoint`.
In both cases, addition is done by adding the `x` (or `cx`) member of the right-hand operand to the `x` member of the `CPoint` and adding the `y` (or `cy`) member of the right-hand operand to the `y` member of the `CPoint`.
-For example, adding `CPoint(5, -7)` to a variable which contains `CPoint(30, 40)` changes the variable to `CPoint(35, 33)`.
+For example, adding `CPoint(5, -7)` to a variable that contains `CPoint(30, 40)` changes the variable to `CPoint(35, 33)`.
### Example
[!code-cpp[NVC_ATLMFC_Utilities#31](../../atl-mfc-shared/codesnippet/cpp/cpoint-class_4.cpp)]
-## CPoint::operator -=
+## `CPoint::operator -=`
-The first overload subtracts a size from the `CPoint`.
+The first overload subtracts a `SIZE` from the `CPoint`.
```cpp
void operator-=(SIZE size) throw();
@@ -233,29 +232,29 @@ void operator-=(POINT point) throw();
### Parameters
-*size*
-Contains a [SIZE](/windows/win32/api/windef/ns-windef-size) structure or [CSize](../../atl-mfc-shared/reference/csize-class.md) object.
+*`size`*\
+Contains a [`SIZE`](/windows/win32/api/windef/ns-windef-size) structure or [`CSize`](../../atl-mfc-shared/reference/csize-class.md) object.
-*point*
-Contains a [POINT](/windows/win32/api/windef/ns-windef-point) structure or [CPoint](../../atl-mfc-shared/reference/cpoint-class.md) object.
+*`point`*\
+Contains a [`POINT`](/windows/win32/api/windef/ns-windef-point) structure or [`CPoint`](../../atl-mfc-shared/reference/cpoint-class.md) object.
### Remarks
-The second overload subtracts a point from the `CPoint`.
+The second overload subtracts a `POINT` from the `CPoint`.
In both cases, subtraction is done by subtracting the `x` (or `cx`) member of the right-hand operand from the `x` member of the `CPoint` and subtracting the `y` (or `cy`) member of the right-hand operand from the `y` member of the `CPoint`.
-For example, subtracting `CPoint(5, -7)` from a variable which contains `CPoint(30, 40)` changes the variable to `CPoint(25, 47)`.
+For example, subtracting `CPoint(5, -7)` from a variable that contains `CPoint(30, 40)` changes the variable to `CPoint(25, 47)`.
### Example
[!code-cpp[NVC_ATLMFC_Utilities#32](../../atl-mfc-shared/codesnippet/cpp/cpoint-class_5.cpp)]
-## CPoint::operator +
+## `CPoint::operator +`
Use this operator to offset `CPoint` by a `CPoint` or `CSize` object, or to offset a `CRect` by a `CPoint`.
-```
+```cpp
CPoint operator+(SIZE size) const throw();
CPoint operator+(POINT point) const throw();
CRect operator+(const RECT* lpRect) const throw();
@@ -263,34 +262,34 @@ CRect operator+(const RECT* lpRect) const throw();
### Parameters
-*size*
-Contains a [SIZE](/windows/win32/api/windef/ns-windef-size) structure or [CSize](../../atl-mfc-shared/reference/csize-class.md) object.
+*`size`*\
+Contains a [`SIZE`](/windows/win32/api/windef/ns-windef-size) structure or [`CSize`](../../atl-mfc-shared/reference/csize-class.md) object.
-*point*
-Contains a [POINT](/windows/win32/api/windef/ns-windef-point) structure or [CPoint](../../atl-mfc-shared/reference/cpoint-class.md) object.
+*`point`*\
+Contains a [`POINT`](/windows/win32/api/windef/ns-windef-point) structure or [`CPoint`](../../atl-mfc-shared/reference/cpoint-class.md) object.
-*lpRect*
-Contains a pointer to a [RECT](/windows/win32/api/windef/ns-windef-rect) structure or [CRect](../../atl-mfc-shared/reference/crect-class.md) object.
+*`lpRect`*\
+Contains a pointer to a [`RECT`](/windows/win32/api/windef/ns-windef-rect) structure or [`CRect`](../../atl-mfc-shared/reference/crect-class.md) object.
### Return Value
-A `CPoint` that is offset by a size, a `CPoint` that is offset by a point, or a `CRect` offset by a point.
+A `CPoint` that is offset by a `SIZE`, a `CPoint` that is offset by a `POINT`, or a `CRect` offset by a `POINT`.
### Remarks
For example, using one of the first two overloads to offset the point `CPoint(25, -19)` by a point `CPoint(15, 5)` or size `CSize(15, 5)` returns the value `CPoint(40, -14)`.
-Adding a rectangle to a point returns the rectangle after being offset by the `x` and `y` values specified in the point. For example, using the last overload to offset a rectangle `CRect(125, 219, 325, 419)` by a point `CPoint(25, -19)` returns `CRect(150, 200, 350, 400)`.
+Adding a `CRect` to a `POINT` returns the `CRect` after being offset by the `x` and `y` values specified in the `POINT`. For example, using the last overload to offset a rectangle `CRect(125, 219, 325, 419)` by a point `CPoint(25, -19)` returns `CRect(150, 200, 350, 400)`.
### Example
[!code-cpp[NVC_ATLMFC_Utilities#33](../../atl-mfc-shared/codesnippet/cpp/cpoint-class_6.cpp)]
-## CPoint::operator -
+## `CPoint::operator -`
Use one of the first two overloads to subtract a `CPoint` or `CSize` object from `CPoint`.
-```
+```cpp
CSize operator-(POINT point) const throw();
CPoint operator-(SIZE size) const throw();
CRect operator-(const RECT* lpRect) const throw();
@@ -299,18 +298,18 @@ CPoint operator-() const throw();
### Parameters
-*point*
-A [POINT](/windows/win32/api/windef/ns-windef-point) structure or [CPoint](../../atl-mfc-shared/reference/cpoint-class.md) object.
+*`point`*\
+A [`POINT`](/windows/win32/api/windef/ns-windef-point) structure or [`CPoint`](../../atl-mfc-shared/reference/cpoint-class.md) object.
-*size*
-A [SIZE](/windows/win32/api/windef/ns-windef-size) structure or [CSize](../../atl-mfc-shared/reference/csize-class.md) object.
+*`size`*\
+A [`SIZE`](/windows/win32/api/windef/ns-windef-size) structure or [`CSize`](../../atl-mfc-shared/reference/csize-class.md) object.
-*lpRect*
-A pointer to a [RECT](/windows/win32/api/windef/ns-windef-rect) structure or a [CRect](../../atl-mfc-shared/reference/crect-class.md) object.
+*`lpRect`*\
+A pointer to a [`RECT`](/windows/win32/api/windef/ns-windef-rect) structure or a [`CRect`](../../atl-mfc-shared/reference/crect-class.md) object.
### Return Value
-A `CSize` that is the difference between two points, a `CPoint` that is offset by the negation of a size, a `CRect` that is offset by the negation of a point, or a `CPoint` that is the negation of a point.
+A `CSize` that is the difference between two `POINT`s, a `CPoint` that is offset by the negation of a `SIZE`, a `CRect` that is offset by the negation of a `POINT`, or a `CPoint` that is the negation of a `POINT`.
### Remarks
@@ -320,9 +319,9 @@ For example, using the first overload to find the difference between two points
Subtracting a `CSize` from `CPoint` does the same calculation as above but returns a `CPoint` object, not a `CSize` object. For example, using the second overload to find the difference between the point `CPoint(25, -19)` and the size `CSize(15, 5)` returns `CPoint(10, -24)`.
-Subtracting a rectangle from a point returns the rectangle offset by the negatives of the `x` and `y` values specified in the point. For example, using the last overload to offset the rectangle `CRect(125, 200, 325, 400)` by the point `CPoint(25, -19)` returns `CRect(100, 219, 300, 419)`.
+Subtracting a rectangle from a `POINT` returns the rectangle offset by the negatives of the `x` and `y` values specified in the `POINT`. For example, using the last overload to offset the rectangle `CRect(125, 200, 325, 400)` by the point `CPoint(25, -19)` returns `CRect(100, 219, 300, 419)`.
-Use the unary operator to negate a point. For example, using the unary operator with the point `CPoint(25, -19)` returns `CPoint(-25, 19)`.
+Use the unary operator to negate a `POINT`. For example, using the unary operator with the point `CPoint(25, -19)` returns `CPoint(-25, 19)`.
### Example
@@ -330,8 +329,8 @@ Use the unary operator to negate a point. For example, using the unary operator
## See also
-[MFC Sample MDI](../../overview/visual-cpp-samples.md)
-[Hierarchy Chart](../../mfc/hierarchy-chart.md)
-[POINT Structure](/windows/win32/api/windef/ns-windef-point)
-[CRect Class](../../atl-mfc-shared/reference/crect-class.md)
-[CSize Class](../../atl-mfc-shared/reference/csize-class.md)
+[MFC Sample MDI](../../overview/visual-cpp-samples.md)\
+[Hierarchy Chart](../../mfc/hierarchy-chart.md)\
+[`POINT` Structure](/windows/win32/api/windef/ns-windef-point)\
+[`CRect` Class](../../atl-mfc-shared/reference/crect-class.md)\
+[`CSize` Class](../../atl-mfc-shared/reference/csize-class.md)
diff --git a/docs/atl-mfc-shared/reference/crect-class.md b/docs/atl-mfc-shared/reference/crect-class.md
index 6cadba4e4a..d05e09be56 100644
--- a/docs/atl-mfc-shared/reference/crect-class.md
+++ b/docs/atl-mfc-shared/reference/crect-class.md
@@ -12,7 +12,7 @@ Similar to a Windows [`RECT`](/windows/win32/api/windef/ns-windef-rect) structur
## Syntax
-```
+```cpp
class CRect : public tagRECT
```
@@ -428,7 +428,7 @@ ASSERT(rect1.EqualRect(&test));
Calculates the height of `CRect` by subtracting the top value from the bottom value.
-```
+```cpp
int Height() const throw();
```
@@ -510,7 +510,7 @@ ASSERT(rect == CRect(-50, -200, 350, 500));
Makes a `CRect` equal to the intersection of two existing rectangles.
-```
+```cpp
BOOL IntersectRect(LPCRECT lpRect1, LPCRECT lpRect2) throw();
```
@@ -553,7 +553,7 @@ ASSERT(rectInter2 == CRect(125, 75, 150, 95));
Determines whether `CRect` is empty.
-```
+```cpp
BOOL IsRectEmpty() const throw();
```
@@ -583,7 +583,7 @@ ASSERT(rectEmpty.IsRectEmpty());
Determines whether the top, left, bottom, and right values of `CRect` are all equal to 0.
-```
+```cpp
BOOL IsRectNull() const throw();
```
@@ -747,7 +747,7 @@ ASSERT(rect == CRect(230, 230, 265, 265));
## `CRect::operator LPCRECT` Converts a `CRect` to an [`LPCRECT`](../../mfc/reference/data-types-mfc.md).
-```
+```cpp
operator LPCRECT() const throw();
```
@@ -759,7 +759,7 @@ When you use this function, you don't need the address-of (**`&`**) operator. Th
Converts a `CRect` to an [`LPRECT`](../../mfc/reference/data-types-mfc.md).
-```
+```cpp
operator LPRECT() throw();
```
@@ -798,7 +798,7 @@ ASSERT(rect2 == CRect(0, 0, 127, 168));
Determines whether `rect` is equal to `CRect` by comparing the coordinates of their upper-left and lower-right corners.
-```
+```cpp
BOOL operator==(const RECT& rect) const throw();
```
@@ -838,7 +838,7 @@ ASSERT(rect1 == test);
Determines whether *`rect`* is not equal to `CRect` by comparing the coordinates of their upper-left and lower-right corners.
-```
+```cpp
BOOL operator!=(const RECT& rect) const throw();
```
@@ -1009,7 +1009,7 @@ ASSERT(rectResult == rect1);
The first two overloads return a `CRect` object that is equal to `CRect` displaced by the specified offsets.
-```
+```cpp
CRect operator+(POINT point) const throw();
CRect operator+(LPCRECT lpRect) const throw();
CRect operator+(SIZE size) const throw();
@@ -1052,7 +1052,7 @@ ASSERT(rectResult == rect2);
The first two overloads return a `CRect` object that is equal to `CRect` displaced by the specified offsets.
-```
+```cpp
CRect operator-(POINT point) const throw();
CRect operator-(SIZE size) const throw();
CRect operator-(LPCRECT lpRect) const throw();
@@ -1095,7 +1095,7 @@ ASSERT(rect2 == rectResult);
Returns a `CRect` that is the intersection of `CRect` and *rect2*.
-```
+```cpp
CRect operator&(const RECT& rect2) const throw();
```
@@ -1131,7 +1131,7 @@ ASSERT(rectResult == rect3);
Returns a `CRect` that is the union of `CRect` and *`rect2`*.
-```
+```cpp
CRect operator|(const RECT&
rect2) const throw();
```
@@ -1168,7 +1168,7 @@ ASSERT(rectResult == rect3);
Determines whether the specified point lies within `CRect`.
-```
+```cpp
BOOL PtInRect(POINT point) const throw();
```
@@ -1295,7 +1295,7 @@ ASSERT(sz.cx == 40 && sz.cy == 40);
Makes the dimensions of the `CRect` equal to the subtraction of `lpRectSrc2` from `lpRectSrc1`.
-```
+```cpp
BOOL SubtractRect(LPCRECT lpRectSrc1, LPCRECT lpRectSrc2) throw();
```
@@ -1362,7 +1362,7 @@ ASSERT(rectResult == rectOut);
The coordinates are returned as a reference to a [`CPoint`](cpoint-class.md) object that is contained in `CRect`.
-```
+```cpp
CPoint& TopLeft() throw();
const CPoint& TopLeft() const throw();
```
@@ -1383,7 +1383,7 @@ See the example for [`CRect::CenterPoint`](#centerpoint).
Makes the dimensions of `CRect` equal to the union of the two source rectangles.
-```
+```cpp
BOOL UnionRect(LPCRECT lpRect1, LPCRECT lpRect2) throw();
```
@@ -1424,7 +1424,7 @@ ASSERT(rectResult == rect3);
Calculates the width of `CRect` by subtracting the left value from the right value.
-```
+```cpp
int Width() const throw();
```
diff --git a/docs/atl-mfc-shared/reference/csimplestringt-class.md b/docs/atl-mfc-shared/reference/csimplestringt-class.md
index 98a3d82946..b62a850efa 100644
--- a/docs/atl-mfc-shared/reference/csimplestringt-class.md
+++ b/docs/atl-mfc-shared/reference/csimplestringt-class.md
@@ -1,7 +1,7 @@
---
-description: "Learn more about: CSimpleStringT Class"
title: "CSimpleStringT Class"
-ms.date: 10/04/2021
+description: "Learn more about: CSimpleStringT class"
+ms.date: 01/26/2024
f1_keywords: ["CSimpleStringT", "ATLSIMPSTR/ATL::CSimpleStringT", "ATLSIMPSTR/ATL::CSimpleStringT::PCXSTR", "ATLSIMPSTR/ATL::CSimpleStringT::PXSTR", "ATLSIMPSTR/ATL::CSimpleStringT::CSimpleStringT", "ATLSIMPSTR/ATL::CSimpleStringT::Append", "ATLSIMPSTR/ATL::CSimpleStringT::AppendChar", "ATLSIMPSTR/ATL::CSimpleStringT::CopyChars", "ATLSIMPSTR/ATL::CSimpleStringT::CopyCharsOverlapped", "ATLSIMPSTR/ATL::CSimpleStringT::Empty", "ATLSIMPSTR/ATL::CSimpleStringT::FreeExtra", "ATLSIMPSTR/ATL::CSimpleStringT::GetAllocLength", "ATLSIMPSTR/ATL::CSimpleStringT::GetAt", "ATLSIMPSTR/ATL::CSimpleStringT::GetBuffer", "ATLSIMPSTR/ATL::CSimpleStringT::GetBufferSetLength", "ATLSIMPSTR/ATL::CSimpleStringT::GetLength", "ATLSIMPSTR/ATL::CSimpleStringT::GetManager", "ATLSIMPSTR/ATL::CSimpleStringT::GetString", "ATLSIMPSTR/ATL::CSimpleStringT::IsEmpty", "ATLSIMPSTR/ATL::CSimpleStringT::LockBuffer", "ATLSIMPSTR/ATL::CSimpleStringT::Preallocate", "ATLSIMPSTR/ATL::CSimpleStringT::ReleaseBuffer", "ATLSIMPSTR/ATL::CSimpleStringT::ReleaseBufferSetLength", "ATLSIMPSTR/ATL::CSimpleStringT::SetAt", "ATLSIMPSTR/ATL::CSimpleStringT::SetManager", "ATLSIMPSTR/ATL::CSimpleStringT::SetString", "ATLSIMPSTR/ATL::CSimpleStringT::StringLength", "ATLSIMPSTR/ATL::CSimpleStringT::Truncate", "ATLSIMPSTR/ATL::CSimpleStringT::UnlockBuffer"]
helpviewer_keywords: ["shared classes, CSimpleStringT", "strings [C++], ATL class", "CSimpleStringT class"]
---
@@ -18,7 +18,7 @@ class CSimpleStringT
### Parameters
-*`BaseType`*
+*`BaseType`*\
The character type of the string class. Can be one of the following:
- **`char`** (for ANSI character strings).
@@ -445,7 +445,7 @@ An `PXSTR` pointer to the object's (null-terminated) character buffer.
Call this method to return the buffer contents of the `CSimpleStringT` object. The returned `PXSTR` is not a constant and therefore allows direct modification of `CSimpleStringT` contents.
-If you use the pointer returned by `GetBuffer` to change the string contents, you must call [`ReleaseBuffer`](#releasebuffer) before you use any other `CSimpleStringT` member methods.
+If you use the pointer returned by `GetBuffer` to change the string contents, you must call [`ReleaseBuffer`](#releasebuffer) to update the internal state of `CSimpleStringT` before you use any other `CSimpleStringT` methods.
The address returned by `GetBuffer` may not be valid after the call to `ReleaseBuffer` because additional `CSimpleStringT` operations can cause the `CSimpleStringT` buffer to be reallocated. The buffer is not reallocated if you do not change the length of the `CSimpleStringT`.
@@ -491,7 +491,7 @@ A `PXSTR` pointer to the object's (null-terminated) character buffer.
Call this method to retrieve a specified length of the internal buffer of the `CSimpleStringT` object. The returned `PXSTR` pointer is not **`const`** and thus allows direct modification of `CSimpleStringT` contents.
-If you use the pointer returned by [`GetBufferSetLength`](#getbuffersetlength) to change the string contents, call `ReleaseBuffer` to update the internal state of `CsimpleStringT` before you use any other `CSimpleStringT` methods.
+If you use the pointer returned by [`GetBufferSetLength`](#getbuffersetlength) to change the string contents, call `ReleaseBuffer` to update the internal state of `CSimpleStringT` before you use any other `CSimpleStringT` methods.
The address returned by `GetBufferSetLength` may not be valid after the call to `ReleaseBuffer` because additional `CSimpleStringT` operations can cause the `CSimpleStringT` buffer to be reallocated. The buffer is not reassigned if you do not change the length of the `CSimpleStringT`.
@@ -502,9 +502,7 @@ If you keep track of the string length yourself, do not append the terminating n
For more information about reference counting, see the following articles:
- [Managing Object Lifetimes through Reference Counting](/windows/win32/com/managing-object-lifetimes-through-reference-counting) in the Windows SDK.
-
- [Implementing Reference Counting](/windows/win32/com/implementing-reference-counting) in the Windows SDK.
-
- [Rules for Managing Reference Counts](/windows/win32/com/rules-for-managing-reference-counts) in the Windows SDK.
### Example
@@ -517,9 +515,7 @@ LPTSTR pstr = str.GetBufferSetLength(3);
pstr[0] = _T('C');
pstr[1] = _T('u');
pstr[2] = _T('p');
-
-// No need for trailing zero or call to ReleaseBuffer()
-// because GetBufferSetLength() set it for us.
+str.ReleaseBuffer();
str += _T(" soccer is best!");
ASSERT(_tcscmp(str, _T("Cup soccer is best!")) == 0);
@@ -720,28 +716,6 @@ CSimpleString s(_T("abc"), pMgr);
ASSERT(s[1] == _T('b'));
```
-## `CSimpleStringT::operator []`
-
-Call this function to access a single character of the character array.
-
-### Syntax
-
-```cpp
-XCHAR operator[](int iChar) const;
-```
-
-### Parameters
-
-*`iChar`*
-Zero-based index of a character in the string.
-
-### Remarks
-
-The overloaded subscript (**`[]`**) operator returns a single character specified by the zero-based index in *`iChar`*. This operator is a convenient substitute for the [`GetAt`](#getat) member function.
-
-> [!NOTE]
-> You can use the subscript (**`[]`**) operator to get the value of a character in a `CSimpleStringT`, but you cannot use it to change the value of a character in a `CSimpleStringT`.
-
## `CSimpleStringT::operator +=`
Joins a new string or character to the end of an existing string.
@@ -1166,19 +1140,19 @@ The following example demonstrates the use of `CSimpleStringT::Truncate`.
CAtlString basestr;
IAtlStringMgr* pMgr = basestr.GetManager();
CSimpleString str(_T("abcdefghi"), pMgr);
-_tprintf_s(_T("Allocated length: %d\n"), str.GetLength());
-_tprintf_s(_T("Contents: %s\n"), str);
+_tprintf_s(_T("String length: %d / Allocated length: %d\n"), str.GetLength(), str.GetAllocLength());
+_tprintf_s(_T("Contents: %s\n"), (LPCTSTR)str);
str.Truncate(4);
-_tprintf_s(_T("Allocated length: %d\n"), str.GetLength());
-_tprintf_s(_T("Contents: %s\n"), str);
+_tprintf_s(_T("String length: %d / Allocated length: %d\n"), str.GetLength(), str.GetAllocLength());
+_tprintf_s(_T("Contents: %s\n"), (LPCTSTR)str);
```
The output from this example is:
```Output
-Allocated length: 9
+String length: 9 / Allocated length: 15
Contents: abcdefghi
-Allocated length: 4
+String length: 4 / Allocated length: 15
Contents: abcd
```
@@ -1214,5 +1188,5 @@ Call this method to destroy the `CSimpleStringT` object.
## See also
-[Hierarchy Chart](../../mfc/hierarchy-chart.md)
+[Hierarchy Chart](../../mfc/hierarchy-chart.md)\
[ATL/MFC Shared Classes](../../atl-mfc-shared/atl-mfc-shared-classes.md)
diff --git a/docs/atl-mfc-shared/reference/csize-class.md b/docs/atl-mfc-shared/reference/csize-class.md
index e807aab432..f398b5055d 100644
--- a/docs/atl-mfc-shared/reference/csize-class.md
+++ b/docs/atl-mfc-shared/reference/csize-class.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: CSize Class"
title: "CSize Class"
-ms.date: "10/18/2018"
+description: "Learn more about: CSize Class"
+ms.date: 10/18/2018
f1_keywords: ["CSize", "ATLTYPES/ATL::CSize", "ATLTYPES/ATL::CSize::CSize"]
helpviewer_keywords: ["SIZE", "dimensions, MFC", "dimensions", "CSize class"]
-ms.assetid: fb2cf85a-0bc1-46f8-892b-309c108b52ae
---
# CSize Class
@@ -12,7 +11,7 @@ Similar to the Windows [SIZE](/windows/win32/api/windef/ns-windef-size) structur
## Syntax
-```
+```cpp
class CSize : public tagSIZE
```
@@ -58,7 +57,7 @@ The `cx` and `cy` members of `SIZE` (and `CSize`) are public. In addition, `CSiz
Constructs a `CSize` object.
-```
+```cpp
CSize() throw();
CSize( int initCX, int initCY) throw();
CSize( SIZE initSize) throw();
@@ -95,13 +94,13 @@ If no arguments are given, `cx` and `cy` are initialized to zero.
Checks for equality between two sizes.
-```
+```cpp
BOOL operator==(SIZE size) const throw();
```
### Remarks
-Returns nonzero if the sizes are equal, otherwize 0.
+Returns nonzero if the sizes are equal, otherwise 0.
### Example
@@ -111,7 +110,7 @@ Returns nonzero if the sizes are equal, otherwize 0.
Checks for inequality between two sizes.
-```
+```cpp
BOOL operator!=(SIZE size) const throw();
```
@@ -151,7 +150,7 @@ void operator-=(SIZE size) throw();
These operators add this `CSize` value to the value of parameter.
-```
+```cpp
CSize operator+(SIZE size) const throw();
CPoint operator+(POINT point) const throw();
CRect operator+(const RECT* lpRect) const throw();
@@ -181,7 +180,7 @@ See the following descriptions of the individual operators:
The first three of these operators subtract this `CSize` value to the value of parameter.
-```
+```cpp
CSize operator-(SIZE size) const throw();
CPoint operator-(POINT point) const throw();
CRect operator-(const RECT* lpRect) const throw();
diff --git a/docs/atl-mfc-shared/reference/cstrbuft-class.md b/docs/atl-mfc-shared/reference/cstrbuft-class.md
index 4f6f092b91..4cc53bfee5 100644
--- a/docs/atl-mfc-shared/reference/cstrbuft-class.md
+++ b/docs/atl-mfc-shared/reference/cstrbuft-class.md
@@ -12,7 +12,7 @@ This class provides automatic resource cleanup for `GetBuffer` and `ReleaseBuffe
## Syntax
-```
+```cpp
template
class CStrBufT
```
@@ -26,7 +26,7 @@ The character type of the `CStrBufT` class. Can be one of the following:
- **`wchar_t`** (for Unicode character strings)
-- TCHAR (for both ANSI and Unicode character strings)
+- **`TCHAR`** (for both ANSI and Unicode character strings)
## Members
@@ -34,8 +34,8 @@ The character type of the `CStrBufT` class. Can be one of the following:
|Name|Description|
|----------|-----------------|
-|PCXSTR|A pointer to a constant string.|
-|PXSTR|A pointer to a string.|
+|`PCXSTR`|A pointer to a constant string.|
+|`PXSTR`|A pointer to a string.|
|`StringType`|The string type whose buffer is to be manipulated by specializations of this class template.|
### Public Constructors
@@ -78,7 +78,7 @@ Primarily designed as a helper class, `CStrBufT` provides a convenient way for a
Automatically determine the new length of the string at release.
-```
+```cpp
static const DWORD AUTO_LENGTH = 0x01;
```
@@ -90,7 +90,7 @@ Automatically determine the new length of the string at release. The string must
Constructs a buffer object.
-```
+```cpp
CStrBufT(StringType& str, int nMinLength, DWORD dwFlags = AUTO_LENGTH) throw(...);
explicit CStrBufT(StringType& str) throw(...);
```
@@ -120,7 +120,7 @@ Note that the copy constructor is **`private`**.
Directly accesses characters stored in the associated string object as a C-style string.
-```
+```cpp
operator PCXSTR() const throw();
```
@@ -136,7 +136,7 @@ Call this function to return a pointer to the character buffer of a string objec
Directly accesses characters stored in the associated string object as a C-style string.
-```
+```cpp
operator PXSTR() throw();
```
@@ -152,7 +152,7 @@ Call this function to return a pointer to the character buffer of a string objec
A pointer to a constant string.
-```
+```cpp
typedef CSimpleStringT::PCXSTR PCXSTR;
```
@@ -160,7 +160,7 @@ typedef CSimpleStringT::PCXSTR PCXSTR;
A pointer to a string.
-```
+```cpp
typedef CSimpleStringT::PXSTR PXSTR;
```
@@ -168,7 +168,7 @@ typedef CSimpleStringT::PXSTR PXSTR;
Set the length of the string object at `GetBuffer` time.
-```
+```cpp
static const DWORD SET_LENGTH = 0x02;
```
@@ -202,7 +202,7 @@ Call this function to set the length of the string represented by the buffer obj
The string type whose buffer is to be manipulated by specializations of this class template.
-```
+```cpp
typedef CSimpleStringT StringType;
```
diff --git a/docs/atl-mfc-shared/reference/cstringdata-class.md b/docs/atl-mfc-shared/reference/cstringdata-class.md
index 03da39cca6..2755f5e8ab 100644
--- a/docs/atl-mfc-shared/reference/cstringdata-class.md
+++ b/docs/atl-mfc-shared/reference/cstringdata-class.md
@@ -12,7 +12,7 @@ This class represents the data of a string object.
## Syntax
-```
+```cpp
struct CStringData
```
@@ -105,7 +105,7 @@ Call this function to return the current character buffer of the associated stri
Determines if the character buffer is locked.
-```
+```cpp
bool IsLocked() const throw();
```
@@ -121,7 +121,7 @@ Call this function to determine if the character buffer of a string object is cu
Determines if the character buffer is shared.
-```
+```cpp
bool IsShared() const throw();
```
@@ -152,7 +152,7 @@ Call this function to lock the character buffer of the string data object. Locki
Length of the allocated character buffer.
-```
+```cpp
int nAllocLength;
```
@@ -164,7 +164,7 @@ Stores the length of the allocated data buffer in `XCHAR`s (not including termin
Current length of the string object.
-```
+```cpp
int nDataLength;
```
@@ -176,7 +176,7 @@ Stores the length of currently used data in `XCHAR`s (not including terminating
Reference count of the string data object.
-```
+```cpp
long nRefs;
```
@@ -188,7 +188,7 @@ Stores the reference count of the string data object. This count indicates the n
The memory manager of the associated string object.
-```
+```cpp
IAtlStringMgr* pStringMgr;
```
diff --git a/docs/atl-mfc-shared/reference/cstringt-class.md b/docs/atl-mfc-shared/reference/cstringt-class.md
index 6921e0fded..a47c9ad9a6 100644
--- a/docs/atl-mfc-shared/reference/cstringt-class.md
+++ b/docs/atl-mfc-shared/reference/cstringt-class.md
@@ -486,11 +486,11 @@ A handle for a **`CStringT`** object.
Because the constructors copy the input data into new allocated storage, memory exceptions may result. Some of these constructors act as conversion functions. This allows you to substitute, for example, an **`LPTSTR`** where a **`CStringT`** object is expected.
-- **`CStringT`**( `LPCSTR` `lpsz` ): Constructs a Unicode **`CStringT`** from an ANSI string. You can also use this constructor to load a string resource as shown in the example below.
+- **`CStringT`**(`LPCSTR` `lpsz`): Constructs a Unicode **`CStringT`** from an ANSI string. You can also use this constructor to load a string resource as shown in the example below.
-- `CStringT(` `LPCWSTR` `lpsz` ): Constructs a **`CStringT`** from a Unicode string.
+- **`CStringT`**(`LPCWSTR` `lpsz`): Constructs a **`CStringT`** from a Unicode string.
-- **`CStringT`**( `const unsigned char*` `psz` ): Allows you to construct a **`CStringT`** from a pointer to **`unsigned char`**.
+- **`CStringT`**(`const unsigned char*` `psz`): Allows you to construct a **`CStringT`** from a pointer to **`unsigned char`**.
> [!NOTE]
> Define the `_CSTRING_DISABLE_NARROW_WIDE_CONVERSION` macro to turn off implicit string conversion between ANSI and Unicode strings. The macro excludes from compilation constructors that support conversion.
@@ -725,7 +725,7 @@ Writes a formatted string and a variable list of arguments to a **`CStringT`** s
### Example
[!code-cpp[NVC_ATLMFC_Utilities#119](../../atl-mfc-shared/codesnippet/cpp/cstringt-class_14.cpp)]
-
+
[!code-cpp[NVC_ATLMFC_Utilities#120](../../atl-mfc-shared/codesnippet/cpp/cstringt-class_15.cpp)]
## `CStringT::GetEnvironmentVariable`
@@ -998,11 +998,11 @@ Concatenates two strings or a character and a string.
```cpp
friend CStringT operator+(const CStringT& str1, const CStringT& str2);
friend CStringT operator+(const CStringT& str1, PCXSTR psz2);
-friend CStringT operator+(PCXSTR psz1, const CStringT& str2,);
-friend CStringT operator+(char ch1, const CStringT& str2,);
+friend CStringT operator+(PCXSTR psz1, const CStringT& str2);
+friend CStringT operator+(char ch1, const CStringT& str2);
friend CStringT operator+(const CStringT& str1, char ch2);
friend CStringT operator+(const CStringT& str1, wchar_t ch2);
-friend CStringT operator+(wchar_t ch1, const CStringT& str2,);
+friend CStringT operator+(wchar_t ch1, const CStringT& str2);
```
### Parameters
@@ -1102,8 +1102,8 @@ friend bool operator==(const CStringT& str1, PCXSTR psz2) throw();
friend bool operator==(const CStringT& str1, PCYSTR psz2) throw();
friend bool operator==(const CStringT& str1, XCHAR ch2) throw();
friend bool operator==(PCXSTR psz1, const CStringT& str2) throw();
-friend bool operator==(PCYSTR psz1, const CStringT& str2,) throw();
-friend bool operator==(XCHAR ch1, const CStringT& str2,) throw();
+friend bool operator==(PCYSTR psz1, const CStringT& str2) throw();
+friend bool operator==(XCHAR ch1, const CStringT& str2) throw();
```
### Parameters
@@ -1144,8 +1144,8 @@ friend bool operator!=(const CStringT& str1, PCXSTR psz2) throw();
friend bool operator!=(const CStringT& str1, PCYSTR psz2) throw();
friend bool operator!=(const CStringT& str1, XCHAR ch2) throw();
friend bool operator!=(PCXSTR psz1, const CStringT& str2) throw();
-friend bool operator!=(PCYSTR psz1, const CStringT& str2,) throw();
-friend bool operator!=(XCHAR ch1, const CStringT& str2,) throw();
+friend bool operator!=(PCYSTR psz1, const CStringT& str2) throw();
+friend bool operator!=(XCHAR ch1, const CStringT& str2) throw();
```
### Parameters
diff --git a/docs/atl-mfc-shared/reference/ctime-class.md b/docs/atl-mfc-shared/reference/ctime-class.md
index 0fbc79bb4d..067db91b52 100644
--- a/docs/atl-mfc-shared/reference/ctime-class.md
+++ b/docs/atl-mfc-shared/reference/ctime-class.md
@@ -12,7 +12,7 @@ Represents an absolute time and date.
## Syntax
-```
+```cpp
class CTime
```
@@ -82,7 +82,7 @@ For more information about using `CTime`, see the articles [Date and Time](../..
Comparison operators.
-```
+```cpp
bool operator==(CTime time) const throw();
bool operator!=(CTime time) const throw();
bool operator<(CTime time) const throw();
@@ -108,7 +108,7 @@ These operators compare two absolute times and return TRUE if the condition is t
Creates a new `CTime` object initialized with the specified time.
-```
+```cpp
CTime() throw();
CTime(__time64_t time) throw();
CTime(int nYear, int nMonth, int nDay,
@@ -193,7 +193,7 @@ For more information, see the [SYSTEMTIME](/windows/win32/api/minwinbase/ns-minw
Call this member function to create a formatted representation of the date-time value.
-```
+```cpp
CString Format(LPCTSTR pszFormat) const;
CString Format(UINT nFormatID) const;
```
@@ -224,7 +224,7 @@ This method throws an exception if the date-time value to format does not range
Generates a formatted string that corresponds to this `CTime` object.
-```
+```cpp
CString FormatGmt(LPCTSTR pszFormat) const;
CString FormatGmt(UINT nFormatID) const;
```
@@ -255,7 +255,7 @@ See the example for [CTime::Format](#format).
Call this member function to convert the time information stored in the `CTime` object to a Win32-compatible DBTIMESTAMP structure.
-```
+```cpp
bool GetAsDBTIMESTAMP(DBTIMESTAMP& dbts) const throw();
```
@@ -280,7 +280,7 @@ Stores the resulting time in the referenced *dbts* structure. The `DBTIMESTAMP`
Call this member function to convert the time information stored in the `CTime` object to a Win32-compatible [SYSTEMTIME](/windows/win32/api/minwinbase/ns-minwinbase-systemtime) structure.
-```
+```cpp
bool GetAsSystemTime(SYSTEMTIME& st) const throw();
```
@@ -305,7 +305,7 @@ TRUE if successful; otherwise FALSE.
Returns a `CTime` object that represents the current time.
-```
+```cpp
static CTime WINAPI GetCurrentTime() throw();
```
@@ -321,7 +321,7 @@ Returns the current system date and time in Coordinated Universal Time (UTC).
Returns the day represent by the `CTime` object.
-```
+```cpp
int GetDay() const throw();
```
@@ -341,7 +341,7 @@ This function calls `GetLocalTm`, which uses an internal, statically allocated b
Returns the day of the week represented by the `CTime` object.
-```
+```cpp
int GetDayOfWeek() const throw();
```
@@ -361,7 +361,7 @@ This function calls `GetLocalTm`, which uses an internal statically allocated bu
Gets a **struct tm** that contains a decomposition of the time contained in this `CTime` object.
-```
+```cpp
struct tm* GetGmtTm(struct tm* ptm) const;
```
@@ -388,7 +388,7 @@ A pointer to a filled-in **struct tm** as defined in the include file TIME.H. Se
Returns the hour represented by the `CTime` object.
-```
+```cpp
int GetHour() const throw();
```
@@ -408,7 +408,7 @@ This function calls `GetLocalTm`, which uses an internal statically allocated bu
Gets a **struct tm** containing a decomposition of the time contained in this `CTime` object.
-```
+```cpp
struct tm* GetLocalTm(struct tm* ptm) const;
```
@@ -435,7 +435,7 @@ A pointer to a filled-in **struct tm** as defined in the include file TIME.H. Se
Returns the minute represented by the `CTime` object.
-```
+```cpp
int GetMinute() const throw();
```
@@ -455,7 +455,7 @@ See the example for [GetHour](#gethour).
Returns the month represented by the `CTime` object.
-```
+```cpp
int GetMonth() const throw();
```
@@ -475,7 +475,7 @@ See the example for [GetDay](#getday).
Returns the second represented by the `CTime` object.
-```
+```cpp
int GetSecond() const throw();
```
@@ -495,7 +495,7 @@ See the example for [GetHour](#gethour).
Returns a **__time64_t** value for the given `CTime` object.
-```
+```cpp
__time64_t GetTime() const throw();
```
@@ -511,7 +511,7 @@ __time64_t GetTime() const throw();
Returns the year represented by the `CTime` object.
-```
+```cpp
int GetYear();
```
@@ -531,7 +531,7 @@ See the example for [GetDay](#getday).
The assignment operator.
-```
+```cpp
CTime& operator=(__time64_t time) throw();
```
@@ -552,7 +552,7 @@ This overloaded assignment operator copies the source time into this `CTime` obj
These operators add and subtract `CTimeSpan` and `CTime` objects.
-```
+```cpp
CTime operator+(CTimeSpan timeSpan) const throw();
CTime operator-(CTimeSpan timeSpan) const throw();
CTimeSpan operator-(CTime time) const throw();
@@ -582,7 +582,7 @@ A `CTime` or `CTimeSpan` object representing the result of the operation.
These operators add and subtract a `CTimeSpan` object to and from this `CTime` object.
-```
+```cpp
CTime& operator+=(CTimeSpan span) throw();
CTime& operator-=(CTimeSpan span) throw();
```
@@ -611,7 +611,7 @@ These operators allow you to add and subtract a `CTimeSpan` object to and from t
Serializes the data associated with the member variable to or from an archive.
-```
+```cpp
CArchive& Serialize64(CArchive& ar);
```
diff --git a/docs/atl-mfc-shared/reference/ctimespan-class.md b/docs/atl-mfc-shared/reference/ctimespan-class.md
index d00f45805e..ae10bdba1c 100644
--- a/docs/atl-mfc-shared/reference/ctimespan-class.md
+++ b/docs/atl-mfc-shared/reference/ctimespan-class.md
@@ -4,15 +4,14 @@ title: "CTimeSpan Class"
ms.date: "10/18/2018"
f1_keywords: ["CTimeSpan", "ATLTIME/ATL::CTimeSpan", "ATLTIME/ATL::CTimeSpan::CTimeSpan", "ATLTIME/ATL::CTimeSpan::Format", "ATLTIME/ATL::CTimeSpan::GetDays", "ATLTIME/ATL::CTimeSpan::GetHours", "ATLTIME/ATL::CTimeSpan::GetMinutes", "ATLTIME/ATL::CTimeSpan::GetSeconds", "ATLTIME/ATL::CTimeSpan::GetTimeSpan", "ATLTIME/ATL::CTimeSpan::GetTotalHours", "ATLTIME/ATL::CTimeSpan::GetTotalMinutes", "ATLTIME/ATL::CTimeSpan::GetTotalSeconds", "ATLTIME/ATL::CTimeSpan::Serialize64"]
helpviewer_keywords: ["elapsed time, CTimeSpan object", "timespan", "time span", "CTimeSpan class", "shared classes, CTimeSpan", "time, elapsed"]
-ms.assetid: ee1e42f6-1839-477a-8435-fb26ad475140
---
-# CTimeSpan Class
+# `CTimeSpan` Class
An amount of time, which is internally stored as the number of seconds in the time span.
## Syntax
-```
+```cpp
class CTimeSpan
```
@@ -22,54 +21,54 @@ class CTimeSpan
|Name|Description|
|----------|-----------------|
-|[CTimeSpan::CTimeSpan](#ctimespan)|Constructs `CTimeSpan` objects in various ways.|
+|[`CTimeSpan::CTimeSpan`](#ctimespan)|Constructs `CTimeSpan` objects in various ways.|
### Public Methods
|Name|Description|
|----------|-----------------|
-|[CTimeSpan::Format](#format)|Converts a `CTimeSpan` into a formatted string.|
-|[CTimeSpan::GetDays](#getdays)|Returns a value that represents the number of complete days in this `CTimeSpan`.|
-|[CTimeSpan::GetHours](#gethours)|Returns a value that represents the number of hours in the current day (-23 through 23).|
-|[CTimeSpan::GetMinutes](#getminutes)|Returns a value that represents the number of minutes in the current hour (-59 through 59).|
-|[CTimeSpan::GetSeconds](#getseconds)|Returns a value that represents the number of seconds in the current minute (-59 through 59).|
-|[CTimeSpan::GetTimeSpan](#gettimespan)|Returns the value of the `CTimeSpan` object.|
-|[CTimeSpan::GetTotalHours](#gettotalhours)|Returns a value that represents the total number of complete hours in this `CTimeSpan`.|
-|[CTimeSpan::GetTotalMinutes](#gettotalminutes)|Returns a value that represents the total number of complete minutes in this `CTimeSpan`.|
-|[CTimeSpan::GetTotalSeconds](#gettotalseconds)|Returns a value that represents the total number of complete seconds in this `CTimeSpan`.|
-|[CTimeSpan::Serialize64](#serialize64)|Serializes data to or from an archive.|
+|[`CTimeSpan::Format`](#format)|Converts a `CTimeSpan` into a formatted string.|
+|[`CTimeSpan::GetDays`](#getdays)|Returns a value that represents the number of complete days in this `CTimeSpan`.|
+|[`CTimeSpan::GetHours`](#gethours)|Returns a value that represents the number of hours in the current day (-23 through 23).|
+|[`CTimeSpan::GetMinutes`](#getminutes)|Returns a value that represents the number of minutes in the current hour (-59 through 59).|
+|[`CTimeSpan::GetSeconds`](#getseconds)|Returns a value that represents the number of seconds in the current minute (-59 through 59).|
+|[`CTimeSpan::GetTimeSpan`](#gettimespan)|Returns the value of the `CTimeSpan` object.|
+|[`CTimeSpan::GetTotalHours`](#gettotalhours)|Returns a value that represents the total number of complete hours in this `CTimeSpan`.|
+|[`CTimeSpan::GetTotalMinutes`](#gettotalminutes)|Returns a value that represents the total number of complete minutes in this `CTimeSpan`.|
+|[`CTimeSpan::GetTotalSeconds`](#gettotalseconds)|Returns a value that represents the total number of complete seconds in this `CTimeSpan`.|
+|[`CTimeSpan::Serialize64`](#serialize64)|Serializes data to or from an archive.|
### Operators
|Name|Description|
|-|-|
-|[operator + -](#operator_add_-)|Adds and subtracts `CTimeSpan` objects.|
-|[operator += -=](#operator_add_eq_-_eq)|Adds and subtracts a `CTimeSpan` object to and from this `CTimeSpan`.|
-|[operator == < etc.](#ctimespan_comparison_operators)|Compares two relative time values.|
+|[`operator + -`](#operator_add_-)|Adds and subtracts `CTimeSpan` objects.|
+|[`operator += -=`](#operator_add_eq_-_eq)|Adds and subtracts a `CTimeSpan` object to and from this `CTimeSpan`.|
+|[`operator == < etc.`](#ctimespan_comparison_operators)|Compares two relative time values.|
## Remarks
-`CTimeSpan` does not have a base class.
+`CTimeSpan` doesn't have a base class.
`CTimeSpan` functions convert seconds to various combinations of days, hours, minutes, and seconds.
-The `CTimeSpan` object is stored in a **__time64_t** structure, which is 8 bytes.
+The `CTimeSpan` object is stored in a **`__time64_t`** structure, which is 8 bytes.
-A companion class, [CTime](../../atl-mfc-shared/reference/ctime-class.md), represents an absolute time.
+A companion class, [`CTime`](../../atl-mfc-shared/reference/ctime-class.md), represents an absolute time.
-The `CTime` and `CTimeSpan` classes are not designed for derivation. Because there are no virtual functions, the size of both `CTime` and `CTimeSpan` objects is exactly 8 bytes. Most member functions are inline.
+The `CTime` and `CTimeSpan` classes aren't designed for derivation. Because there are no virtual functions, the size of both `CTime` and `CTimeSpan` objects is exactly 8 bytes. Most member functions are inline.
For more information on using `CTimeSpan`, see the articles [Date and Time](../../atl-mfc-shared/date-and-time.md), and [Time Management](../../c-runtime-library/time-management.md) in the *Run-Time Library Reference*.
## Requirements
-**Header:** atltime.h
+**Header:** `atltime.h`
-## CTimeSpan Comparison Operators
+## `CTimeSpan` Comparison Operators
Comparison operators.
-```
+```cpp
bool operator==(CTimeSpan span) const throw();
bool operator!=(CTimeSpan span) const throw();
bool operator<(CTimeSpan span) const throw();
@@ -80,22 +79,22 @@ bool operator>=(CTimeSpan span) const throw();
### Parameters
-*span*
+*`span`*\
The object to compare.
### Return Value
-These operators compare two relative time values. They return TRUE if the condition is true; otherwise FALSE.
+These operators compare two relative time values. They return `TRUE` if the condition is true; otherwise `FALSE`.
### Example
[!code-cpp[NVC_ATLMFC_Utilities#169](../../atl-mfc-shared/codesnippet/cpp/ctimespan-class_1.cpp)]
-## CTimeSpan::CTimeSpan
+## `CTimeSpan::CTimeSpan`
Constructs `CTimeSpan` objects in various ways.
-```
+```cpp
CTimeSpan() throw();
CTimeSpan(__time64_t time) throw();
@@ -108,13 +107,13 @@ CTimeSpan(
### Parameters
-*timeSpanSrc*
+*`timeSpanSrc`*\
A `CTimeSpan` object that already exists.
-*time*
-A **__time64_t** time value, which is the number of seconds in the time span.
+*`time`*\
+A **`__time64_t`** time value, which is the number of seconds in the time span.
-*lDays*, *nHours*, *nMins*, *nSecs*
+*`lDays`*, *`nHours`*, *`nMins`*, *`nSecs`*\
Days, hours, minutes, and seconds, respectively.
### Remarks
@@ -125,7 +124,7 @@ All these constructors create a new `CTimeSpan` object initialized with the spec
- `CTimeSpan( const CTimeSpan& );` Constructs a `CTimeSpan` object from another `CTimeSpan` value.
-- `CTimeSpan( __time64_t );` Constructs a `CTimeSpan` object from a **__time64_t** type.
+- `CTimeSpan( __time64_t );` Constructs a `CTimeSpan` object from a **`__time64_t`** type.
- `CTimeSpan( LONG, int, int, int );` Constructs a `CTimeSpan` object from components with each component constrained to the following ranges:
@@ -142,11 +141,11 @@ Note that the Debug version of the Microsoft Foundation Class Library asserts if
[!code-cpp[NVC_ATLMFC_Utilities#162](../../atl-mfc-shared/codesnippet/cpp/ctimespan-class_2.cpp)]
-## CTimeSpan::Format
+## `CTimeSpan::Format`
Generates a formatted string that corresponds to this `CTimeSpan`.
-```
+```cpp
CString Format(LPCSTR pFormat) const;
CString Format(LPCTSTR pszFormat) const;
CString Format(UINT nID) const;
@@ -154,20 +153,20 @@ CString Format(UINT nID) const;
### Parameters
-*pFormat*, *pszFormat*
+*`pFormat`*, *`pszFormat`*\
A formatting string similar to the `printf` formatting string. Formatting codes, preceded by a percent (`%`) sign, are replaced by the corresponding `CTimeSpan` component. Other characters in the formatting string are copied unchanged to the returned string. The value and meaning of the formatting codes for `Format` are listed below:
-- **%D** Total days in this `CTimeSpan`
+- **`%D`** Total days in this `CTimeSpan`
-- **%H** Hours in the current day
+- **`%H`** Hours in the current day
-- **%M** Minutes in the current hour
+- **`%M`** Minutes in the current hour
-- **%S** Seconds in the current minute
+- **`%S`** Seconds in the current minute
-- **%%** Percent sign
+- **`%%`** Percent sign
-*nID*
+*`nID`*\
The ID of the string that identifies this format.
### Return Value
@@ -176,17 +175,17 @@ A `CString` object that contains the formatted time.
### Remarks
-The Debug version of the library checks the formatting codes and asserts if the code is not in the list above.
+The Debug version of the library checks the formatting codes and asserts if the code isn't in the list above.
### Example
[!code-cpp[NVC_ATLMFC_Utilities#163](../../atl-mfc-shared/codesnippet/cpp/ctimespan-class_3.cpp)]
-## CTimeSpan::GetDays
+## `CTimeSpan::GetDays`
Returns a value that represents the number of complete days in this `CTimeSpan`.
-```
+```cpp
LONGLONG GetDays() const throw();
```
@@ -196,17 +195,17 @@ Returns the number of complete 24-hour days in the time span. This value may be
### Remarks
-Note that Daylight Savings Time can cause `GetDays` to return a potentially surprising result. For example, when DST is in effect, `GetDays` reports the number of days between April 1 and May 1 as 29, not 30, because one day in April is shortened by an hour and therefore does not count as a complete day.
+Note that Daylight Savings Time (DST) can cause `GetDays` to return a potentially surprising result. For example, when DST is in effect, `GetDays` reports the number of days between April 1 and May 1 as 29, not 30, because one day in April is shortened by an hour and therefore doesn't count as a complete day.
### Example
[!code-cpp[NVC_ATLMFC_Utilities#164](../../atl-mfc-shared/codesnippet/cpp/ctimespan-class_4.cpp)]
-## CTimeSpan::GetHours
+## `CTimeSpan::GetHours`
Returns a value that represents the number of hours in the current day (-23 through 23).
-```
+```cpp
LONG GetHours() const throw();
```
@@ -218,11 +217,11 @@ Returns the number of hours in the current day. The range is -23 through 23.
[!code-cpp[NVC_ATLMFC_Utilities#165](../../atl-mfc-shared/codesnippet/cpp/ctimespan-class_5.cpp)]
-## CTimeSpan::GetMinutes
+## `CTimeSpan::GetMinutes`
Returns a value that represents the number of minutes in the current hour (-59 through 59).
-```
+```cpp
LONG GetMinutes() const throw();
```
@@ -232,13 +231,13 @@ Returns the number of minutes in the current hour. The range is -59 through 59.
### Example
-See the example for [GetHours](#gethours).
+See the example for [`GetHours`](#gethours).
-## CTimeSpan::GetSeconds
+## `CTimeSpan::GetSeconds`
Returns a value that represents the number of seconds in the current minute (-59 through 59).
-```
+```cpp
LONG GetSeconds() const throw();
```
@@ -248,13 +247,13 @@ Returns the number of seconds in the current minute. The range is -59 through 59
### Example
-See the example for [GetHours](#gethours).
+See the example for [`GetHours`](#gethours).
-## CTimeSpan::GetTimeSpan
+## `CTimeSpan::GetTimeSpan`
Returns the value of the `CTimeSpan` object.
-```
+```cpp
__ time64_t GetTimeSpan() const throw();
```
@@ -262,11 +261,11 @@ __ time64_t GetTimeSpan() const throw();
Returns the current value of the `CTimeSpan` object.
-## CTimeSpan::GetTotalHours
+## `CTimeSpan::GetTotalHours`
Returns a value that represents the total number of complete hours in this `CTimeSpan`.
-```
+```cpp
LONGLONG GetTotalHours() const throw();
```
@@ -278,11 +277,11 @@ Returns the total number of complete hours in this `CTimeSpan`.
[!code-cpp[NVC_ATLMFC_Utilities#166](../../atl-mfc-shared/codesnippet/cpp/ctimespan-class_6.cpp)]
-## CTimeSpan::GetTotalMinutes
+## `CTimeSpan::GetTotalMinutes`
Returns a value that represents the total number of complete minutes in this `CTimeSpan`.
-```
+```cpp
LONGLONG GetTotalMinutes() const throw();
```
@@ -292,13 +291,13 @@ Returns the total number of complete minutes in this `CTimeSpan`.
### Example
-See the example for [GetTotalHours](#gettotalhours).
+See the example for [`GetTotalHours`](#gettotalhours).
-## CTimeSpan::GetTotalSeconds
+## `CTimeSpan::GetTotalSeconds`
Returns a value that represents the total number of complete seconds in this `CTimeSpan`.
-```
+```cpp
LONGLONG GetTotalSeconds() const throw();
```
@@ -308,20 +307,20 @@ Returns the total number of complete seconds in this `CTimeSpan`.
### Example
-See the example for [GetTotalHours](#gettotalhours).
+See the example for [`GetTotalHours`](#gettotalhours).
-## CTimeSpan::operator +, -
+## `CTimeSpan::operator +`, `CTimeSpan::operator -`
Adds and subtracts `CTimeSpan` objects.
-```
+```cpp
CTimeSpan operator+(CTimeSpan span) const throw();
CTimeSpan operator-(CTimeSpan span) const throw();
```
### Parameters
-*span*
+*`span`*\
The value to add to the `CTimeSpan` object.
### Return Value
@@ -336,18 +335,18 @@ These two operators allow you to add and subtract `CTimeSpan` objects to and fro
[!code-cpp[NVC_ATLMFC_Utilities#167](../../atl-mfc-shared/codesnippet/cpp/ctimespan-class_7.cpp)]
-## CTimeSpan::operator +=, -=
+## `CTimeSpan::operator +=`, `CTimeSpan::operator -=`
Adds and subtracts a `CTimeSpan` object to and from this `CTimeSpan`.
-```
+```cpp
CTimeSpan& operator+=(CTimeSpan span) throw();
CTimeSpan& operator-=(CTimeSpan span) throw();
```
### Parameters
-*span*
+*`span`*\
The value to add to the `CTimeSpan` object.
### Return Value
@@ -362,20 +361,20 @@ These operators allow you to add and subtract a `CTimeSpan` object to and from t
[!code-cpp[NVC_ATLMFC_Utilities#168](../../atl-mfc-shared/codesnippet/cpp/ctimespan-class_8.cpp)]
-## CTimeSpan::Serialize64
+## `CTimeSpan::Serialize64`
> [!NOTE]
> This method is only available in MFC projects.
Serializes the data associated with the member variable to or from an archive.
-```
+```cpp
CArchive& Serialize64(CArchive& ar);
```
### Parameters
-*ar*
+*`ar`*\
The `CArchive` object that you want to update.
### Return Value
@@ -384,11 +383,11 @@ The updated `CArchive` object.
## See also
-[asctime, _wasctime](../../c-runtime-library/reference/asctime-wasctime.md)
-[_ftime, _ftime32, _ftime64](../../c-runtime-library/reference/ftime-ftime32-ftime64.md)
-[gmtime, _gmtime32, _gmtime64](../../c-runtime-library/reference/gmtime-gmtime32-gmtime64.md)
-[localtime, _localtime32, _localtime64](../../c-runtime-library/reference/localtime-localtime32-localtime64.md)
-[strftime, wcsftime, _strftime_l, _wcsftime_l](../../c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l.md)
-[time, _time32, _time64](../../c-runtime-library/reference/time-time32-time64.md)
-[Hierarchy Chart](../../mfc/hierarchy-chart.md)
+[`asctime`, `_wasctime`](../../c-runtime-library/reference/asctime-wasctime.md)\
+[`_ftime`, `_ftime32`, `_ftime64`](../../c-runtime-library/reference/ftime-ftime32-ftime64.md)\
+[`gmtime`, `_gmtime32`, `_gmtime64`](../../c-runtime-library/reference/gmtime-gmtime32-gmtime64.md)\
+[`localtime`, `_localtime32`, `_localtime64`](../../c-runtime-library/reference/localtime-localtime32-localtime64.md)\
+[`strftime`, `wcsftime`, `_strftime_l`, `_wcsftime_l`](../../c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l.md)\
+[`time`, `_time32`, `_time64`](../../c-runtime-library/reference/time-time32-time64.md)\
+[Hierarchy Chart](../../mfc/hierarchy-chart.md)\
[ATL/MFC Shared Classes](../../atl-mfc-shared/atl-mfc-shared-classes.md)
diff --git a/docs/atl-mfc-shared/reference/iatlstringmgr-class.md b/docs/atl-mfc-shared/reference/iatlstringmgr-class.md
index cbf301b82b..9eb991ca28 100644
--- a/docs/atl-mfc-shared/reference/iatlstringmgr-class.md
+++ b/docs/atl-mfc-shared/reference/iatlstringmgr-class.md
@@ -12,7 +12,7 @@ This class represents the interface to a `CStringT` memory manager.
## Syntax
-```
+```cpp
__interface IAtlStringMgr
```
@@ -42,7 +42,7 @@ You can also use this class to implement a custom memory manager for your custom
Allocates a new string data structure.
-```
+```cpp
CStringData* Allocate(int nAllocLength,int nCharSize) throw();
```
@@ -72,7 +72,7 @@ Call [IAtlStringMgr::Free](#free) or [IAtlStringMgr::ReAllocate](#reallocate) to
Returns a pointer to a new string manager for use with another instance of `CSimpleStringT`.
-```
+```cpp
IAtlStringMgr* Clone() throw();
```
@@ -113,7 +113,7 @@ Frees the specified memory block previously allocated by [Allocate](#allocate) o
Returns a pointer to a string data structure for an empty string.
-```
+```cpp
CStringData* GetNilString() throw();
```
@@ -135,7 +135,7 @@ Call this function to return a representation of an empty string.
Reallocates a string data structure.
-```
+```cpp
CStringData* Reallocate(
CStringData* pData,
int nAllocLength,
diff --git a/docs/atl-mfc-shared/string-data-management.md b/docs/atl-mfc-shared/string-data-management.md
index 80640e06c2..b48c6a636d 100644
--- a/docs/atl-mfc-shared/string-data-management.md
+++ b/docs/atl-mfc-shared/string-data-management.md
@@ -3,19 +3,18 @@ description: "Learn more about: String Data Management"
title: "String Data Management"
ms.date: "11/04/2016"
helpviewer_keywords: ["Unicode, string objects"]
-ms.assetid: 0b53a542-eeb1-4108-9ada-6700645b6f8f
---
# String Data Management
Visual C++ provides several ways to manage string data:
-- [String Manipulation](../c-runtime-library/string-manipulation-crt.md) for working with C-style null-terminated strings
+- [String Manipulation](../c-runtime-library/string-manipulation-crt.md) for working with C-style `NULL`-terminated strings
- Win32 API functions for managing strings
-- MFC's class [CStringT Class](../atl-mfc-shared/reference/cstringt-class.md), which provides flexible, resizable string objects
+- MFC's class [`CStringT` Class](../atl-mfc-shared/reference/cstringt-class.md), which provides flexible, resizable string objects
-- Class [CStringT Class](../atl-mfc-shared/reference/cstringt-class.md), which provides an MFC-independent string object with the same functionality as `CString`
+- Class [`CStringT` Class](../atl-mfc-shared/reference/cstringt-class.md), which provides an MFC-independent string object with the same functionality as `CString`
Nearly all programs work with string data. MFC's `CString` class is often the best solution for flexible string handling. Starting with version 7.0, `CString` can be used in MFC or MFC-independent programs. Both the run-time library and `CString` support strings containing multibyte (wide) characters, as in Unicode or MBCS programming.
@@ -23,11 +22,11 @@ This article describes the general-purpose services that the class library provi
- [Unicode and MBCS Provide portability](#_core_unicode_and_mbcs_provide_portability)
-- [CStrings and const char Pointers](#_core_cstrings_and_const_char_pointers)
+- [`CStrings` and `const char` Pointers](#_core_cstrings_and_const_char_pointers)
-- [CString Reference Counting](#_core_cstring_reference_counting)
+- [`CString` Reference Counting](#_core_cstring_reference_counting)
-The [CStringT Class](../atl-mfc-shared/reference/cstringt-class.md) class provides support for manipulating strings. It is intended to replace and extend the functionality normally provided by the C run-time library string package. The `CString` class supplies member functions and operators for simplified string handling, similar to those found in Basic. The class also provides constructors and operators for constructing, assigning, and comparing `CString`s and standard C++ string data types. Because `CString` is not derived from `CObject`, you can use `CString` objects independently of most of the Microsoft Foundation Class Library (MFC).
+The [`CStringT` Class](../atl-mfc-shared/reference/cstringt-class.md) class provides support for manipulating strings. It's intended to replace and extend the functionality normally provided by the C run-time library string package. The `CString` class supplies member functions and operators for simplified string handling, similar to those found in Basic. The class also provides constructors and operators for constructing, assigning, and comparing `CString`s and standard C++ string data types. Because `CString` isn't derived from `CObject`, you can use `CString` objects independently of most of the Microsoft Foundation Class Library (MFC).
`CString` objects follow "value semantics." A `CString` object represents a unique value. Think of a `CString` as an actual string, not as a pointer to a string.
@@ -35,10 +34,10 @@ A `CString` object represents a sequence of a variable number of characters. `CS
## Unicode and MBCS Provide Portability
-With MFC version 3.0 and later, MFC, including `CString`, is enabled for both Unicode and multibyte character sets (MBCS). This support makes it easier for you to write portable applications that you can build for either Unicode or ANSI characters. To enable this portability, each character in a `CString` object is of type TCHAR, which is defined as **`wchar_t`** if you define the symbol _UNICODE when you build your application, or as **`char`** if not. A **`wchar_t`** character is 16 bits wide. MBCS is enabled if you build with the symbol _MBCS defined. MFC itself is built with either the _MBCS symbol (for the NAFX libraries) or the _UNICODE symbol (for the UAFX libraries) defined.
+With MFC version 3.0 and later, MFC, including `CString`, is enabled for both Unicode and multibyte character sets (MBCS). This support makes it easier for you to write portable applications that you can build for either Unicode or ANSI characters. To enable this portability, each character in a `CString` object is of type `TCHAR`, which is defined as **`wchar_t`** if you define the symbol `_UNICODE` when you build your application, or as **`char`** if not. A **`wchar_t`** character is 16 bits wide. MBCS is enabled if you build with the symbol `_MBCS` defined. MFC itself is built with either the `_MBCS` symbol (for the NAFX libraries) or the `_UNICODE` symbol (for the UAFX libraries) defined.
> [!NOTE]
-> The `CString` examples in this and the accompanying articles on strings show literal strings properly formatted for Unicode portability, using the _T macro, which translates the literal string to the form:
+> The `CString` examples in this and the accompanying articles on strings show literal strings properly formatted for Unicode portability, using the `_T` macro, which translates the literal string to the form:
`L"literal string"`
@@ -48,34 +47,34 @@ With MFC version 3.0 and later, MFC, including `CString`, is enabled for both Un
[!code-cpp[NVC_ATLMFC_Utilities#187](../atl-mfc-shared/codesnippet/cpp/string-data-management_1.cpp)]
> [!NOTE]
-> is translated as a Unicode string if _UNICODE is defined or as an ANSI string if not. For more information, see the article [Unicode and Multibyte Character Set (MBCS) Support](../atl-mfc-shared/unicode-and-multibyte-character-set-mbcs-support.md).
+> is translated as a Unicode string if `_UNICODE` is defined or as an ANSI string if not. For more information, see the article [Unicode and Multibyte Character Set (MBCS) Support](../atl-mfc-shared/unicode-and-multibyte-character-set-mbcs-support.md).
-A `CString` object can store up to INT_MAX (2,147,483,647) characters. The TCHAR data type is used to get or set individual characters inside a `CString` object. Unlike character arrays, the `CString` class has a built-in memory allocation capability. This allows `CString` objects to automatically grow as needed (that is, you do not have to worry about growing a `CString` object to fit longer strings).
+A `CString` object can store up to `INT_MAX` (2,147,483,647) characters. The `TCHAR` data type is used to get or set individual characters inside a `CString` object. Unlike character arrays, the `CString` class has a built-in memory allocation capability. This allows `CString` objects to automatically grow as needed (that is, you don't have to worry about growing a `CString` object to fit longer strings).
-## CStrings and const char Pointers
+## `CStrings` and `const char` Pointers
-A `CString` object also can act like a literal C-style string (an `PCXSTR`, which is the same as **const char**\* if not under Unicode). The [CSimpleStringT::operator PCXSTR](../atl-mfc-shared/reference/csimplestringt-class.md#operator_pcxstr) conversion operator allows `CString` objects to be freely substituted for character pointers in function calls. The **CString( LPCWSTR** `pszSrc` **)** constructor allows character pointers to be substituted for `CString` objects.
+A `CString` object also can act like a literal C-style string (an `PCXSTR`, which is the same as `const char*` if not under Unicode). The [`CSimpleStringT::operator PCXSTR`](../atl-mfc-shared/reference/csimplestringt-class.md#operator_pcxstr) conversion operator allows `CString` objects to be freely substituted for character pointers in function calls. The `CString(LPCWSTR pszSrc)` constructor allows character pointers to be substituted for `CString` objects.
-No attempt is made to fold `CString` objects. If you make two `CString` objects containing `Chicago`, for example, the characters in `Chicago` are stored in two places. (This may not be true of future versions of MFC, so you should not depend on it.)
+No attempt is made to fold `CString` objects. If you make two `CString` objects containing `Chicago`, for example, the characters in `Chicago` are stored in two places. (This may not be true of future versions of MFC, so you shouldn't depend on it.)
> [!NOTE]
-> Use the [CSimpleStringT::GetBuffer](../atl-mfc-shared/reference/csimplestringt-class.md#getbuffer) and [CSimpleStringT::ReleaseBuffer](../atl-mfc-shared/reference/csimplestringt-class.md#releasebuffer) member functions when you need to directly access a `CString` as a nonconstant pointer to a character.
+> Use the [`CSimpleStringT::GetBuffer`](../atl-mfc-shared/reference/csimplestringt-class.md#getbuffer) and [`CSimpleStringT::ReleaseBuffer`](../atl-mfc-shared/reference/csimplestringt-class.md#releasebuffer) member functions when you need to directly access a `CString` as a nonconstant pointer to a character.
> [!NOTE]
-> Use the [CStringT::AllocSysString](../atl-mfc-shared/reference/cstringt-class.md#allocsysstring) and [CStringT::SetSysString](../atl-mfc-shared/reference/cstringt-class.md#setsysstring) member functions to allocate and set BSTR objects used in Automation (formerly known as OLE Automation).
+> Use the [`CStringT::AllocSysString`](../atl-mfc-shared/reference/cstringt-class.md#allocsysstring) and [`CStringT::SetSysString`](../atl-mfc-shared/reference/cstringt-class.md#setsysstring) member functions to allocate and set `BSTR` objects used in Automation (formerly known as OLE Automation).
> [!NOTE]
> Where possible, allocate `CString` objects on the frame rather than on the heap. This saves memory and simplifies parameter passing.
-The `CString` class is not implemented as a Microsoft Foundation Class Library collection class, though `CString` objects can certainly be stored as elements in collections.
+The `CString` class isn't implemented as a Microsoft Foundation Class Library collection class, though `CString` objects can certainly be stored as elements in collections.
-## CString Reference Counting
+## `CString` Reference Counting
-As of MFC version 4.0, when [CStringT Class](../atl-mfc-shared/reference/cstringt-class.md) objects are copied, MFC increments a reference count rather than copying the data. This makes passing parameters by value and returning `CString` objects by value more efficient. These operations cause the copy constructor to be called, sometimes more than once. Incrementing a reference count reduces that overhead for these common operations and makes using `CString` a more attractive option.
+As of MFC version 4.0, when [`CStringT` Class](../atl-mfc-shared/reference/cstringt-class.md) objects are copied, MFC increments a reference count rather than copying the data. This makes passing parameters by value and returning `CString` objects by value more efficient. These operations cause the copy constructor to be called, sometimes more than once. Incrementing a reference count reduces that overhead for these common operations and makes using `CString` a more attractive option.
-As each copy is destroyed, the reference count in the original object is decremented. The original `CString` object is not destroyed until its reference count is reduced to zero.
+As each copy is destroyed, the reference count in the original object is decremented. The original `CString` object isn't destroyed until its reference count is reduced to zero.
-You can use the `CString` member functions [CSimpleStringT::LockBuffer](../atl-mfc-shared/reference/csimplestringt-class.md#lockbuffer) and [CSimpleStringT::UnlockBuffer](../atl-mfc-shared/reference/csimplestringt-class.md#unlockbuffer) to disable or enable reference counting.
+You can use the `CString` member functions [`CSimpleStringT::LockBuffer`](../atl-mfc-shared/reference/csimplestringt-class.md#lockbuffer) and [`CSimpleStringT::UnlockBuffer`](../atl-mfc-shared/reference/csimplestringt-class.md#unlockbuffer) to disable or enable reference counting.
## See also
diff --git a/docs/atl-mfc-shared/strings-atl-mfc.md b/docs/atl-mfc-shared/strings-atl-mfc.md
index db5891cc87..1c0b4515fa 100644
--- a/docs/atl-mfc-shared/strings-atl-mfc.md
+++ b/docs/atl-mfc-shared/strings-atl-mfc.md
@@ -3,7 +3,6 @@ description: "Learn more about: Strings (ATL/MFC)"
title: "Strings (ATL-MFC)"
ms.date: "11/04/2016"
helpviewer_keywords: ["const char pointers", "strings [C++], in ATL", "MFC [C++], string handling class", "MBCS [C++], CString support", "strings [C++], class CStringT", "char pointers", "reference counting [C++]", "strings [C++], string operations", "portability [C++], Unicode and ANSI string objects", "literal strings [C++], class CString", "copying string objects", "ATL, string handling class", "strings [C++], in MFC", "strings [C++]", "C-style strings", "language portability [C++]", "strings [C++], class CString", "literal strings [C++], class CStringT"]
-ms.assetid: 3b33125b-1684-4542-a3a7-b00de7d0419e
---
# Strings (ATL/MFC)
@@ -11,18 +10,18 @@ Nearly all programs work with string data. Visual C++ provides several ways to m
## In This Section
-[Using CStringT](../atl-mfc-shared/using-cstringt.md)
-Describes programming using the template class CStringT.
+[Using `CStringT`](../atl-mfc-shared/using-cstringt.md)\
+Describes programming using the template class `CStringT`.
-[Using CString](../atl-mfc-shared/using-cstring.md)
-Describes programming using CString, the default implementation of CStringT.
+[Using `CString`](../atl-mfc-shared/using-cstring.md)\
+Describes programming using `CString`, the default implementation of `CStringT`.
## Related Sections
-[CStringT Overview](../atl-mfc-shared/reference/cstringt-class.md)
+[`CStringT` Overview](../atl-mfc-shared/reference/cstringt-class.md)\
Provides reference information about the shared `CStringT` class.
-[MFC Concepts](../mfc/mfc-concepts.md)
+[MFC Concepts](../mfc/mfc-concepts.md)\
Provides conceptual and task-based topics to help you program using the MFC Library.
## See also
diff --git a/docs/atl-mfc-shared/unicode-and-multibyte-character-set-mbcs-support.md b/docs/atl-mfc-shared/unicode-and-multibyte-character-set-mbcs-support.md
index 094c1d037a..2ba1928aa6 100644
--- a/docs/atl-mfc-shared/unicode-and-multibyte-character-set-mbcs-support.md
+++ b/docs/atl-mfc-shared/unicode-and-multibyte-character-set-mbcs-support.md
@@ -8,11 +8,14 @@ helpviewer_keywords: ["MFC [C++], character set support", "MBCS [C++], strings a
Some languages, for example, Japanese and Chinese, have large character sets. To support programming for these markets, the Microsoft Foundation Class Library (MFC) enables two different approaches to handling large character sets:
-- [Unicode](#mfc-support-for-unicode-strings), **`wchar_t`** based wide-characters and strings encoded as UTF-16.
+- [Unicode](#mfc-support-for-unicode-strings), **`wchar_t`** based wide-characters, and strings encoded as UTF-16.
- [Multibyte Character Sets (MBCS)](#mfc-support-for-mbcs-strings), **`char`** based single or double-byte characters and strings encoded in a locale-specific character set.
-Microsoft has recommended the MFC Unicode libraries for all new development, and the MBCS libraries were deprecated in Visual Studio 2013 and Visual Studio 2015. This is no longer the case. The MBCS deprecation warnings have been removed in Visual Studio 2017.
+> [!NOTE]
+> Microsoft recommends the MFC Unicode libraries for all new development.\
+> The MBCS libraries were deprecated in Visual Studio 2013 and Visual Studio 2015. This is no longer the case.\
+> Starting with Visual Studio 2017, the MBCS libraries are no longer deprecated and don't generate deprecation warnings.
## MFC Support for Unicode Strings
@@ -51,13 +54,13 @@ These library, debugger, and DLL files are used to support Unicode in MFC:
(*version* represents the version number of the file; for example, '140' means version 14.0.)
-`CString` is based on the `TCHAR` data type. If the symbol `_UNICODE` is defined for a build of your program, `TCHAR` is defined as type **`wchar_t`**, a 16-bit character encoding type. Otherwise, `TCHAR` is defined as **`char`**, the normal 8-bit character encoding. Therefore, under Unicode, a `CString` is composed of 16-bit characters. Without Unicode, it is composed of characters of type **`char`**.
+`CString` is based on the `TCHAR` data type. If the symbol `_UNICODE` is defined for a build of your program, `TCHAR` is defined as type **`wchar_t`**, a 16-bit character encoding type. Otherwise, `TCHAR` is defined as **`char`**, the normal 8-bit character encoding. Therefore, under Unicode, a `CString` is composed of 16-bit characters. Without Unicode, it's composed of characters of type **`char`**.
To complete Unicode programming of your application, you must also:
- Use the `_T` macro to conditionally code literal strings to be portable to Unicode.
-- When you pass strings, pay attention to whether function arguments require a length in characters or a length in bytes. The difference is important if you are using Unicode strings.
+- When you pass strings, pay attention to whether function arguments require a length in characters or a length in bytes. The difference is important if you're using Unicode strings.
- Use portable versions of the C run-time string-handling functions.
@@ -77,9 +80,9 @@ The [Run-Time Library Reference](../c-runtime-library/c-run-time-library-referen
The class library is also enabled for multibyte character sets, but only for double-byte character sets (DBCS).
-In a multibyte character set, a character can be one or two bytes wide. If it is two bytes wide, its first byte is a special "lead byte" that is chosen from a particular range, depending on which code page is in use. Taken together, the lead and "trail bytes" specify a unique character encoding.
+In a multibyte character set, a character can be one or 2 bytes wide. If it's 2 bytes wide, its first byte is a special "lead byte" that is chosen from a particular range, depending on which code page is in use. Taken together, the lead and "trail bytes" specify a unique character encoding.
-If the symbol `_MBCS` is defined for a build of your program, type `TCHAR`, on which `CString` is based, maps to **`char`**. It is up to you to determine which bytes in a `CString` are lead bytes and which are trail bytes. The C run-time library supplies functions to help you determine this.
+If the symbol `_MBCS` is defined for a build of your program, type `TCHAR`, on which `CString` is based, maps to **`char`**. It's up to you to determine which bytes in a `CString` are lead bytes and which are trail bytes. The C run-time library supplies functions to help you determine this.
Under DBCS, a given string can contain all single-byte ANSI characters, all double-byte characters, or a combination of the two. These possibilities require special care in parsing strings. This includes `CString` objects.
diff --git a/docs/atl/adding-a-control-atl-tutorial-part-2.md b/docs/atl/adding-a-control-atl-tutorial-part-2.md
index bc613dd306..64913399d1 100644
--- a/docs/atl/adding-a-control-atl-tutorial-part-2.md
+++ b/docs/atl/adding-a-control-atl-tutorial-part-2.md
@@ -109,7 +109,7 @@ Now you can build the control to see it in action.
Next, you'll add a custom property to the control.
-[Back to Step 1](../atl/creating-the-project-atl-tutorial-part-1.md) | [On to Step 3](../atl/adding-a-property-to-the-control-atl-tutorial-part-3.md)
+[Back to Step 1](../atl/creating-the-project-atl-tutorial-part-1.md) \| [On to Step 3](../atl/adding-a-property-to-the-control-atl-tutorial-part-3.md)
## See also
diff --git a/docs/atl/adding-a-property-page-atl-tutorial-part-6.md b/docs/atl/adding-a-property-page-atl-tutorial-part-6.md
index 2422ad5958..77ab6f873a 100644
--- a/docs/atl/adding-a-property-page-atl-tutorial-part-6.md
+++ b/docs/atl/adding-a-property-page-atl-tutorial-part-6.md
@@ -142,7 +142,7 @@ The **Apply** button is initially disabled. Start typing a value in the **Sides*
Next, you will put your control on a Web page.
-[Back to Step 5](../atl/adding-an-event-atl-tutorial-part-5.md) | [On to Step 7](../atl/putting-the-control-on-a-web-page-atl-tutorial-part-7.md)
+[Back to Step 5](../atl/adding-an-event-atl-tutorial-part-5.md) \| [On to Step 7](../atl/putting-the-control-on-a-web-page-atl-tutorial-part-7.md)
## See also
diff --git a/docs/atl/adding-a-property-to-the-control-atl-tutorial-part-3.md b/docs/atl/adding-a-property-to-the-control-atl-tutorial-part-3.md
index 5ddcc5edb6..eae5f195dd 100644
--- a/docs/atl/adding-a-property-to-the-control-atl-tutorial-part-3.md
+++ b/docs/atl/adding-a-property-to-the-control-atl-tutorial-part-3.md
@@ -57,7 +57,7 @@ The `get_Sides` method returns the current value of the `Sides` property through
You now have a property called `Sides`. In the next step, you will change the drawing code to use it.
-[Back to Step 2](../atl/adding-a-control-atl-tutorial-part-2.md) | [On to Step 4](../atl/changing-the-drawing-code-atl-tutorial-part-4.md)
+[Back to Step 2](../atl/adding-a-control-atl-tutorial-part-2.md) \| [On to Step 4](../atl/changing-the-drawing-code-atl-tutorial-part-4.md)
## See also
diff --git a/docs/atl/adding-an-event-atl-tutorial-part-5.md b/docs/atl/adding-an-event-atl-tutorial-part-5.md
index 7e5f75567b..18306b8df0 100644
--- a/docs/atl/adding-an-event-atl-tutorial-part-5.md
+++ b/docs/atl/adding-an-event-atl-tutorial-part-5.md
@@ -149,7 +149,7 @@ Now try out your events. Build the control and start the ActiveX Control Test Co
Next, you will add a property page.
-[Back to Step 4](../atl/changing-the-drawing-code-atl-tutorial-part-4.md) | [On to Step 6](../atl/adding-a-property-page-atl-tutorial-part-6.md)
+[Back to Step 4](../atl/changing-the-drawing-code-atl-tutorial-part-4.md) \| [On to Step 6](../atl/adding-a-property-page-atl-tutorial-part-6.md)
## See also
diff --git a/docs/atl/atl-control-containment-faq.yml b/docs/atl/atl-control-containment-faq.yml
index 48bacac41c..51c1ecd623 100644
--- a/docs/atl/atl-control-containment-faq.yml
+++ b/docs/atl/atl-control-containment-faq.yml
@@ -5,7 +5,7 @@ metadata:
ms.date: "11/04/2016"
helpviewer_keywords: ["hosting controls using ATL", "ActiveX control containers [C++], ATL control hosting", "ATL, hosting ActiveX controls", "ActiveX controls [C++], hosting", "controls [ATL]"]
ms.assetid: d4bdfbe0-82ca-4f2f-bb95-cb89bdcc9b53
-
+ ms.topic: faq
title: ATL Control Containment FAQ
summary: |
@@ -119,4 +119,4 @@ additionalContent: |
[AtlAxCreateControlLic](reference/composite-control-global-functions.md#atlaxcreatecontrollic)
[AtlAxCreateControlLicEx](reference/composite-control-global-functions.md#atlaxcreatecontrolex)
[CAxWindow2T Class](../atl/reference/caxwindow2t-class.md)
- [IAxWinHostWindowLic Interface](../atl/reference/iaxwinhostwindowlic-interface.md)
\ No newline at end of file
+ [IAxWinHostWindowLic Interface](../atl/reference/iaxwinhostwindowlic-interface.md)
diff --git a/docs/atl/atl-utilities-reference.md b/docs/atl/atl-utilities-reference.md
index 1fe2da4303..b332716189 100644
--- a/docs/atl/atl-utilities-reference.md
+++ b/docs/atl/atl-utilities-reference.md
@@ -1,8 +1,7 @@
---
-description: "Learn more about: ATL utilities reference"
title: "ATL utilities reference"
+description: "Learn more about: ATL utilities reference"
ms.date: "11/04/2016"
-ms.assetid: dd8a2888-34f4-461e-9bf4-834218f9b95b
---
# ATL utilities reference
@@ -47,8 +46,7 @@ ATL provides code for manipulating paths and URLs in the form of [CPathT](../atl
| [AtlIsUnsafeUrlChar](../atl/reference/atl-http-utility-functions.md#atlisunsafeurlchar) | Call this function to find out whether a character is safe for use in a URL. |
| [AtlUnescapeUrl](../atl/reference/atl-http-utility-functions.md#atlunescapeurl) | Call this function to convert escaped characters back to their original values. |
| [SystemTimeToHttpDate](../atl/reference/atl-http-utility-functions.md#systemtimetohttpdate) | Call this function to convert a system time to a string in a format suitable for using in HTTP headers. |
-| [ATLPath::AddBackslash](../atl/reference/atl-path-functions.md#addbackslash) | This function is an overloaded wrapper for [PathAddBackslash](/windows/desktop/api/shlwapi/nf-shlwapi-pathaddbackslasha |
-| ). |
+| [ATLPath::AddBackslash](../atl/reference/atl-path-functions.md#addbackslash) | This function is an overloaded wrapper for [PathAddBackslash](/windows/win32/api/shlwapi/nf-shlwapi-pathaddbackslasha). |
| [ATLPath::AddExtension](../atl/reference/atl-path-functions.md#addextension) | This function is an overloaded wrapper for [PathAddExtension](/windows/win32/api/shlwapi/nf-shlwapi-pathaddextensionw). |
| [ATLPath::Append](../atl/reference/atl-path-functions.md#append) | This function is an overloaded wrapper for [PathAppend](/windows/win32/api/shlwapi/nf-shlwapi-pathappendw). |
| [ATLPath::BuildRoot](../atl/reference/atl-path-functions.md#buildroot) | This function is an overloaded wrapper for [PathBuildRoot](/windows/win32/api/shlwapi/nf-shlwapi-pathbuildrootw). |
@@ -87,5 +85,5 @@ ATL provides code for manipulating paths and URLs in the form of [CPathT](../atl
## See also
-[Concepts](../atl/active-template-library-atl-concepts.md)
+[Concepts](../atl/active-template-library-atl-concepts.md)\
[ATL COM desktop components](../atl/atl-com-desktop-components.md)
diff --git a/docs/atl/changing-the-drawing-code-atl-tutorial-part-4.md b/docs/atl/changing-the-drawing-code-atl-tutorial-part-4.md
index f84b417b34..ae8149664e 100644
--- a/docs/atl/changing-the-drawing-code-atl-tutorial-part-4.md
+++ b/docs/atl/changing-the-drawing-code-atl-tutorial-part-4.md
@@ -151,7 +151,7 @@ After adding `FireViewChange`, rebuild and try the control again in the ActiveX
In the next step, you will add an event.
-[Back to Step 3](../atl/adding-a-property-to-the-control-atl-tutorial-part-3.md) | [On to Step 5](../atl/adding-an-event-atl-tutorial-part-5.md)
+[Back to Step 3](../atl/adding-a-property-to-the-control-atl-tutorial-part-3.md) \| [On to Step 5](../atl/adding-an-event-atl-tutorial-part-5.md)
## See also
diff --git a/docs/atl/object-safety-classes.md b/docs/atl/object-safety-classes.md
index 29b2fbdcae..8021fd778b 100644
--- a/docs/atl/object-safety-classes.md
+++ b/docs/atl/object-safety-classes.md
@@ -1,6 +1,6 @@
---
description: "Learn more about: Object Safety Classes"
-title: "Object Safety Classes (ATL)| Microsoft Docs"
+title: Object Safety Classes (ATL)
ms.date: "11/04/2016"
ms.topic: "reference"
helpviewer_keywords: ["safety classes", "object safety classes"]
diff --git a/docs/atl/putting-the-control-on-a-web-page-atl-tutorial-part-7.md b/docs/atl/putting-the-control-on-a-web-page-atl-tutorial-part-7.md
index 9bfba0d873..14db4bbf4c 100644
--- a/docs/atl/putting-the-control-on-a-web-page-atl-tutorial-part-7.md
+++ b/docs/atl/putting-the-control-on-a-web-page-atl-tutorial-part-7.md
@@ -15,30 +15,30 @@ In this step, you add functionality to the control and script the Web page to re
### To add control features
-1. Open PolyCtl.cpp and replace the following code:
-
- ```cpp
- if (PtInRegion(hRgn, xPos, yPos))
- Fire_ClickIn(xPos, yPos);
- else
- Fire_ClickOut(xPos, yPos);
- ```
-
- with
-
- ```cpp
- short temp = m_nSides;
- if (PtInRegion(hRgn, xPos, yPos))
- {
- Fire_ClickIn(xPos, yPos);
- put_Sides(++temp);
- }
- else
- {
- Fire_ClickOut(xPos, yPos);
- put_Sides(--temp);
- }
- ```
+Open PolyCtl.cpp and replace the following code:
+
+```cpp
+if (PtInRegion(hRgn, xPos, yPos))
+ Fire_ClickIn(xPos, yPos);
+else
+ Fire_ClickOut(xPos, yPos);
+```
+
+with
+
+```cpp
+short temp = m_nSides;
+if (PtInRegion(hRgn, xPos, yPos))
+{
+ Fire_ClickIn(xPos, yPos);
+ put_Sides(++temp);
+}
+else
+{
+ Fire_ClickOut(xPos, yPos);
+ put_Sides(--temp);
+}
+```
The shape will now add or remove sides depending on where you click.
diff --git a/docs/atl/reference/atl-classes.md b/docs/atl/reference/atl-classes.md
index 7d62887623..36a3ed3f0d 100644
--- a/docs/atl/reference/atl-classes.md
+++ b/docs/atl/reference/atl-classes.md
@@ -1,9 +1,8 @@
---
description: "Learn more about: ATL classes and structs"
-title: "ATL classes and structs| Microsoft Docs"
+title: ATL classes and structs
ms.date: "05/03/2018"
helpviewer_keywords: ["classes [C++], ATL", "ATL, classes"]
-ms.assetid: 7da42e2d-ac84-4506-92bd-502a86d68bdc
---
# ATL classes and structs
@@ -11,211 +10,211 @@ The Active Template Library (ATL) includes the following classes and structs. To
|Class / struct|Description|Header file|
|-----------|-----------------|-----------------|
-|[ATL_DRAWINFO](../../atl/reference/atl-drawinfo-structure.md)|Contains information used for rendering to various targets, such as a printer, metafile, or ActiveX control.|atlctl.h|
-|[_AtlCreateWndData](../../atl/reference/atlcreatewnddata-structure.md)|Contains class instance data in windowing code in ATL.|atlbase.h|
-|[_ATL_BASE_MODULE70](../../atl/reference/atl-base-module70-structure.md)|Used by any project that uses ATL.|atlbase.h|
-|[_ATL_COM_MODULE70](../../atl/reference/atl-com-module70-structure.md)|Used by COM-related code in ATL.| atlbase.h|
-|[_ATL_FUNC_INFO](../../atl/reference/atl-func-info-structure.md)|Contains type information used to describe a method or property on a dispinterface.|atlcom.h|
-|[_ATL_MODULE70](../../atl/reference/atl-module70-structure.md)|Contains data used by every ATL module.|atlbase.h|
-|[_ATL_WIN_MODULE70](../../atl/reference/atl-win-module70-structure.md)|Used by windowing code in ATL.|atlbase.h|
-|[CA2AEX](../../atl/reference/ca2aex-class.md)|This class is used by the string conversion macros CA2TEX and CT2AEX, and the typedef CA2A.|atlconv.h|
-|[CA2CAEX](../../atl/reference/ca2caex-class.md)|This class is used by string conversion macros CA2CTEX and CT2CAEX, and the typedef CA2CA.|atlconv.h|
-|[CA2WEX](../../atl/reference/ca2wex-class.md)|This class is used by the string conversion macros CA2TEX, CA2CTEX, CT2WEX, and CT2CWEX, and the typedef CA2W.|atlconv.h|
-|[CAccessToken](../../atl/reference/caccesstoken-class.md)|This class is a wrapper for an access token.|atlsecurity.h|
-|[CAcl](../../atl/reference/cacl-class.md)|This class is a wrapper for an ACL (access-control list) structure.|atlsecurity.h|
-|[CAdapt](../../atl/reference/cadapt-class.md)|This template is used to wrap classes that redefine the address-of operator to return something other than the address of the object.|atlcomcli.h|
-|[CAtlArray](../../atl/reference/catlarray-class.md)|This class implements an array object.|atlcoll.h|
-|[CAtlAutoThreadModule](../../atl/reference/catlautothreadmodule-class.md)|This class implements a thread-pooled, apartment-model COM server.|atlbase.h|
-|[CAtlAutoThreadModuleT](../../atl/reference/catlautothreadmodulet-class.md)|This class provides methods for implementing a thread-pooled, apartment-model COM server.|atlbase.h|
-|[CAtlBaseModule](../../atl/reference/catlbasemodule-class.md)|This class is instantiated in every ATL project.|atlcore.h|
-|[CAtlComModule](../../atl/reference/catlcommodule-class.md)|This class implements a COM server module.|atlbase.h|
-|[CAtlDebugInterfacesModule](../../atl/reference/catldebuginterfacesmodule-class.md)|This class provides support for debugging interfaces.|atlbase.h|
-|[CAtlDllModuleT](../../atl/reference/catldllmodulet-class.md)|This class represents the module for a DLL.|atlbase.h|
-|[CAtlException](../../atl/reference/catlexception-class.md)|This class defines an ATL exception.|atlexcept.h|
-|[CAtlExeModuleT](../../atl/reference/catlexemodulet-class.md)|This class represents the module for an application.|atlbase.h|
-|[CAtlFile](../../atl/reference/catlfile-class.md)|This class provides a thin wrapper around the Windows file-handling API.|atlfile.h|
-|[CAtlFileMapping](../../atl/reference/catlfilemapping-class.md)|This class represents a memory-mapped file, adding a cast operator to the methods of [CAtlFileMappingBase](../../atl/reference/catlfilemappingbase-class.md).|atlfile.h|
-|[CAtlFileMappingBase](../../atl/reference/catlfilemappingbase-class.md)|This class represents a memory-mapped file.|atlfile.h|
-|[CAtlList](../../atl/reference/catllist-class.md)|This class provides methods for creating and managing a list object.|atlcoll.h|
-|[CAtlMap](../../atl/reference/catlmap-class.md)|This class provides methods for creating and managing a map object.|atlcoll.h|
-|[CAtlModule](../../atl/reference/catlmodule-class.md)|This class provides methods used by several ATL module classes.|atlbase.h|
-|[CAtlModuleT](../../atl/reference/catlmodulet-class.md)|This class implements an ATL module.|atlbase.h|
-|[CAtlPreviewCtrlImpl](../../atl/reference/catlpreviewctrlimpl-class.md)|This class is an ATL implementation of a window that is placed on a host window provided by the Shell for Rich Preview.|atlpreviewctrlimpl.h|
-|[CAtlServiceModuleT](../../atl/reference/catlservicemodulet-class.md)|This class implements a service.|atlbase.h|
-|[CAtlTemporaryFile](../../atl/reference/catltemporaryfile-class.md)|This class provides methods for the creation and use of a temporary file.|atlfile.h|
-|[CAtlTransactionManager](../../atl/reference/catltransactionmanager-class.md)|This class provides a wrapper to Kernel Transaction Manager (KTM) functions.|atltransactionmanager.h|
-|[CAtlWinModule](../../atl/reference/catlwinmodule-class.md)|This class provides support for ATL windowing components.|atlbase.h|
-|[CAutoPtr](../../atl/reference/cautoptr-class.md)|This class represents a smart pointer object.|atlbase.h|
-|[CAutoPtrArray](../../atl/reference/cautoptrarray-class.md)|This class provides methods useful when constructing an array of smart pointers.|atlbase.h|
-|[CAutoPtrElementTraits](../../atl/reference/cautoptrelementtraits-class.md)|This class provides methods, static functions, and typedefs useful when creating collections of smart pointers.|atlcoll.h|
-|[CAutoPtrList](../../atl/reference/cautoptrlist-class.md)|This class provides methods useful when constructing a list of smart pointers.|atlcoll.h|
-|[CAutoVectorPtr](../../atl/reference/cautovectorptr-class.md)|This class represents a smart pointer object using vector new and delete operators.|atlbase.h|
-|[CAutoVectorPtrElementTraits](../../atl/reference/cautovectorptrelementtraits-class.md)|This class provides methods, static functions, and typedefs useful when creating collections of smart pointers using vector new and delete operators.|atlcoll.h|
-|[CAxDialogImpl](../../atl/reference/caxdialogimpl-class.md)|This class implements a dialog box (modal or modeless) that hosts ActiveX controls.|atlwin.h|
-|[CAxWindow](../../atl/reference/caxwindow-class.md)|This class provides methods for manipulating a window hosting an ActiveX control.|atlwin.h|
-|[CAxWindow2T](../../atl/reference/caxwindow2t-class.md)|This class provides methods for manipulating a window that hosts an ActiveX control and also has support for hosting licensed ActiveX controls.|atlwin.h|
-|[CBindStatusCallback](../../atl/reference/cbindstatuscallback-class.md)|This class implements the `IBindStatusCallback` interface.|atlctl.h|
-|[CComAggObject](../../atl/reference/ccomaggobject-class.md)|This class implements [IUnknown](/windows/win32/api/unknwn/nn-unknwn-iunknown) for an aggregated object.|atlcom.h|
-|[CComAllocator](../../atl/reference/ccomallocator-class.md)|This class provides methods for managing memory using COM memory routines.|atlbase.h|
-|[CComApartment](../../atl/reference/ccomapartment-class.md)|This class provides support for managing an apartment in a thread-pooled EXE module.|atlbase.h|
-|[CComAutoCriticalSection](../../atl/reference/ccomautocriticalsection-class.md)|This class provides methods for obtaining and releasing ownership of a critical section object.|atlcore.h|
-|[CComAutoThreadModule](../../atl/reference/ccomautothreadmodule-class.md)|As of ATL 7.0, `CComAutoThreadModule` is obsolete: see [ATL Modules](../../atl/atl-module-classes.md) for more details.|atlbase.h|
-|[CComBSTR](../../atl/reference/ccombstr-class.md)|This class is a wrapper for BSTRs.|atlbase.h|
-|[CComCachedTearOffObject](../../atl/reference/ccomcachedtearoffobject-class.md)|This class implements [IUnknown](/windows/win32/api/unknwn/nn-unknwn-iunknown) for a tear-off interface.|atlcom.h|
-|[CComClassFactory](../../atl/reference/ccomclassfactory-class.md)|This class implements the [IClassFactory](/windows/win32/api/unknwnbase/nn-unknwnbase-iclassfactory) interface.|atlcom.h|
-|[CComClassFactory2](../../atl/reference/ccomclassfactory2-class.md)|This class implements the [IClassFactory2](/windows/win32/api/ocidl/nn-ocidl-iclassfactory2) interface.|atlcom.h|
-|[CComClassFactoryAutoThread](../../atl/reference/ccomclassfactoryautothread-class.md)|This class implements the [IClassFactory](/windows/win32/api/unknwnbase/nn-unknwnbase-iclassfactory) interface and allows objects to be created in multiple apartments.|atlcom.h|
-|[CComClassFactorySingleton](../../atl/reference/ccomclassfactorysingleton-class.md)|This class derives from [CComClassFactory](../../atl/reference/ccomclassfactory-class.md) and uses [CComObjectGlobal](../../atl/reference/ccomobjectglobal-class.md) to construct a single object.|atlcom.h|
-|[CComCoClass](../../atl/reference/ccomcoclass-class.md)|This class provides methods for creating instances of a class and obtaining its properties.|atlcom.h|
-|[CComCompositeControl](../../atl/reference/ccomcompositecontrol-class.md)|This class provides the methods required to implement a composite control.|atlctl.h|
-|[CComContainedObject](../../atl/reference/ccomcontainedobject-class.md)|This class implements [IUnknown](/windows/win32/api/unknwn/nn-unknwn-iunknown) by delegating to the owner object's `IUnknown`.|atlcom.h|
-|[CComControl](../../atl/reference/ccomcontrol-class.md)|This class provides methods for creating and managing ATL controls.|atlctl.h|
-|[CComControlBase](../../atl/reference/ccomcontrolbase-class.md)|This class provides methods for creating and managing ATL controls.|atlctl.h|
-|[CComCriticalSection](../../atl/reference/ccomcriticalsection-class.md)|This class provides methods for obtaining and releasing ownership of a critical section object.|atlcore.h|
-|[CComCritSecLock](../../atl/reference/ccomcritseclock-class.md)|This class provides methods for locking and unlocking a critical section object.|atlbase.h|
-|[CComCurrency](../../atl/reference/ccomcurrency-class.md)|This class has methods and operators for creating and managing a CURRENCY object.|atlcur.h|
-|[CComDynamicUnkArray](../../atl/reference/ccomdynamicunkarray-class.md)|This class stores an array of `IUnknown` pointers.|atlcom.h|
-|[CComEnum](../../atl/reference/ccomenum-class.md)|This class defines a COM enumerator object based on an array.|atlcom.h|
-|[CComEnumImpl](../../atl/reference/ccomenumimpl-class.md)|This class provides the implementation for a COM enumerator interface where the items being enumerated are stored in an array.|atlcom.h|
-|[CComEnumOnSTL](../../atl/reference/ccomenumonstl-class.md)|This class defines a COM enumerator object based on a C++ Standard Library collection.|atlcom.h|
-|[CComFakeCriticalSection](../../atl/reference/ccomfakecriticalsection-class.md)|This class provides the same methods as [CComCriticalSection](../../atl/reference/ccomcriticalsection-class.md) but does not provide a critical section.|atlcore.h|
-|[CComGITPtr](../../atl/reference/ccomgitptr-class.md)|This class provides methods for dealing with interface pointers and the global interface table (GIT).|atlbase.h|
-|[CComHeap](../../atl/reference/ccomheap-class.md)|This class implements [IAtlMemMgr](../../atl/reference/iatlmemmgr-class.md) using the COM memory allocation functions.|ATLComMem.h|
-|[CComHeapPtr](../../atl/reference/ccomheapptr-class.md)|A smart pointer class for managing heap pointers.|atlbase.h|
-|[CComModule](../../atl/reference/ccommodule-class.md)|As of ATL 7.0, `CComModule` is obsolete: see [ATL Modules](../../atl/atl-module-classes.md) for more details.|atlbase.h|
-|[CComMultiThreadModel](../../atl/reference/ccommultithreadmodel-class.md)|This class provides thread-safe methods for incrementing and decrementing the value of a variable.|atlbase.h|
-|[CComMultiThreadModelNoCS](../../atl/reference/ccommultithreadmodelnocs-class.md)|This class provides thread-safe methods for incrementing and decrementing the value of a variable, without critical section locking or unlocking functionality.|atlbase.h|
-|[CComObject](../../atl/reference/ccomobject-class.md)|This class implements `IUnknown` for a nonaggregated object.|atlcom.h|
-|[CComObjectGlobal](../../atl/reference/ccomobjectglobal-class.md)|This class manages a reference count on the module containing your `Base` object.|atlcom.h|
-|[CComObjectNoLock](../../atl/reference/ccomobjectnolock-class.md)|This class implements `IUnknown` for a nonaggregated object, but does not increment the module lock count in the constructor.|atlcom.h|
-|[CComObjectRoot](../../atl/reference/ccomobjectroot-class.md)|This typedef of [CComObjectRootEx](../../atl/reference/ccomobjectrootex-class.md) is templatized on the default threading model of the server.|atlcom.h|
-|[CComObjectRootEx](../../atl/reference/ccomobjectrootex-class.md)|This class provides methods to handle object reference count management for both nonaggregated and aggregated objects.|atlcom.h|
-|[CComObjectStack](../../atl/reference/ccomobjectstack-class.md)|This class creates a temporary COM object and provides it with a skeletal implementation of `IUnknown`.|atlcom.h|
-|[CComPolyObject](../../atl/reference/ccompolyobject-class.md)|This class implements `IUnknown` for an aggregated or nonaggregated object.|atlcom.h|
-|[CComPtr](../../atl/reference/ccomptr-class.md)|A smart pointer class for managing COM interface pointers.|atlcomcli.h|
-|[CComPtrBase](../../atl/reference/ccomptrbase-class.md)|This class provides a basis for smart pointer classes using COM-based memory routines.|atlcomcli.h|
-|[CComQIPtr](../../atl/reference/ccomqiptr-class.md)|A smart pointer class for managing COM interface pointers.|atlcomcli.h|
-|[CComQIPtrElementTraits](../../atl/reference/ccomqiptrelementtraits-class.md)|This class provides methods, static functions, and typedefs useful when creating collections of COM interface pointers.|atlcoll.h|
-|[CComSafeArray](../../atl/reference/ccomsafearray-class.md)|This class is a wrapper for the `SAFEARRAY Data Type` structure.|atlsafe.h|
-|[CComSafeArrayBound](../../atl/reference/ccomsafearraybound-class.md)|This class is a wrapper for a `SAFEARRAYBOUND` structure.|atlsafe.h|
-|[CComSimpleThreadAllocator](../../atl/reference/ccomsimplethreadallocator-class.md)|This class manages thread selection for the class [CComAutoThreadModule](../../atl/reference/ccomautothreadmodule-class.md).|atlbase.h|
-|[CComSingleThreadModel](../../atl/reference/ccomsinglethreadmodel-class.md)|This class provides methods for incrementing and decrementing the value of a variable.|atlbase.h|
-|[CComTearOffObject](../../atl/reference/ccomtearoffobject-class.md)|This class implements a tear-off interface.|atlcom.h|
-|[CComUnkArray](../../atl/reference/ccomunkarray-class.md)|This class stores `IUnknown` pointers and is designed to be used as a parameter to the [IConnectionPointImpl](../../atl/reference/iconnectionpointimpl-class.md) template class.|atlcom.h|
-|[CComVariant](../../atl/reference/ccomvariant-class.md)|This class wraps the VARIANT type, providing a member indicating the type of data stored.|atlcomcli.h|
-|[CContainedWindowT](../../atl/reference/ccontainedwindowt-class.md)|This class implements a window contained within another object.|atlwin.h|
-|[CCRTAllocator](../../atl/reference/ccrtallocator-class.md)|This class provides methods for managing memory using CRT memory routines.|atlcore.h|
-|[CCRTHeap](../../atl/reference/ccrtheap-class.md)|This class implements [IAtlMemMgr](../../atl/reference/iatlmemmgr-class.md) using the CRT heap functions.|atlmem.h|
-|[CDacl](../../atl/reference/cdacl-class.md)|This class is a wrapper for a DACL (discretionary access-control list) structure.|atlsecurity.h|
-|[CDebugReportHook Class](../../atl/reference/cdebugreporthook-class.md)|Use this class to send debug reports to a named pipe.|atlutil.h|
-|[CDefaultCharTraits](../../atl/reference/cdefaultchartraits-class.md)|This class provides two static functions for converting characters between uppercase and lowercase.|atlcoll.h|
-|[CDefaultCompareTraits](../../atl/reference/cdefaultcomparetraits-class.md)|This class provides default element comparison functions.|atlcoll.h|
-|[CDefaultElementTraits](../../atl/reference/cdefaultelementtraits-class.md)|This class provides default methods and functions for a collection class.|atlcoll.h|
-|[CDefaultHashTraits](../../atl/reference/cdefaulthashtraits-class.md)|This class provides a static function for calculating hash values.|atlcoll.h|
-|[CDialogImpl](../../atl/reference/cdialogimpl-class.md)|This class provides methods for creating a modal or modeless dialog box.|atlwin.h|
-|[CDynamicChain](../../atl/reference/cdynamicchain-class.md)|This class provides methods supporting the dynamic chaining of message maps.|atlwin.h|
-|[CElementTraits](../../atl/reference/celementtraits-class.md)|This class is used by collection classes to provide methods and functions for moving, copying, comparison, and hashing operations.|atlcoll.h|
-|[CElementTraitsBase](../../atl/reference/celementtraitsbase-class.md)|This class provides default copy and move methods for a collection class.|atlcoll.h|
-|[CFirePropNotifyEvent](../../atl/reference/cfirepropnotifyevent-class.md)|This class provides methods for notifying the container's sink regarding control property changes.|atlctl.h|
-|[CGlobalHeap](../../atl/reference/cglobalheap-class.md)|This class implements [IAtlMemMgr](../../atl/reference/iatlmemmgr-class.md) using the Win32 global heap functions.|atlmem.h|
-|[CHandle](../../atl/reference/chandle-class.md)|This class provides methods for creating and using a handle object.|atlbase.h|
-|[CHeapPtr](../../atl/reference/cheapptr-class.md)|A smart pointer class for managing heap pointers.|atlcore.h|
-|[CHeapPtrBase](../../atl/reference/cheapptrbase-class.md)|This class forms the basis for several smart heap pointer classes.|atlcore.h|
-|[CHeapPtrElementTraits Class](../../atl/reference/cheapptrelementtraits-class.md)|This class provides methods, static functions, and typedefs useful when creating collections of heap pointers.|atlcoll.h|
-|[CHeapPtrList](../../atl/reference/cheapptrlist-class.md)|This class provides methods useful when constructing a list of heap pointers.|atlcoll.h|
-|[CImage](../../atl-mfc-shared/reference/cimage-class.md)|Provides enhanced bitmap support, including the ability to load and save images in JPEG, GIF, BMP, and Portable Network Graphics (PNG) formats.|atlimage.h|
-|[CInterfaceArray](../../atl/reference/cinterfacearray-class.md)|This class provides methods useful when constructing an array of COM interface pointers.|atlcoll.h|
-|[CInterfaceList](../../atl/reference/cinterfacelist-class.md)|This class provides methods useful when constructing a list of COM interface pointers.|atlcoll.h|
-|[CLocalHeap](../../atl/reference/clocalheap-class.md)|This class implements [IAtlMemMgr](../../atl/reference/iatlmemmgr-class.md) using the Win32 local heap functions.|atlmem.h|
-|[CMessageMap](../../atl/reference/cmessagemap-class.md)|This class allows an object's message maps to be accessed by another object.|atlwin.h|
-|[CNonStatelessWorker Class](../../atl/reference/cnonstatelessworker-class.md)|Receives requests from a thread pool and passes them on to a worker object that is created and destroyed on each request.|atlutil.h|
-|[CNoWorkerThread Class](../../atl/reference/cnoworkerthread-class.md)|Use this class as the argument for the `MonitorClass` template parameter cache classes if you want to disable dynamic cache maintenance.|atlutil.h|
-|[CPathT Class](../../atl/reference/cpatht-class.md)|This class represents a path.|atlpath.h|
-|[CPrimitiveElementTraits](../../atl/reference/cprimitiveelementtraits-class.md)|This class provides default methods and functions for a collection class composed of primitive data types.|atlcoll.h|
-|[CPrivateObjectSecurityDesc](../../atl/reference/cprivateobjectsecuritydesc-class.md)|This class represents a private object security descriptor object.|atlsecurity.h|
-|[CRBMap](../../atl/reference/crbmap-class.md)|This class represents a mapping structure, using a Red-Black binary tree.|atlcoll.h|
-|[CRBMultiMap](../../atl/reference/crbmultimap-class.md)|This class represents a mapping structure that allows each key to be associated with more than one value, using a Red-Black binary tree.|atlcoll.h|
-|[CRBTree](../../atl/reference/crbtree-class.md)|This class provides methods for creating and utilizing a Red-Black tree.|atlcoll.h|
-|[CRegKey](../../atl/reference/cregkey-class.md)|This class provides methods for manipulating entries in the system registry.|atlbase.h|
-|[CRTThreadTraits](../../atl/reference/crtthreadtraits-class.md)|This class provides the creation function for a CRT thread. Use this class if the thread will use CRT functions.|atlbase.h|
-|[CSacl](../../atl/reference/csacl-class.md)|This class is a wrapper for a SACL (system access-control list) structure.|atlsecurity.h|
-|[CSecurityAttributes](../../atl/reference/csecurityattributes-class.md)|This class is a thin wrapper for the `SECURITY_ATTRIBUTES` structure.|atlsecurity.h|
-|[CSecurityDesc](../../atl/reference/csecuritydesc-class.md)|This class is a wrapper for the `SECURITY_DESCRIPTOR` structure.|atlsecurity.h|
-|[CSid](../../atl/reference/csid-class.md)|This class is a wrapper for a `SID` (security identifier) structure.|atlsecurity.h|
-|[CSimpleArray](../../atl/reference/csimplearray-class.md)|This class provides methods for managing a simple array.|atlsimpcoll.h|
-|[CSimpleArrayEqualHelper](../../atl/reference/csimplearrayequalhelper-class.md)|This class is a helper for the [CSimpleArray](../../atl/reference/csimplearray-class.md) class.|atlsimpcoll.h|
-|[CSimpleArrayEqualHelperFalse](../../atl/reference/csimplearrayequalhelperfalse-class.md)|This class is a helper for the [CSimpleArray](../../atl/reference/csimplearray-class.md) class.|atlsimpcoll.h|
-|[CSimpleDialog](../../atl/reference/csimpledialog-class.md)|This class implements a basic modal dialog box.|atlwin.h|
-|[CSimpleMap](../../atl/reference/csimplemap-class.md)|This class provides support for a simple mapping array.|atlsimpcoll.h|
-|[CSimpleMapEqualHelper](../../atl/reference/csimplemapequalhelper-class.md)|This class is a helper for the [CSimpleMap](../../atl/reference/csimplemap-class.md) class.|atlsimpcoll.h|
-|[CSimpleMapEqualHelperFalse](../../atl/reference/csimplemapequalhelperfalse-class.md)|This class is a helper for the [CSimpleMap](../../atl/reference/csimplemap-class.md) class.|atlsimpcoll.h|
-|[CSnapInItemImpl](../../atl/reference/csnapinitemimpl-class.md)|This class provides methods for implementing a snap-in node object.|atlsnap.h|
-|[CSnapInPropertyPageImpl](../../atl/reference/csnapinpropertypageimpl-class.md)|This class provides methods for implementing a snap-in property page object.|atlsnap.h|
-|[CStockPropImpl](../../atl/reference/cstockpropimpl-class.md)|This class provides methods for supporting stock property values.|atlctl.h|
-|[CStringElementTraits](../../atl/reference/cstringelementtraits-class.md)|This class provides static functions used by collection classes storing `CString` objects.|cstringt.h|
-|[CStringElementTraitsI](../../atl/reference/cstringelementtraitsi-class.md)|This class provides static functions related to strings stored in collection class objects. It is similar to [CStringElementTraits](../../atl/reference/cstringelementtraits-class.md), but performs case-insensitive comparisons.|atlcoll.h|
-|[CStringRefElementTraits](../../atl/reference/cstringrefelementtraits-class.md)|This class provides static functions related to strings stored in collection class objects. The string objects are dealt with as references.|atlcoll.h|
-|[CThreadPool Class](../../atl/reference/cthreadpool-class.md)|This class provides a pool of worker threads that process a queue of work items.|atlutil.h|
-|[CTokenGroups](../../atl/reference/ctokengroups-class.md)|This class is a wrapper for the `TOKEN_GROUPS` structure.|atlsecurity.h|
-|[CTokenPrivileges](../../atl/reference/ctokenprivileges-class.md)|This class is a wrapper for the `TOKEN_PRIVILEGES` structure.|atlsecurity.h|
-|[CUrl Class](../../atl/reference/curl-class.md)|This class represents a URL. It allows you to manipulate each element of the URL independently of the others whether parsing an existing URL string or building a string from scratch.|atlutil.h|
-|[CW2AEX](../../atl/reference/cw2aex-class.md)|This class is used by the string conversion macros CT2AEX, CW2TEX, CW2CTEX, and CT2CAEX, and the typedef CW2A.|atlconv.h|
-|[CW2CWEX](../../atl/reference/cw2cwex-class.md)|This class is used by the string conversion macros CW2CTEX and CT2CWEX, and the typedef CW2CW.|atlconv.h|
-|[CW2WEX](../../atl/reference/cw2wex-class.md)|This class is used by the string conversion macros CW2TEX and CT2WEX, and the typedef CW2W.|atlconv.h|
-|[CWin32Heap](../../atl/reference/cwin32heap-class.md)|This class implements [IAtlMemMgr](../../atl/reference/iatlmemmgr-class.md) using the Win32 heap allocation functions.|atlmem.h|
-|[CWindow](../../atl/reference/cwindow-class.md)|This class provides methods for manipulating a window.|atlwin.h|
-|[CWindowImpl](../../atl/reference/cwindowimpl-class.md)|This class provides methods for creating or subclassing a window.|atlwin.h|
-|[CWinTraits](../../atl/reference/cwintraits-class.md)|This class provides a method for standardizing the styles used when creating a window object.|atlwin.h|
-|[CWinTraitsOR](../../atl/reference/cwintraitsor-class.md)|This class provides a method for standardizing the styles used when creating a window object.|atlwin.h|
-|[CWndClassInfo](../../atl/reference/cwndclassinfo-class.md)|This class provides methods for registering information for a window class.|atlwin.h|
-|[CWorkerThread Class](../../atl/reference/cworkerthread-class.md)|This class creates a worker thread or uses an existing one, waits on one or more kernel object handles, and executes a specified client function when one of the handles is signaled.|atlutil.h|
-|[IAtlAutoThreadModule](../../atl/reference/iatlautothreadmodule-class.md)|This class represents an interface to a `CreateInstance` method.|atlbase.h|
-|[IAtlMemMgr](../../atl/reference/iatlmemmgr-class.md)|This class represents the interface to a memory manager.|atlmem.h|
-|[IAxWinAmbientDispatch](../../atl/reference/iaxwinambientdispatch-interface.md)|This interface provides methods for specifying characteristics of the hosted control or container.|atlbase.h, ATLIFace.h|
-|[IAxWinAmbientDispatchEx](../../atl/reference/iaxwinambientdispatchex-interface.md)|This interface implements supplemental ambient properties for a hosted control.|atlbase.h, ATLIFace.h|
-|[IAxWinHostWindow](../../atl/reference/iaxwinhostwindow-interface.md)|This interface provides methods for manipulating a control and its host object.|atlbase.h, ATLIFace.h|
-|[IAxWinHostWindowLic](../../atl/reference/iaxwinhostwindowlic-interface.md)|This interface provides methods for manipulating a licensed control and its host object.|atlbase.h, ATLIFace.h|
-|[ICollectionOnSTLImpl](../../atl/reference/icollectiononstlimpl-class.md)|This class provides methods used by a collection class.|atlcom.h|
-|[IConnectionPointContainerImpl](../../atl/reference/iconnectionpointcontainerimpl-class.md)|This class implements a connection point container to manage a collection of [IConnectionPointImpl](../../atl/reference/iconnectionpointimpl-class.md) objects.|atlcom.h|
-|[IConnectionPointImpl](../../atl/reference/iconnectionpointimpl-class.md)|This class implements a connection point.|atlcom.h|
-|[IDataObjectImpl](../../atl/reference/idataobjectimpl-class.md)|This class provides methods for supporting Uniform Data Transfer and managing connections.|atlctl.h|
-|[IDispatchImpl](../../atl/reference/idispatchimpl-class.md)|This class provides a default implementation for the `IDispatch` portion of a dual interface.|atlcom.h|
-|[IDispEventImpl](../../atl/reference/idispeventimpl-class.md)|This class provides implementations of the `IDispatch` methods.|atlcom.h|
-|[IDispEventSimpleImpl](../../atl/reference/idispeventsimpleimpl-class.md)|This class provides implementations of the `IDispatch` methods, without getting type information from a type library.|atlcom.h|
-|[IDocHostUIHandlerDispatch](../../atl/reference/idochostuihandlerdispatch-interface.md)|An interface to the Microsoft HTML parsing and rendering engine.|atlbase.h, ATLIFace.h|
-|[IEnumOnSTLImpl](../../atl/reference/ienumonstlimpl-class.md)|This class defines an enumerator interface based on a C++ Standard Library collection.|atlcom.h|
-|[IObjectSafetyImpl](../../atl/reference/iobjectsafetyimpl-class.md)|This class provides a default implementation of the `IObjectSafety` interface to allow a client to retrieve and set an object's safety levels.|atlctl.h|
-|[IObjectWithSiteImpl](../../atl/reference/iobjectwithsiteimpl-class.md)|This class provides methods allowing an object to communicate with its site.|atlcom.h|
-|[IOleControlImpl](../../atl/reference/iolecontrolimpl-class.md)|This class provides a default implementation of the `IOleControl` interface and implements `IUnknown`.|atlctl.h|
-|[IOleInPlaceActiveObjectImpl](../../atl/reference/ioleinplaceactiveobjectimpl-class.md)|This class provides methods for assisting communication between an in-place control and its container.|atlctl.h|
-|[IOleInPlaceObjectWindowlessImpl](../../atl/reference/ioleinplaceobjectwindowlessimpl-class.md)|This class implements `IUnknown` and provides methods that enable a windowless control to receive window messages and to participate in drag-and-drop operations.|atlctl.h|
-|[IOleObjectImpl](../../atl/reference/ioleobjectimpl-class.md)|This class implements `IUnknown` and is the principal interface through which a container communicates with a control.|atlctl.h|
-|[IPerPropertyBrowsingImpl](../../atl/reference/iperpropertybrowsingimpl-class.md)|This class implements `IUnknown` and allows a client to access the information in an object's property pages.|atlctl.h|
-|[IPersistPropertyBagImpl](../../atl/reference/ipersistpropertybagimpl-class.md)|This class implements `IUnknown` and allows an object to save its properties to a client-supplied property bag.|atlcom.h|
-|[IPersistStorageImpl](../../atl/reference/ipersiststorageimpl-class.md)|This class implements the [IPersistStorage](/windows/win32/api/objidl/nn-objidl-ipersiststorage) interface.|atlcom.h|
-|[IPersistStreamInitImpl](../../atl/reference/ipersiststreaminitimpl-class.md)|This class implements `IUnknown` and provides a default implementation of the [IPersistStreamInit](/windows/win32/api/ocidl/nn-ocidl-ipersiststreaminit) interface.|atlcom.h|
-|[IPointerInactiveImpl](../../atl/reference/ipointerinactiveimpl-class.md)|This class implements `IUnknown` and the [IPointerInactive](/windows/win32/api/ocidl/nn-ocidl-ipointerinactive) interface methods.|atlctl.h|
-|[IPropertyNotifySinkCP](../../atl/reference/ipropertynotifysinkcp-class.md)|This class exposes the [IPropertyNotifySink](/windows/win32/api/ocidl/nn-ocidl-ipropertynotifysink) interface as an outgoing interface on a connectable object.|atlctl.h|
-|[IPropertyPage2Impl](../../atl/reference/ipropertypage2impl-class.md)|This class implements `IUnknown` and inherits the default implementation of [IPropertyPageImpl](../../atl/reference/ipropertypageimpl-class.md).|atlctl.h|
-|[IPropertyPageImpl](../../atl/reference/ipropertypageimpl-class.md)|This class implements `IUnknown` and provides a default implementation of the [IPropertyPage](/windows/win32/api/ocidl/nn-ocidl-ipropertypage) interface.|atlctl.h|
-|[IProvideClassInfo2Impl](../../atl/reference/iprovideclassinfo2impl-class.md)|This class provides a default implementation of the [IProvideClassInfo](/windows/win32/api/ocidl/nn-ocidl-iprovideclassinfo) and [IProvideClassInfo2](/windows/win32/api/ocidl/nn-ocidl-iprovideclassinfo2) methods.|atlcom.h|
-|[IQuickActivateImpl](../../atl/reference/iquickactivateimpl-class.md)|This class combines containers' control initialization into a single call.|atlctl.h|
-|[IRunnableObjectImpl](../../atl/reference/irunnableobjectimpl-class.md)|This class implements `IUnknown` and provides a default implementation of the [IRunnableObject](/windows/win32/api/objidl/nn-objidl-irunnableobject) interface.|atlctl.h|
-|[IServiceProviderImpl](../../atl/reference/iserviceproviderimpl-class.md)|This class provides a default implementation of the `IServiceProvider` interface.|atlcom.h|
-|[ISpecifyPropertyPagesImpl](../../atl/reference/ispecifypropertypagesimpl-class.md)|This class implements `IUnknown` and provides a default implementation of the [ISpecifyPropertyPages](/windows/win32/api/ocidl/nn-ocidl-ispecifypropertypages) interface.|atlcom.h|
-|[ISupportErrorInfoImpl](../../atl/reference/isupporterrorinfoimpl-class.md)|This class provides a default implementation of the `ISupportErrorInfo Interface` interface and can be used when only a single interface generates errors on an object.|atlcom.h|
-|[IThreadPoolConfig Interface](../../atl/reference/ithreadpoolconfig-interface.md)|This interface provides methods for configuring a thread pool.|atlutil.h|
-|[IViewObjectExImpl](../../atl/reference/iviewobjecteximpl-class.md)|This class implements `IUnknown` and provides default implementations of the [IViewObject](/windows/win32/api/oleidl/nn-oleidl-iviewobject), [IViewObject2](/windows/win32/api/oleidl/nn-oleidl-iviewobject2), and [IViewObjectEx](/windows/win32/api/ocidl/nn-ocidl-iviewobjectex) interfaces.|atlctl.h|
-|[IWorkerThreadClient Interface](../../atl/reference/iworkerthreadclient-interface.md)|`IWorkerThreadClient` is the interface implemented by clients of the [CWorkerThread](../../atl/reference/cworkerthread-class.md) class.|atlutil.h|
-|[_U_MENUorID](../../atl/reference/u-menuorid-class.md)|This class provides wrappers for `CreateWindow` and `CreateWindowEx`.|atlwin.h|
-|[_U_RECT](../../atl/reference/u-rect-class.md)|This argument adapter class allows either `RECT` pointers or references to be passed to a function that is implemented in terms of pointers.|atlwin.h|
-|[_U_STRINGorID](../../atl/reference/u-stringorid-class.md)|This argument adapter class allows either resource names (LPCTSTRs) or resource IDs (UINTs) to be passed to a function without requiring the caller to convert the ID to a string using the MAKEINTRESOURCE macro.|atlwin.h|
-|[Win32ThreadTraits](../../atl/reference/win32threadtraits-class.md)|This class provides the creation function for a Windows thread. Use this class if the thread will not use CRT functions.|atlbase.h|
+|[`ATL_DRAWINFO`](../../atl/reference/atl-drawinfo-structure.md)|Contains information used for rendering to various targets, such as a printer, metafile, or ActiveX control.|`atlctl.h`|
+|[`_AtlCreateWndData`](../../atl/reference/atlcreatewnddata-structure.md)|Contains class instance data in windowing code in ATL.|`atlbase.h`|
+|[`_ATL_BASE_MODULE70`](../../atl/reference/atl-base-module70-structure.md)|Used by any project that uses ATL.|`atlbase.h`|
+|[`_ATL_COM_MODULE70`](../../atl/reference/atl-com-module70-structure.md)|Used by COM-related code in ATL.| `atlbase.h`|
+|[`_ATL_FUNC_INFO`](../../atl/reference/atl-func-info-structure.md)|Contains type information used to describe a method or property on a dispinterface.|`atlcom.h`|
+|[`_ATL_MODULE70`](../../atl/reference/atl-module70-structure.md)|Contains data used by every ATL module.|`atlbase.h`|
+|[`_ATL_WIN_MODULE70`](../../atl/reference/atl-win-module70-structure.md)|Used by windowing code in ATL.|`atlbase.h`|
+|[`CA2AEX`](../../atl/reference/ca2aex-class.md)|This class is used by the string conversion macros `CA2TEX` and `CT2AEX`, and the typedef `CA2A`.|`atlconv.h`|
+|[`CA2CAEX`](../../atl/reference/ca2caex-class.md)|This class is used by string conversion macros `CA2CTEX` and `CT2CAEX`, and the typedef `CA2CA`.|`atlconv.h`|
+|[`CA2WEX`](../../atl/reference/ca2wex-class.md)|This class is used by the string conversion macros `CA2TEX`, `CA2CTEX`, `CT2WEX`, and `CT2CWEX`, and the typedef `CA2W`.|`atlconv.h`|
+|[`CAccessToken`](../../atl/reference/caccesstoken-class.md)|This class is a wrapper for an access token.|`atlsecurity.h`|
+|[`CAcl`](../../atl/reference/cacl-class.md)|This class is a wrapper for an ACL (access-control list) structure.|`atlsecurity.h`|
+|[`CAdapt`](../../atl/reference/cadapt-class.md)|This template is used to wrap classes that redefine the address-of operator to return something other than the address of the object.|`atlcomcli.h`|
+|[`CAtlArray`](../../atl/reference/catlarray-class.md)|This class implements an array object.|`atlcoll.h`|
+|[`CAtlAutoThreadModule`](../../atl/reference/catlautothreadmodule-class.md)|This class implements a thread-pooled, apartment-model COM server.|`atlbase.h`|
+|[`CAtlAutoThreadModuleT`](../../atl/reference/catlautothreadmodulet-class.md)|This class provides methods for implementing a thread-pooled, apartment-model COM server.|`atlbase.h`|
+|[`CAtlBaseModule`](../../atl/reference/catlbasemodule-class.md)|This class is instantiated in every ATL project.|`atlcore.h`|
+|[`CAtlComModule`](../../atl/reference/catlcommodule-class.md)|This class implements a COM server module.|`atlbase.h`|
+|[`CAtlDebugInterfacesModule`](../../atl/reference/catldebuginterfacesmodule-class.md)|This class provides support for debugging interfaces.|`atlbase.h`|
+|[`CAtlDllModuleT`](../../atl/reference/catldllmodulet-class.md)|This class represents the module for a DLL.|`atlbase.h`|
+|[`CAtlException`](../../atl/reference/catlexception-class.md)|This class defines an ATL exception.|`atlexcept.h`|
+|[`CAtlExeModuleT`](../../atl/reference/catlexemodulet-class.md)|This class represents the module for an application.|`atlbase.h`|
+|[`CAtlFile`](../../atl/reference/catlfile-class.md)|This class provides a thin wrapper around the Windows file-handling API.|`atlfile.h`|
+|[`CAtlFileMapping`](../../atl/reference/catlfilemapping-class.md)|This class represents a memory-mapped file, adding a cast operator to the methods of [`CAtlFileMappingBase`](../../atl/reference/catlfilemappingbase-class.md).|`atlfile.h`|
+|[`CAtlFileMappingBase`](../../atl/reference/catlfilemappingbase-class.md)|This class represents a memory-mapped file.|`atlfile.h`|
+|[`CAtlList`](../../atl/reference/catllist-class.md)|This class provides methods for creating and managing a list object.|`atlcoll.h`|
+|[`CAtlMap`](../../atl/reference/catlmap-class.md)|This class provides methods for creating and managing a map object.|`atlcoll.h`|
+|[`CAtlModule`](../../atl/reference/catlmodule-class.md)|This class provides methods used by several ATL module classes.|`atlbase.h`|
+|[`CAtlModuleT`](../../atl/reference/catlmodulet-class.md)|This class implements an ATL module.|`atlbase.h`|
+|[`CAtlPreviewCtrlImpl`](../../atl/reference/catlpreviewctrlimpl-class.md)|This class is an ATL implementation of a window that is placed on a host window provided by the Shell for Rich Preview.|`atlpreviewctrlimpl`.h|
+|[`CAtlServiceModuleT`](../../atl/reference/catlservicemodulet-class.md)|This class implements a service.|`atlbase.h`|
+|[`CAtlTemporaryFile`](../../atl/reference/catltemporaryfile-class.md)|This class provides methods for the creation and use of a temporary file.|`atlfile.h`|
+|[`CAtlTransactionManager`](../../atl/reference/catltransactionmanager-class.md)|This class provides a wrapper to Kernel Transaction Manager (KTM) functions.|`atltransactionmanager`.h|
+|[`CAtlWinModule`](../../atl/reference/catlwinmodule-class.md)|This class provides support for ATL windowing components.|`atlbase.h`|
+|[`CAutoPtr`](../../atl/reference/cautoptr-class.md)|This class represents a smart pointer object.|`atlbase.h`|
+|[`CAutoPtrArray`](../../atl/reference/cautoptrarray-class.md)|This class provides methods useful when constructing an array of smart pointers.|`atlbase.h`|
+|[`CAutoPtrElementTraits`](../../atl/reference/cautoptrelementtraits-class.md)|This class provides methods, static functions, and typedefs useful when creating collections of smart pointers.|`atlcoll.h`|
+|[`CAutoPtrList`](../../atl/reference/cautoptrlist-class.md)|This class provides methods useful when constructing a list of smart pointers.|`atlcoll.h`|
+|[`CAutoVectorPtr`](../../atl/reference/cautovectorptr-class.md)|This class represents a smart pointer object using vector new and delete operators.|`atlbase.h`|
+|[`CAutoVectorPtrElementTraits`](../../atl/reference/cautovectorptrelementtraits-class.md)|This class provides methods, static functions, and typedefs useful when creating collections of smart pointers using vector new and delete operators.|`atlcoll.h`|
+|[`CAxDialogImpl`](../../atl/reference/caxdialogimpl-class.md)|This class implements a dialog box (modal or modeless) that hosts ActiveX controls.|`atlwin.h`|
+|[`CAxWindow`](../../atl/reference/caxwindow-class.md)|This class provides methods for manipulating a window hosting an ActiveX control.|`atlwin.h`|
+|[`CAxWindow2T`](../../atl/reference/caxwindow2t-class.md)|This class provides methods for manipulating a window that hosts an ActiveX control and also has support for hosting licensed ActiveX controls.|`atlwin.h`|
+|[`CBindStatusCallback`](../../atl/reference/cbindstatuscallback-class.md)|This class implements the `IBindStatusCallback` interface.|`atlctl.h`|
+|[`CComAggObject`](../../atl/reference/ccomaggobject-class.md)|This class implements [`IUnknown`](/windows/win32/api/unknwn/nn-unknwn-iunknown) for an aggregated object.|`atlcom.h`|
+|[`CComAllocator`](../../atl/reference/ccomallocator-class.md)|This class provides methods for managing memory using COM memory routines.|`atlbase.h`|
+|[`CComApartment`](../../atl/reference/ccomapartment-class.md)|This class provides support for managing an apartment in a thread-pooled EXE module.|`atlbase.h`|
+|[`CComAutoCriticalSection`](../../atl/reference/ccomautocriticalsection-class.md)|This class provides methods for obtaining and releasing ownership of a critical section object.|`atlcore.h`|
+|[`CComAutoThreadModule`](../../atl/reference/ccomautothreadmodule-class.md)|As of ATL 7.0, `CComAutoThreadModule` is obsolete: see [ATL Modules](../../atl/atl-module-classes.md) for more details.|`atlbase.h`|
+|[`CComBSTR`](../../atl/reference/ccombstr-class.md)|This class is a wrapper for BSTRs.|`atlbase.h`|
+|[`CComCachedTearOffObject`](../../atl/reference/ccomcachedtearoffobject-class.md)|This class implements [`IUnknown`](/windows/win32/api/unknwn/nn-unknwn-iunknown) for a tear-off interface.|`atlcom.h`|
+|[`CComClassFactory`](../../atl/reference/ccomclassfactory-class.md)|This class implements the [`IClassFactory`](/windows/win32/api/unknwnbase/nn-unknwnbase-iclassfactory) interface.|`atlcom.h`|
+|[`CComClassFactory2`](../../atl/reference/ccomclassfactory2-class.md)|This class implements the [`IClassFactory2`](/windows/win32/api/ocidl/nn-ocidl-iclassfactory2) interface.|`atlcom.h`|
+|[`CComClassFactoryAutoThread`](../../atl/reference/ccomclassfactoryautothread-class.md)|This class implements the [`IClassFactory`](/windows/win32/api/unknwnbase/nn-unknwnbase-iclassfactory) interface and allows objects to be created in multiple apartments.|`atlcom.h`|
+|[`CComClassFactorySingleton`](../../atl/reference/ccomclassfactorysingleton-class.md)|This class derives from [`CComClassFactory`](../../atl/reference/ccomclassfactory-class.md) and uses [`CComObjectGlobal`](../../atl/reference/ccomobjectglobal-class.md) to construct a single object.|`atlcom.h`|
+|[`CComCoClass`](../../atl/reference/ccomcoclass-class.md)|This class provides methods for creating instances of a class and obtaining its properties.|`atlcom.h`|
+|[`CComCompositeControl`](../../atl/reference/ccomcompositecontrol-class.md)|This class provides the methods required to implement a composite control.|`atlctl.h`|
+|[`CComContainedObject`](../../atl/reference/ccomcontainedobject-class.md)|This class implements [`IUnknown`](/windows/win32/api/unknwn/nn-unknwn-iunknown) by delegating to the owner object's `IUnknown`.|`atlcom.h`|
+|[`CComControl`](../../atl/reference/ccomcontrol-class.md)|This class provides methods for creating and managing ATL controls.|`atlctl.h`|
+|[`CComControlBase`](../../atl/reference/ccomcontrolbase-class.md)|This class provides methods for creating and managing ATL controls.|`atlctl.h`|
+|[`CComCriticalSection`](../../atl/reference/ccomcriticalsection-class.md)|This class provides methods for obtaining and releasing ownership of a critical section object.|`atlcore.h`|
+|[`CComCritSecLock`](../../atl/reference/ccomcritseclock-class.md)|This class provides methods for locking and unlocking a critical section object.|`atlbase.h`|
+|[`CComCurrency`](../../atl/reference/ccomcurrency-class.md)|This class has methods and operators for creating and managing a `CURRENCY` object.|`atlcur.h`|
+|[`CComDynamicUnkArray`](../../atl/reference/ccomdynamicunkarray-class.md)|This class stores an array of `IUnknown` pointers.|`atlcom.h`|
+|[`CComEnum`](../../atl/reference/ccomenum-class.md)|This class defines a COM enumerator object based on an array.|`atlcom.h`|
+|[`CComEnumImpl`](../../atl/reference/ccomenumimpl-class.md)|This class provides the implementation for a COM enumerator interface where the items being enumerated are stored in an array.|`atlcom.h`|
+|[`CComEnumOnSTL`](../../atl/reference/ccomenumonstl-class.md)|This class defines a COM enumerator object based on a C++ Standard Library collection.|`atlcom.h`|
+|[`CComFakeCriticalSection`](../../atl/reference/ccomfakecriticalsection-class.md)|This class provides the same methods as [`CComCriticalSection`](../../atl/reference/ccomcriticalsection-class.md) but doesn't provide a critical section.|`atlcore.h`|
+|[`CComGITPtr`](../../atl/reference/ccomgitptr-class.md)|This class provides methods for dealing with interface pointers and the global interface table (GIT).|`atlbase.h`|
+|[`CComHeap`](../../atl/reference/ccomheap-class.md)|This class implements [`IAtlMemMgr`](../../atl/reference/iatlmemmgr-class.md) using the COM memory allocation functions.|`ATLComMem.h`|
+|[`CComHeapPtr`](../../atl/reference/ccomheapptr-class.md)|A smart pointer class for managing heap pointers.|`atlbase.h`|
+|[`CComModule`](../../atl/reference/ccommodule-class.md)|As of ATL 7.0, `CComModule` is obsolete: see [ATL Modules](../../atl/atl-module-classes.md) for more details.|`atlbase.h`|
+|[`CComMultiThreadModel`](../../atl/reference/ccommultithreadmodel-class.md)|This class provides thread-safe methods for incrementing and decrementing the value of a variable.|`atlbase.h`|
+|[`CComMultiThreadModelNoCS`](../../atl/reference/ccommultithreadmodelnocs-class.md)|This class provides thread-safe methods for incrementing and decrementing the value of a variable, without critical section locking or unlocking functionality.|`atlbase.h`|
+|[`CComObject`](../../atl/reference/ccomobject-class.md)|This class implements `IUnknown` for a nonaggregated object.|`atlcom.h`|
+|[`CComObjectGlobal`](../../atl/reference/ccomobjectglobal-class.md)|This class manages a reference count on the module containing your `Base` object.|`atlcom.h`|
+|[`CComObjectNoLock`](../../atl/reference/ccomobjectnolock-class.md)|This class implements `IUnknown` for a nonaggregated object, but doesn't increment the module lock count in the constructor.|`atlcom.h`|
+|[`CComObjectRoot`](../../atl/reference/ccomobjectroot-class.md)|This typedef of [`CComObjectRootEx`](../../atl/reference/ccomobjectrootex-class.md) is templatized on the default threading model of the server.|`atlcom.h`|
+|[`CComObjectRootEx`](../../atl/reference/ccomobjectrootex-class.md)|This class provides methods to handle object reference count management for both nonaggregated and aggregated objects.|`atlcom.h`|
+|[`CComObjectStack`](../../atl/reference/ccomobjectstack-class.md)|This class creates a temporary COM object and provides it with a skeletal implementation of `IUnknown`.|`atlcom.h`|
+|[`CComPolyObject`](../../atl/reference/ccompolyobject-class.md)|This class implements `IUnknown` for an aggregated or nonaggregated object.|`atlcom.h`|
+|[`CComPtr`](../../atl/reference/ccomptr-class.md)|A smart pointer class for managing COM interface pointers.|`atlcomcli.h`|
+|[`CComPtrBase`](../../atl/reference/ccomptrbase-class.md)|This class provides a basis for smart pointer classes using COM-based memory routines.|`atlcomcli.h`|
+|[`CComQIPtr`](../../atl/reference/ccomqiptr-class.md)|A smart pointer class for managing COM interface pointers.|`atlcomcli.h`|
+|[`CComQIPtrElementTraits`](../../atl/reference/ccomqiptrelementtraits-class.md)|This class provides methods, static functions, and typedefs useful when creating collections of COM interface pointers.|`atlcoll.h`|
+|[`CComSafeArray`](../../atl/reference/ccomsafearray-class.md)|This class is a wrapper for the `SAFEARRAY Data Type` structure.|`atlsafe.h`|
+|[`CComSafeArrayBound`](../../atl/reference/ccomsafearraybound-class.md)|This class is a wrapper for a `SAFEARRAYBOUND` structure.|`atlsafe.h`|
+|[`CComSimpleThreadAllocator`](../../atl/reference/ccomsimplethreadallocator-class.md)|This class manages thread selection for the class [`CComAutoThreadModule`](../../atl/reference/ccomautothreadmodule-class.md).|`atlbase.h`|
+|[`CComSingleThreadModel`](../../atl/reference/ccomsinglethreadmodel-class.md)|This class provides methods for incrementing and decrementing the value of a variable.|`atlbase.h`|
+|[`CComTearOffObject`](../../atl/reference/ccomtearoffobject-class.md)|This class implements a tear-off interface.|`atlcom.h`|
+|[`CComUnkArray`](../../atl/reference/ccomunkarray-class.md)|This class stores `IUnknown` pointers and is designed to be used as a parameter to the [`IConnectionPointImpl`](../../atl/reference/iconnectionpointimpl-class.md) template class.|`atlcom.h`|
+|[`CComVariant`](../../atl/reference/ccomvariant-class.md)|This class wraps the `VARIANT` type, providing a member indicating the type of data stored.|`atlcomcli.h`|
+|[`CContainedWindowT`](../../atl/reference/ccontainedwindowt-class.md)|This class implements a window contained within another object.|`atlwin.h`|
+|[`CCRTAllocator`](../../atl/reference/ccrtallocator-class.md)|This class provides methods for managing memory using CRT memory routines.|`atlcore.h`|
+|[`CCRTHeap`](../../atl/reference/ccrtheap-class.md)|This class implements [`IAtlMemMgr`](../../atl/reference/iatlmemmgr-class.md) using the CRT heap functions.|`atlmem.h`|
+|[`CDacl`](../../atl/reference/cdacl-class.md)|This class is a wrapper for a DACL (discretionary access-control list) structure.|`atlsecurity.h`|
+|[`CDebugReportHook` Class](../../atl/reference/cdebugreporthook-class.md)|Use this class to send debug reports to a named pipe.|`atlutil.h`|
+|[`CDefaultCharTraits`](../../atl/reference/cdefaultchartraits-class.md)|This class provides two static functions for converting characters between uppercase and lowercase.|`atlcoll.h`|
+|[`CDefaultCompareTraits`](../../atl/reference/cdefaultcomparetraits-class.md)|This class provides default element comparison functions.|`atlcoll.h`|
+|[`CDefaultElementTraits`](../../atl/reference/cdefaultelementtraits-class.md)|This class provides default methods and functions for a collection class.|`atlcoll.h`|
+|[`CDefaultHashTraits`](../../atl/reference/cdefaulthashtraits-class.md)|This class provides a static function for calculating hash values.|`atlcoll.h`|
+|[`CDialogImpl`](../../atl/reference/cdialogimpl-class.md)|This class provides methods for creating a modal or modeless dialog box.|`atlwin.h`|
+|[`CDynamicChain`](../../atl/reference/cdynamicchain-class.md)|This class provides methods supporting the dynamic chaining of message maps.|`atlwin.h`|
+|[`CElementTraits`](../../atl/reference/celementtraits-class.md)|This class is used by collection classes to provide methods and functions for moving, copying, comparison, and hashing operations.|`atlcoll.h`|
+|[`CElementTraitsBase`](../../atl/reference/celementtraitsbase-class.md)|This class provides default copy and move methods for a collection class.|`atlcoll.h`|
+|[`CFirePropNotifyEvent`](../../atl/reference/cfirepropnotifyevent-class.md)|This class provides methods for notifying the container's sink regarding control property changes.|`atlctl.h`|
+|[`CGlobalHeap`](../../atl/reference/cglobalheap-class.md)|This class implements [`IAtlMemMgr`](../../atl/reference/iatlmemmgr-class.md) using the Win32 global heap functions.|`atlmem.h`|
+|[`CHandle`](../../atl/reference/chandle-class.md)|This class provides methods for creating and using a handle object.|`atlbase.h`|
+|[`CHeapPtr`](../../atl/reference/cheapptr-class.md)|A smart pointer class for managing heap pointers.|`atlcore.h`|
+|[`CHeapPtrBase`](../../atl/reference/cheapptrbase-class.md)|This class forms the basis for several smart heap pointer classes.|`atlcore.h`|
+|[`CHeapPtrElementTraits` Class](../../atl/reference/cheapptrelementtraits-class.md)|This class provides methods, static functions, and typedefs useful when creating collections of heap pointers.|`atlcoll.h`|
+|[`CHeapPtrList`](../../atl/reference/cheapptrlist-class.md)|This class provides methods useful when constructing a list of heap pointers.|`atlcoll.h`|
+|[`CImage`](../../atl-mfc-shared/reference/cimage-class.md)|Provides enhanced bitmap support, including the ability to load and save images in JPEG, GIF, BMP, and Portable Network Graphics (PNG) formats.|`atlimage.h`|
+|[`CInterfaceArray`](../../atl/reference/cinterfacearray-class.md)|This class provides methods useful when constructing an array of COM interface pointers.|`atlcoll.h`|
+|[`CInterfaceList`](../../atl/reference/cinterfacelist-class.md)|This class provides methods useful when constructing a list of COM interface pointers.|`atlcoll.h`|
+|[`CLocalHeap`](../../atl/reference/clocalheap-class.md)|This class implements [`IAtlMemMgr`](../../atl/reference/iatlmemmgr-class.md) using the Win32 local heap functions.|`atlmem.h`|
+|[`CMessageMap`](../../atl/reference/cmessagemap-class.md)|This class allows an object's message maps to be accessed by another object.|`atlwin.h`|
+|[`CNonStatelessWorker` Class](../../atl/reference/cnonstatelessworker-class.md)|Receives requests from a thread pool and passes them on to a worker object that is created and destroyed on each request.|`atlutil.h`|
+|[`CNoWorkerThread` Class](../../atl/reference/cnoworkerthread-class.md)|Use this class as the argument for the `MonitorClass` template parameter cache classes if you want to disable dynamic cache maintenance.|`atlutil.h`|
+|[`CPathT` Class](../../atl/reference/cpatht-class.md)|This class represents a path.|`atlpath.h`|
+|[`CPrimitiveElementTraits`](../../atl/reference/cprimitiveelementtraits-class.md)|This class provides default methods and functions for a collection class composed of primitive data types.|`atlcoll.h`|
+|[`CPrivateObjectSecurityDesc`](../../atl/reference/cprivateobjectsecuritydesc-class.md)|This class represents a private object security descriptor object.|`atlsecurity.h`|
+|[`CRBMap`](../../atl/reference/crbmap-class.md)|This class represents a mapping structure, using a Red-Black binary tree.|`atlcoll.h`|
+|[`CRBMultiMap`](../../atl/reference/crbmultimap-class.md)|This class represents a mapping structure that allows each key to be associated with more than one value, using a Red-Black binary tree.|`atlcoll.h`|
+|[`CRBTree`](../../atl/reference/crbtree-class.md)|This class provides methods for creating and utilizing a Red-Black tree.|`atlcoll.h`|
+|[`CRegKey`](../../atl/reference/cregkey-class.md)|This class provides methods for manipulating entries in the system registry.|`atlbase.h`|
+|[`CRTThreadTraits`](../../atl/reference/crtthreadtraits-class.md)|This class provides the creation function for a CRT thread. Use this class if the thread will use CRT functions.|`atlbase.h`|
+|[`CSacl`](../../atl/reference/csacl-class.md)|This class is a wrapper for a SACL (system access-control list) structure.|`atlsecurity.h`|
+|[`CSecurityAttributes`](../../atl/reference/csecurityattributes-class.md)|This class is a thin wrapper for the `SECURITY_ATTRIBUTES` structure.|`atlsecurity.h`|
+|[`CSecurityDesc`](../../atl/reference/csecuritydesc-class.md)|This class is a wrapper for the `SECURITY_DESCRIPTOR` structure.|`atlsecurity.h`|
+|[`CSid`](../../atl/reference/csid-class.md)|This class is a wrapper for a `SID` (security identifier) structure.|`atlsecurity.h`|
+|[`CSimpleArray`](../../atl/reference/csimplearray-class.md)|This class provides methods for managing a simple array.|`atlsimpcoll.h`|
+|[`CSimpleArrayEqualHelper`](../../atl/reference/csimplearrayequalhelper-class.md)|This class is a helper for the [`CSimpleArray`](../../atl/reference/csimplearray-class.md) class.|`atlsimpcoll.h`|
+|[`CSimpleArrayEqualHelperFalse`](../../atl/reference/csimplearrayequalhelperfalse-class.md)|This class is a helper for the [`CSimpleArray`](../../atl/reference/csimplearray-class.md) class.|`atlsimpcoll.h`|
+|[`CSimpleDialog`](../../atl/reference/csimpledialog-class.md)|This class implements a basic modal dialog box.|`atlwin.h`|
+|[`CSimpleMap`](../../atl/reference/csimplemap-class.md)|This class provides support for a simple mapping array.|`atlsimpcoll.h`|
+|[`CSimpleMapEqualHelper`](../../atl/reference/csimplemapequalhelper-class.md)|This class is a helper for the [`CSimpleMap`](../../atl/reference/csimplemap-class.md) class.|`atlsimpcoll.h`|
+|[`CSimpleMapEqualHelperFalse`](../../atl/reference/csimplemapequalhelperfalse-class.md)|This class is a helper for the [`CSimpleMap`](../../atl/reference/csimplemap-class.md) class.|`atlsimpcoll.h`|
+|[`CSnapInItemImpl`](../../atl/reference/csnapinitemimpl-class.md)|This class provides methods for implementing a snap-in node object.|`atlsnap.h`|
+|[`CSnapInPropertyPageImpl`](../../atl/reference/csnapinpropertypageimpl-class.md)|This class provides methods for implementing a snap-in property page object.|`atlsnap.h`|
+|[`CStockPropImpl`](../../atl/reference/cstockpropimpl-class.md)|This class provides methods for supporting stock property values.|`atlctl.h`|
+|[`CStringElementTraits`](../../atl/reference/cstringelementtraits-class.md)|This class provides static functions used by collection classes storing `CString` objects.|`cstringt`.h|
+|[`CStringElementTraitsI`](../../atl/reference/cstringelementtraitsi-class.md)|This class provides static functions related to strings stored in collection class objects. It's similar to [`CStringElementTraits`](../../atl/reference/cstringelementtraits-class.md), but performs case-insensitive comparisons.|`atlcoll.h`|
+|[`CStringRefElementTraits`](../../atl/reference/cstringrefelementtraits-class.md)|This class provides static functions related to strings stored in collection class objects. The string objects are dealt with as references.|`atlcoll.h`|
+|[`CThreadPool` Class](../../atl/reference/cthreadpool-class.md)|This class provides a pool of worker threads that process a queue of work items.|`atlutil.h`|
+|[`CTokenGroups`](../../atl/reference/ctokengroups-class.md)|This class is a wrapper for the `TOKEN_GROUPS` structure.|`atlsecurity.h`|
+|[`CTokenPrivileges`](../../atl/reference/ctokenprivileges-class.md)|This class is a wrapper for the `TOKEN_PRIVILEGES` structure.|`atlsecurity.h`|
+|[`CUrl` Class](../../atl/reference/curl-class.md)|This class represents a URL. It allows you to manipulate each element of the URL independently of the others whether parsing an existing URL string or building a string from scratch.|`atlutil.h`|
+|[`CW2AEX`](../../atl/reference/cw2aex-class.md)|This class is used by the string conversion macros `CT2AEX`, `CW2TEX`, `CW2CTEX`, and `CT2CAEX`, and the typedef `CW2A`.|`atlconv.h`|
+|[`CW2CWEX`](../../atl/reference/cw2cwex-class.md)|This class is used by the string conversion macros `CW2CTEX` and `CT2CWEX`, and the typedef `CW2CW`.|`atlconv.h`|
+|[`CW2WEX`](../../atl/reference/cw2wex-class.md)|This class is used by the string conversion macros `CW2TEX` and `CT2WEX`, and the typedef `CW2W`.|`atlconv.h`|
+|[`CWin32Heap`](../../atl/reference/cwin32heap-class.md)|This class implements [`IAtlMemMgr`](../../atl/reference/iatlmemmgr-class.md) using the Win32 heap allocation functions.|`atlmem.h`|
+|[`CWindow`](../../atl/reference/cwindow-class.md)|This class provides methods for manipulating a window.|`atlwin.h`|
+|[`CWindowImpl`](../../atl/reference/cwindowimpl-class.md)|This class provides methods for creating or subclassing a window.|`atlwin.h`|
+|[`CWinTraits`](../../atl/reference/cwintraits-class.md)|This class provides a method for standardizing the styles used when creating a window object.|`atlwin.h`|
+|[`CWinTraitsOR`](../../atl/reference/cwintraitsor-class.md)|This class provides a method for standardizing the styles used when creating a window object.|`atlwin.h`|
+|[`CWndClassInfo`](../../atl/reference/cwndclassinfo-class.md)|This class provides methods for registering information for a window class.|`atlwin.h`|
+|[`CWorkerThread` Class](../../atl/reference/cworkerthread-class.md)|This class creates a worker thread or uses an existing one, waits on one or more kernel object handles, and executes a specified client function when one of the handles is signaled.|`atlutil.h`|
+|[`IAtlAutoThreadModule`](../../atl/reference/iatlautothreadmodule-class.md)|This class represents an interface to a `CreateInstance` method.|`atlbase.h`|
+|[`IAtlMemMgr`](../../atl/reference/iatlmemmgr-class.md)|This class represents the interface to a memory manager.|`atlmem.h`|
+|[`IAxWinAmbientDispatch`](../../atl/reference/iaxwinambientdispatch-interface.md)|This interface provides methods for specifying characteristics of the hosted control or container.|`atlbase.h`, `ATLIFace.h`|
+|[`IAxWinAmbientDispatchEx`](../../atl/reference/iaxwinambientdispatchex-interface.md)|This interface implements supplemental ambient properties for a hosted control.|`atlbase.h`, `ATLIFace.h`|
+|[`IAxWinHostWindow`](../../atl/reference/iaxwinhostwindow-interface.md)|This interface provides methods for manipulating a control and its host object.|`atlbase.h`, `ATLIFace.h`|
+|[`IAxWinHostWindowLic`](../../atl/reference/iaxwinhostwindowlic-interface.md)|This interface provides methods for manipulating a licensed control and its host object.|`atlbase.h`, `ATLIFace.h`|
+|[`ICollectionOnSTLImpl`](../../atl/reference/icollectiononstlimpl-class.md)|This class provides methods used by a collection class.|`atlcom.h`|
+|[`IConnectionPointContainerImpl`](../../atl/reference/iconnectionpointcontainerimpl-class.md)|This class implements a connection point container to manage a collection of [`IConnectionPointImpl`](../../atl/reference/iconnectionpointimpl-class.md) objects.|`atlcom.h`|
+|[`IConnectionPointImpl`](../../atl/reference/iconnectionpointimpl-class.md)|This class implements a connection point.|`atlcom.h`|
+|[`IDataObjectImpl`](../../atl/reference/idataobjectimpl-class.md)|This class provides methods for supporting Uniform Data Transfer and managing connections.|`atlctl.h`|
+|[`IDispatchImpl`](../../atl/reference/idispatchimpl-class.md)|This class provides a default implementation for the `IDispatch` portion of a dual interface.|`atlcom.h`|
+|[`IDispEventImpl`](../../atl/reference/idispeventimpl-class.md)|This class provides implementations of the `IDispatch` methods.|`atlcom.h`|
+|[`IDispEventSimpleImpl`](../../atl/reference/idispeventsimpleimpl-class.md)|This class provides implementations of the `IDispatch` methods, without getting type information from a type library.|`atlcom.h`|
+|[`IDocHostUIHandlerDispatch`](../../atl/reference/idochostuihandlerdispatch-interface.md)|An interface to the Microsoft HTML parsing and rendering engine.|`atlbase.h`, `ATLIFace.h`|
+|[`IEnumOnSTLImpl`](../../atl/reference/ienumonstlimpl-class.md)|This class defines an enumerator interface based on a C++ Standard Library collection.|`atlcom.h`|
+|[`IObjectSafetyImpl`](../../atl/reference/iobjectsafetyimpl-class.md)|This class provides a default implementation of the `IObjectSafety` interface to allow a client to retrieve and set an object's safety levels.|`atlctl.h`|
+|[`IObjectWithSiteImpl`](../../atl/reference/iobjectwithsiteimpl-class.md)|This class provides methods allowing an object to communicate with its site.|`atlcom.h`|
+|[`IOleControlImpl`](../../atl/reference/iolecontrolimpl-class.md)|This class provides a default implementation of the `IOleControl` interface and implements `IUnknown`.|`atlctl.h`|
+|[`IOleInPlaceActiveObjectImpl`](../../atl/reference/ioleinplaceactiveobjectimpl-class.md)|This class provides methods for assisting communication between an in-place control and its container.|`atlctl.h`|
+|[`IOleInPlaceObjectWindowlessImpl`](../../atl/reference/ioleinplaceobjectwindowlessimpl-class.md)|This class implements `IUnknown` and provides methods that enable a windowless control to receive window messages and to participate in drag-and-drop operations.|`atlctl.h`|
+|[`IOleObjectImpl`](../../atl/reference/ioleobjectimpl-class.md)|This class implements `IUnknown` and is the principal interface through which a container communicates with a control.|`atlctl.h`|
+|[`IPerPropertyBrowsingImpl`](../../atl/reference/iperpropertybrowsingimpl-class.md)|This class implements `IUnknown` and allows a client to access the information in an object's property pages.|`atlctl.h`|
+|[`IPersistPropertyBagImpl`](../../atl/reference/ipersistpropertybagimpl-class.md)|This class implements `IUnknown` and allows an object to save its properties to a client-supplied property bag.|`atlcom.h`|
+|[`IPersistStorageImpl`](../../atl/reference/ipersiststorageimpl-class.md)|This class implements the [`IPersistStorage`](/windows/win32/api/objidl/nn-objidl-ipersiststorage) interface.|`atlcom.h`|
+|[`IPersistStreamInitImpl`](../../atl/reference/ipersiststreaminitimpl-class.md)|This class implements `IUnknown` and provides a default implementation of the [`IPersistStreamInit`](/windows/win32/api/ocidl/nn-ocidl-ipersiststreaminit) interface.|`atlcom.h`|
+|[`IPointerInactiveImpl`](../../atl/reference/ipointerinactiveimpl-class.md)|This class implements `IUnknown` and the [`IPointerInactive`](/windows/win32/api/ocidl/nn-ocidl-ipointerinactive) interface methods.|`atlctl.h`|
+|[`IPropertyNotifySinkCP`](../../atl/reference/ipropertynotifysinkcp-class.md)|This class exposes the [`IPropertyNotifySink`](/windows/win32/api/ocidl/nn-ocidl-ipropertynotifysink) interface as an outgoing interface on a connectable object.|`atlctl.h`|
+|[`IPropertyPage2Impl`](../../atl/reference/ipropertypage2impl-class.md)|This class implements `IUnknown` and inherits the default implementation of [`IPropertyPageImpl`](../../atl/reference/ipropertypageimpl-class.md).|`atlctl.h`|
+|[`IPropertyPageImpl`](../../atl/reference/ipropertypageimpl-class.md)|This class implements `IUnknown` and provides a default implementation of the [`IPropertyPage`](/windows/win32/api/ocidl/nn-ocidl-ipropertypage) interface.|`atlctl.h`|
+|[`IProvideClassInfo2Impl`](../../atl/reference/iprovideclassinfo2impl-class.md)|This class provides a default implementation of the [`IProvideClassInfo`](/windows/win32/api/ocidl/nn-ocidl-iprovideclassinfo) and [`IProvideClassInfo2`](/windows/win32/api/ocidl/nn-ocidl-iprovideclassinfo2) methods.|`atlcom.h`|
+|[`IQuickActivateImpl`](../../atl/reference/iquickactivateimpl-class.md)|This class combines containers' control initialization into a single call.|`atlctl.h`|
+|[`IRunnableObjectImpl`](../../atl/reference/irunnableobjectimpl-class.md)|This class implements `IUnknown` and provides a default implementation of the [`IRunnableObject`](/windows/win32/api/objidl/nn-objidl-irunnableobject) interface.|`atlctl.h`|
+|[`IServiceProviderImpl`](../../atl/reference/iserviceproviderimpl-class.md)|This class provides a default implementation of the `IServiceProvider` interface.|`atlcom.h`|
+|[`ISpecifyPropertyPagesImpl`](../../atl/reference/ispecifypropertypagesimpl-class.md)|This class implements `IUnknown` and provides a default implementation of the [`ISpecifyPropertyPages`](/windows/win32/api/ocidl/nn-ocidl-ispecifypropertypages) interface.|`atlcom.h`|
+|[`ISupportErrorInfoImpl`](../../atl/reference/isupporterrorinfoimpl-class.md)|This class provides a default implementation of the `ISupportErrorInfo Interface` interface and can be used when only a single interface generates errors on an object.|`atlcom.h`|
+|[`IThreadPoolConfig` Interface](../../atl/reference/ithreadpoolconfig-interface.md)|This interface provides methods for configuring a thread pool.|`atlutil.h`|
+|[`IViewObjectExImpl`](../../atl/reference/iviewobjecteximpl-class.md)|This class implements `IUnknown` and provides default implementations of the [`IViewObject`](/windows/win32/api/oleidl/nn-oleidl-iviewobject), [`IViewObject2`](/windows/win32/api/oleidl/nn-oleidl-iviewobject2), and [`IViewObjectEx`](/windows/win32/api/ocidl/nn-ocidl-iviewobjectex) interfaces.|`atlctl.h`|
+|[`IWorkerThreadClient` Interface](../../atl/reference/iworkerthreadclient-interface.md)|`IWorkerThreadClient` is the interface implemented by clients of the [`CWorkerThread`](../../atl/reference/cworkerthread-class.md) class.|`atlutil.h`|
+|[`_U_MENUorID`](../../atl/reference/u-menuorid-class.md)|This class provides wrappers for `CreateWindow` and `CreateWindowEx`.|`atlwin.h`|
+|[`_U_RECT`](../../atl/reference/u-rect-class.md)|This argument adapter class allows either `RECT` pointers or references to be passed to a function that is implemented in terms of pointers.|`atlwin.h`|
+|[`_U_STRINGorID`](../../atl/reference/u-stringorid-class.md)|This argument adapter class allows either resource names (LPCTSTRs) or resource IDs (UINTs) to be passed to a function without requiring the caller to convert the ID to a string using the `MAKEINTRESOURCE` macro.|`atlwin.h`|
+|[`Win32ThreadTraits`](../../atl/reference/win32threadtraits-class.md)|This class provides the creation function for a Windows thread. Use this class if the thread won't use CRT functions.|`atlbase.h`|
## See also
-[ATL COM Desktop Components](../../atl/atl-com-desktop-components.md)
-[Functions](../../atl/reference/atl-functions.md)
-[Global Variables](../../atl/reference/atl-global-variables.md)
-[Typedefs](../../atl/reference/atl-typedefs.md)
+[ATL COM Desktop Components](../../atl/atl-com-desktop-components.md)\
+[Functions](../../atl/reference/atl-functions.md)\
+[Global Variables](../../atl/reference/atl-global-variables.md)\
+[Typedefs](../../atl/reference/atl-typedefs.md)\
[Class Overview](../../atl/atl-class-overview.md)
diff --git a/docs/atl/reference/category-macros.md b/docs/atl/reference/category-macros.md
index ecb6b7b4a5..2520af5960 100644
--- a/docs/atl/reference/category-macros.md
+++ b/docs/atl/reference/category-macros.md
@@ -2,7 +2,7 @@
description: "Learn more about: Category Macros"
title: "Category Macros"
ms.date: "11/04/2016"
-f1_keywords: ["atlcom/ATL::BEGIN_CATEGORY_MAP", "atlcom/ATL::END_CATEGORY_MAP", "atlcom/ATL::IMPLEMENTED_CATEGORY", "atlcom/ATL::REQUIRED_CATEGORY"]
+f1_keywords: ["ATLCOM/BEGIN_CATEGORY_MAP", "ATLCOM/END_CATEGORY_MAP", "ATLCOM/IMPLEMENTED_CATEGORY", "ATLCOM/REQUIRED_CATEGORY", "atlcom/ATL::BEGIN_CATEGORY_MAP", "atlcom/ATL::END_CATEGORY_MAP", "atlcom/ATL::IMPLEMENTED_CATEGORY", "atlcom/ATL::REQUIRED_CATEGORY"]
ms.assetid: 223578cb-6180-4787-a8d8-ba3787a5d3ee
---
# Category Macros
diff --git a/docs/atl/reference/catltemporaryfile-class.md b/docs/atl/reference/catltemporaryfile-class.md
index ac4ae6210e..9878d4a0d9 100644
--- a/docs/atl/reference/catltemporaryfile-class.md
+++ b/docs/atl/reference/catltemporaryfile-class.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: CAtlTemporaryFile Class"
title: "CAtlTemporaryFile Class"
-ms.date: "11/04/2016"
+description: "Learn more about: CAtlTemporaryFile Class"
+ms.date: 11/04/2016
f1_keywords: ["CAtlTemporaryFile", "ATLFILE/ATL::CAtlTemporaryFile", "ATLFILE/ATL::CAtlTemporaryFile::CAtlTemporaryFile", "ATLFILE/ATL::CAtlTemporaryFile::Close", "ATLFILE/ATL::CAtlTemporaryFile::Create", "ATLFILE/ATL::CAtlTemporaryFile::Flush", "ATLFILE/ATL::CAtlTemporaryFile::GetPosition", "ATLFILE/ATL::CAtlTemporaryFile::GetSize", "ATLFILE/ATL::CAtlTemporaryFile::HandsOff", "ATLFILE/ATL::CAtlTemporaryFile::HandsOn", "ATLFILE/ATL::CAtlTemporaryFile::LockRange", "ATLFILE/ATL::CAtlTemporaryFile::Read", "ATLFILE/ATL::CAtlTemporaryFile::Seek", "ATLFILE/ATL::CAtlTemporaryFile::SetSize", "ATLFILE/ATL::CAtlTemporaryFile::TempFileName", "ATLFILE/ATL::CAtlTemporaryFile::UnlockRange", "ATLFILE/ATL::CAtlTemporaryFile::Write"]
helpviewer_keywords: ["CAtlTemporaryFile class"]
-ms.assetid: 05f0f2a5-94f6-4594-8dae-b114292ff5f9
---
# CAtlTemporaryFile Class
@@ -357,7 +356,7 @@ Returns the LPCTSTR pointing to the file name.
### Remarks
-The file name is generated in [CAtlTemporaryFile::CAtlTemporaryFile](#catltemporaryfile) with a call to the [GetTempFile](/windows/win32/api/fileapi/nf-fileapi-gettempfilenamew)Windows SDK function. The file extension will always be "TFR" for the temporary file.
+The file name is generated in [CAtlTemporaryFile::CAtlTemporaryFile](#catltemporaryfile) with a call to the [GetTempFile](/windows/win32/api/fileapi/nf-fileapi-gettempfilenamew) Windows SDK function. The file extension will always be "TFR" for the temporary file.
## CAtlTemporaryFile::UnlockRange
diff --git a/docs/atl/reference/catltransactionmanager-class.md b/docs/atl/reference/catltransactionmanager-class.md
index 9a3cf494d6..3b7a42f274 100644
--- a/docs/atl/reference/catltransactionmanager-class.md
+++ b/docs/atl/reference/catltransactionmanager-class.md
@@ -165,7 +165,7 @@ inline HANDLE CreateFile(
The name of an object to be created or opened.
*dwDesiredAccess*
-The access to the object, which can be summarized as read, write, both, or neither (zero). The most commonly used values are GENERIC_READ, GENERIC_WRITE, or both: GENERIC_READ | GENERIC_WRITE.
+The access to the object, which can be summarized as read, write, both, or neither (zero). The most commonly used values are `GENERIC_READ`, `GENERIC_WRITE`, or both: `GENERIC_READ | GENERIC_WRITE`.
*dwShareMode*
The sharing mode of an object, which can be read, write, both, delete, all of these, or none: 0, FILE_SHARE_DELETE, FILE_SHARE_READ, FILE_SHARE_WRITE.
diff --git a/docs/atl/reference/caxwindow-class.md b/docs/atl/reference/caxwindow-class.md
index 4c266ad417..1817a66fc3 100644
--- a/docs/atl/reference/caxwindow-class.md
+++ b/docs/atl/reference/caxwindow-class.md
@@ -5,6 +5,12 @@ ms.date: "11/04/2016"
f1_keywords: ["CAxWindow", "ATLWIN/ATL::CAxWindow", "ATLWIN/ATL::AttachControl", "ATLWIN/ATL::CreateControl", "ATLWIN/ATL::CreateControlEx", "ATLWIN/ATL::GetWndClassName", "ATLWIN/ATL::QueryControl", "ATLWIN/ATL::QueryHost", "ATLWIN/ATL::SetExternalDispatch", "ATLWIN/ATL::SetExternalUIHandler"]
helpviewer_keywords: ["CAxWindow class", "ATL, hosting ActiveX controls"]
ms.assetid: 85e79261-43e4-4770-bde0-1ff87f222b0f
+api_type:
+- DllExport
+api_location:
+- atlhost.dll
+api_name:
+- CAxWindow::CreateControlEx
---
# CAxWindow Class
diff --git a/docs/atl/reference/ccomcoclass-class.md b/docs/atl/reference/ccomcoclass-class.md
index 1cea7aa58c..2101a31f89 100644
--- a/docs/atl/reference/ccomcoclass-class.md
+++ b/docs/atl/reference/ccomcoclass-class.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: CComCoClass Class"
title: "CComCoClass Class"
+description: "Learn more about: CComCoClass Class"
ms.date: "11/04/2016"
f1_keywords: ["CComCoClass", "ATLCOM/ATL::CComCoClass", "ATLCOM/ATL::CComCoClass::CreateInstance", "ATLCOM/ATL::CComCoClass::Error", "ATLCOM/ATL::CComCoClass::GetObjectCLSID", "ATLCOM/ATL::CComCoClass::GetObjectDescription"]
helpviewer_keywords: ["CComCoClass class", "aggregation [C++], aggregation models"]
-ms.assetid: 67cfefa4-8df9-47fa-ad58-2d1a1ae25762
---
# CComCoClass Class
@@ -12,29 +11,29 @@ This class provides methods for creating instances of a class, and obtaining its
## Syntax
-```
+```cpp
template
class CComCoClass
```
#### Parameters
-*T*
+*T*\
Your class, derived from `CComCoClass`.
-*pclsid*
+*pclsid*\
A pointer to the CLSID of the object.
## Members
### Public Methods
-|Name|Description|
-|----------|-----------------|
-|[CComCoClass::CreateInstance](#createinstance)|(Static) Creates an instance of the class and queries for an interface.|
-|[CComCoClass::Error](#error)|(Static) Returns rich error information to the client.|
-|[CComCoClass::GetObjectCLSID](#getobjectclsid)|(Static) Returns the object's class identifier.|
-|[CComCoClass::GetObjectDescription](#getobjectdescription)|(Static) Override to return the object's description.|
+| Name | Description |
+| ---------------------------------------------------------- | ----------------------------------------------------------------------- |
+| [CComCoClass::CreateInstance](#createinstance) | (Static) Creates an instance of the class and queries for an interface. |
+| [CComCoClass::Error](#error) | (Static) Returns rich error information to the client. |
+| [CComCoClass::GetObjectCLSID](#getobjectclsid) | (Static) Returns the object's class identifier. |
+| [CComCoClass::GetObjectDescription](#getobjectdescription) | (Static) Override to return the object's description. |
## Remarks
@@ -58,23 +57,23 @@ You can override either of these defaults by specifying another macro in your cl
Use these `CreateInstance` functions to create an instance of a COM object and retrieve an interface pointer without using the COM API.
-```
-template
-static HRESULT CreateInstance( Q** pp);
+```cpp
+template
+static HRESULT CreateInstance(Q** pp);
-template
+template
static HRESULT CreateInstance(IUnknown* punkOuter, Q** pp);
```
### Parameters
-*Q*
+*Q*\
The COM interface that should be returned via *pp*.
-*punkOuter*
+*punkOuter*\
[in] The outer unknown or controlling unknown of the aggregate.
-*pp*
+*pp*\
[out] The address of a pointer variable that receives the requested interface pointer if creation succeeds.
### Return Value
@@ -101,7 +100,7 @@ In the following example, `CDocument` is a wizard-generated ATL class derived fr
This static function sets up the `IErrorInfo` interface to provide error information to the client.
-```
+```cpp
static HRESULT WINAPI Error(
LPCOLESTR lpszDesc,
const IID& iid = GUID_NULL,
@@ -130,7 +129,7 @@ static HRESULT WINAPI Error(
UINT nID,
const IID& iid = GUID_NULL,
HRESULT hRes = 0,
- HINSTANCE hInst = _AtlBaseModule.GetResourceInstance ());
+ HINSTANCE hInst = _AtlBaseModule.GetResourceInstance());
static HRESULT Error(
UINT nID,
@@ -143,25 +142,25 @@ static HRESULT Error(
### Parameters
-*lpszDesc*
+*lpszDesc*\
[in] The string describing the error. The Unicode version of `Error` specifies that *lpszDesc* is of type LPCOLESTR; the ANSI version specifies a type of LPCSTR.
-*iid*
+*iid*\
[in] The IID of the interface defining the error or GUID_NULL (the default value) if the error is defined by the operating system.
-*hRes*
+*hRes*\
[in] The HRESULT you want returned to the caller. The default value is 0. For more details about *hRes*, see Remarks.
-*nID*
+*nID*\
[in] The resource identifier where the error description string is stored. This value should lie between 0x0200 and 0xFFFF, inclusively. In debug builds, an **ASSERT** will result if *nID* does not index a valid string. In release builds, the error description string will be set to "Unknown Error."
-*dwHelpID*
+*dwHelpID*\
[in] The help context identifier for the error.
-*lpszHelpFile*
+*lpszHelpFile*\
[in] The path and name of the help file describing the error.
-*hInst*
+*hInst*\
[in] The handle to the resource. By default, this parameter is `_AtlModule::GetResourceInstance`, where `_AtlModule` is the global instance of [CAtlModule](../../atl/reference/catlmodule-class.md).
### Return Value
@@ -170,7 +169,7 @@ A standard HRESULT value. For details, see Remarks.
### Remarks
-To call `Error`, your object must implement the `ISupportErrorInfo Interface` interface.
+To call `Error`, your object must implement the `ISupportErrorInfo` interface.
If the *hRes* parameter is nonzero, then `Error` returns the value of *hRes*. If *hRes* is zero, then the first four versions of `Error` return DISP_E_EXCEPTION. The last two versions return the result of the macro **MAKE_HRESULT( 1, FACILITY_ITF,** *nID* **)**.
@@ -178,7 +177,7 @@ If the *hRes* parameter is nonzero, then `Error` returns the value of *hRes*. If
Provides a consistent way of retrieving the object's CLSID.
-```
+```cpp
static const CLSID& WINAPI GetObjectCLSID();
```
@@ -190,7 +189,7 @@ The object's class identifier.
This static function retrieves the text description for your class object.
-```
+```cpp
static LPCTSTR WINAPI GetObjectDescription();
```
diff --git a/docs/atl/reference/ccomcontrolbase-class.md b/docs/atl/reference/ccomcontrolbase-class.md
index f6b457426f..f65f6c90ee 100644
--- a/docs/atl/reference/ccomcontrolbase-class.md
+++ b/docs/atl/reference/ccomcontrolbase-class.md
@@ -252,7 +252,7 @@ One of the standard HRESULT values.
### Example
[!code-cpp[NVC_ATL_COM#19](../../atl/codesnippet/cpp/ccomcontrolbase-class_2.cpp)]
-
+
[!code-cpp[NVC_ATL_COM#20](../../atl/codesnippet/cpp/ccomcontrolbase-class_3.h)]
## CComControlBase::FireViewChange
diff --git a/docs/atl/reference/ccomcurrency-class.md b/docs/atl/reference/ccomcurrency-class.md
index b51cb2e04a..cee7bfd016 100644
--- a/docs/atl/reference/ccomcurrency-class.md
+++ b/docs/atl/reference/ccomcurrency-class.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: CComCurrency Class"
title: "CComCurrency Class"
-ms.date: "11/04/2016"
+description: "Learn more about: CComCurrency Class"
+ms.date: 11/04/2016
f1_keywords: ["CComCurrency", "ATLCUR/ATL::CComCurrency", "ATLCUR/ATL::CComCurrency::CComCurrency", "ATLCUR/ATL::CComCurrency::GetCurrencyPtr", "ATLCUR/ATL::CComCurrency::GetFraction", "ATLCUR/ATL::CComCurrency::GetInteger", "ATLCUR/ATL::CComCurrency::Round", "ATLCUR/ATL::CComCurrency::SetFraction", "ATLCUR/ATL::CComCurrency::SetInteger", "ATLCUR/ATL::CComCurrency::m_currency"]
helpviewer_keywords: ["CComCurrency class"]
-ms.assetid: a1c3d10a-bba6-40cc-8bcf-aed9023c8a9e
---
# `CComCurrency` Class
@@ -563,7 +562,7 @@ Returns a reference to a `CURRENCY` object.
Call this method to round the currency to a specified number of decimal places.
```cpp
-HRESULT Roundint nDecimals);
+HRESULT Round(int nDecimals);
```
### Parameters
diff --git a/docs/atl/reference/ccomdynamicunkarray-class.md b/docs/atl/reference/ccomdynamicunkarray-class.md
index 19adbd15a5..0c0f142ee6 100644
--- a/docs/atl/reference/ccomdynamicunkarray-class.md
+++ b/docs/atl/reference/ccomdynamicunkarray-class.md
@@ -35,7 +35,7 @@ class CComDynamicUnkArray
|[CComDynamicUnkArray::end](#end)|Returns a pointer to one past the last `IUnknown` pointer in the collection.|
|[CComDynamicUnkArray::GetAt](#getat)|Retrieves the element at the specified index.|
|[CComDynamicUnkArray::GetCookie](#getcookie)|Call this method to get the cookie associated with a given `IUnknown` pointer.|
-|[CComDynamicUnkArray::GetSize](#getsize)|Returns the length of an array.|
+|[CComDynamicUnkArray::GetSize](#getsize)|Returns the number of elements the array can store.|
|[CComDynamicUnkArray::GetUnknown](#getunknown)|Call this method to get the `IUnknown` pointer associated with a given cookie.|
|[CComDynamicUnkArray::Remove](#remove)|Call this method to remove an `IUnknown` pointer from the array.|
@@ -69,7 +69,12 @@ The `IUnknown` pointer to add to the array.
### Return Value
-Returns the cookie associated with the newly added pointer.
+Returns the cookie associated with the newly added pointer. Use this cookie to retrieve the pointer from the array with [CComDynamicUnkArray::GetAt](#getat).
+
+### Remarks
+
+The position where this item is inserted won't necessarily be directly after the last-inserted item if `Remove()` was previously called on this array. Use the returned cookie to reliably access the inserted pointer.
+The array's size might be increased to accommodate more items. Use `GetSize()` to get the new size.
## CComDynamicUnkArray::begin
@@ -92,7 +97,7 @@ Before using the `IUnknown` interface, you should check that it is not NULL.
## CComDynamicUnkArray::clear
-Empties the array.
+Empties the array. Resets the size to 0.
```cpp
void clear();
@@ -124,7 +129,9 @@ Frees resources allocated by the class constructor.
## CComDynamicUnkArray::end
-Returns a pointer to one past the last `IUnknown` pointer in the collection.
+Returns a pointer to one-past the last element in the array's allocated buffer.
+
+Note: this means that the last-inserted pointer is not guaranteed to be at `end()-1` because the array may not be filled to capacity.
```
IUnknown**
@@ -150,7 +157,7 @@ The index of the element to retrieve.
### Return Value
-A pointer to an [IUnknown](/windows/win32/api/unknwn/nn-unknwn-iunknown) interface.
+A pointer to an [IUnknown](/windows/win32/api/unknwn/nn-unknwn-iunknown) interface if an element was previously added and exists at this index; otherwise `NULL`.
## CComDynamicUnkArray::GetCookie
@@ -175,7 +182,9 @@ If there is more than one instance of the same `IUnknown` pointer, this function
## CComDynamicUnkArray::GetSize
-Returns the length of an array.
+Returns the allocated capacity of the array.
+
+Note: this is not the same as the number of non-NULL elements currently in the array.
```
int GetSize() const;
@@ -183,9 +192,9 @@ int GetSize() const;
### Return Value
-The length of the array.
+The number of elements the array can store. `GetSize() == end() - begin()`.
-## CComDynamicUnkArray::GetUnknown
+## CComDynamicUnkArray::GetUnknown
Call this method to get the `IUnknown` pointer associated with a given cookie.
@@ -206,6 +215,8 @@ Returns the `IUnknown` pointer, or NULL if no matching cookie is found.
Call this method to remove an `IUnknown` pointer from the array.
+All other elements are unchanged and retain their index and cookie.
+
```
BOOL Remove(DWORD dwCookie);
```
diff --git a/docs/atl/reference/ccomenum-class.md b/docs/atl/reference/ccomenum-class.md
index 8ca27ce7d6..874c02b84c 100644
--- a/docs/atl/reference/ccomenum-class.md
+++ b/docs/atl/reference/ccomenum-class.md
@@ -76,7 +76,7 @@ The code shown below provides a reusable function for creating and initializing
[!code-cpp[NVC_ATL_COM#32](../../atl/codesnippet/cpp/ccomenum-class_1.h)]
-This template function can be used to implement the `_NewEnum` property of a collection interface as shown below:
+This function template can be used to implement the `_NewEnum` property of a collection interface as shown below:
[!code-cpp[NVC_ATL_COM#33](../../atl/codesnippet/cpp/ccomenum-class_2.h)]
diff --git a/docs/atl/reference/ccomenumonstl-class.md b/docs/atl/reference/ccomenumonstl-class.md
index c84d245c6b..7ab682b506 100644
--- a/docs/atl/reference/ccomenumonstl-class.md
+++ b/docs/atl/reference/ccomenumonstl-class.md
@@ -85,7 +85,7 @@ The code shown below provides a generic function to handle the creation and init
[!code-cpp[NVC_ATL_COM#34](../../atl/codesnippet/cpp/ccomenumonstl-class_1.h)]
-This template function can be used to implement the `_NewEnum` property of a collection interface as shown below:
+This function template can be used to implement the `_NewEnum` property of a collection interface as shown below:
[!code-cpp[NVC_ATL_COM#35](../../atl/codesnippet/cpp/ccomenumonstl-class_2.h)]
diff --git a/docs/atl/reference/ccommultithreadmodel-class.md b/docs/atl/reference/ccommultithreadmodel-class.md
index 167fe9c3c7..651aa91f66 100644
--- a/docs/atl/reference/ccommultithreadmodel-class.md
+++ b/docs/atl/reference/ccommultithreadmodel-class.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: CComMultiThreadModel Class"
title: "CComMultiThreadModel Class"
+description: "Learn more about: CComMultiThreadModel Class"
ms.date: "11/04/2016"
f1_keywords: ["CComMultiThreadModel", "ATLBASE/ATL::CComMultiThreadModel", "ATLBASE/ATL::CComMultiThreadModel::AutoCriticalSection", "ATLBASE/ATL::CComMultiThreadModel::CriticalSection", "ATLBASE/ATL::CComMultiThreadModel::ThreadModelNoCS", "ATLBASE/ATL::CComMultiThreadModel::Decrement", "ATLBASE/ATL::CComMultiThreadModel::Increment"]
helpviewer_keywords: ["ATL, multithreading", "CComMultiThreadModel class", "threading [ATL]"]
-ms.assetid: db8f1662-2f7a-44b3-b341-ffbfb6e422a3
---
# CComMultiThreadModel Class
@@ -12,7 +11,7 @@ ms.assetid: db8f1662-2f7a-44b3-b341-ffbfb6e422a3
## Syntax
-```
+```cpp
class CComMultiThreadModel
```
@@ -35,7 +34,7 @@ class CComMultiThreadModel
## Remarks
-Typically, you use `CComMultiThreadModel` through one of two **`typedef`** names, either [CComObjectThreadModel](atl-typedefs.md#ccomobjectthreadmodel or [CComGlobalsThreadModel](atl-typedefs.md#ccomglobalsthreadmodel. The class referenced by each **`typedef`** depends on the threading model used, as shown in the following table:
+Typically, you use `CComMultiThreadModel` through one of two **`typedef`** names, either [CComObjectThreadModel](atl-typedefs.md#ccomobjectthreadmodel) or [CComGlobalsThreadModel](atl-typedefs.md#ccomglobalsthreadmodel). The class referenced by each **`typedef`** depends on the threading model used, as shown in the following table:
|typedef|Single threading|Apartment threading|Free threading|
|-------------|----------------------|-------------------------|--------------------|
@@ -54,7 +53,7 @@ S= `CComSingleThreadModel`; M= `CComMultiThreadModel`
When using `CComMultiThreadModel`, the **`typedef`** name `AutoCriticalSection` references class [CComAutoCriticalSection](ccomautocriticalsection-class.md), which provides methods for obtaining and releasing ownership of a critical section object.
-```
+```cpp
typedef CComAutoCriticalSection AutoCriticalSection;
```
@@ -120,7 +119,7 @@ The following tables show the results of the `InternalAddRef` and `Lock` methods
When using `CComMultiThreadModel`, the **`typedef`** name `CriticalSection` references class [CComCriticalSection](ccomcriticalsection-class.md), which provides methods for obtaining and releasing ownership of a critical section object.
-```
+```cpp
typedef CComCriticalSection CriticalSection;
```
@@ -144,13 +143,13 @@ See [CComMultiThreadModel::AutoCriticalSection](#autocriticalsection).
This static function calls the Win32 function [InterlockedDecrement](/windows/win32/api/winnt/nf-winnt-interlockeddecrement), which decrements the value of the variable pointed to by *p*.
-```
+```cpp
static ULONG WINAPI Decrement(LPLONG p) throw ();
```
### Parameters
-*p*
+*p*\
[in] Pointer to the variable to be decremented.
### Return Value
@@ -165,13 +164,13 @@ If the result of the decrement is 0, then `Decrement` returns 0. If the result o
This static function calls the Win32 function [InterlockedIncrement](/windows/win32/api/winnt/nf-winnt-interlockedincrement), which increments the value of the variable pointed to by *p*.
-```
+```cpp
static ULONG WINAPI Increment(LPLONG p) throw ();
```
### Parameters
-*p*
+*p*\
[in] Pointer to the variable to be incremented.
### Return Value
@@ -186,7 +185,7 @@ If the result of the increment is 0, then `Increment` returns 0. If the result o
When using `CComMultiThreadModel`, the **`typedef`** name `ThreadModelNoCS` references class [CComMultiThreadModelNoCS](ccommultithreadmodelnocs-class.md).
-```
+```cpp
typedef CComMultiThreadModelNoCS ThreadModelNoCS;
```
@@ -208,7 +207,7 @@ See [CComMultiThreadModel::AutoCriticalSection](#autocriticalsection).
## See also
-[CComSingleThreadModel Class](ccomsinglethreadmodel-class.md)
-[CComAutoCriticalSection Class](ccomautocriticalsection-class.md)
-[CComCriticalSection Class](ccomcriticalsection-class.md)
+[CComSingleThreadModel Class](ccomsinglethreadmodel-class.md)\
+[CComAutoCriticalSection Class](ccomautocriticalsection-class.md)\
+[CComCriticalSection Class](ccomcriticalsection-class.md)\
[Class Overview](../atl-class-overview.md)
diff --git a/docs/atl/reference/ccomobject-class.md b/docs/atl/reference/ccomobject-class.md
index 7c63e2eca1..940285715a 100644
--- a/docs/atl/reference/ccomobject-class.md
+++ b/docs/atl/reference/ccomobject-class.md
@@ -125,7 +125,7 @@ If you do not need direct access to the object, but still want to create a new o
### Example
[!code-cpp[NVC_ATL_COM#38](../../atl/codesnippet/cpp/ccomobject-class_1.h)]
-
+
[!code-cpp[NVC_ATL_COM#39](../../atl/codesnippet/cpp/ccomobject-class_2.cpp)]
## CComObject::QueryInterface
diff --git a/docs/atl/reference/ccomptr-class.md b/docs/atl/reference/ccomptr-class.md
index ab102f9213..6ccf609038 100644
--- a/docs/atl/reference/ccomptr-class.md
+++ b/docs/atl/reference/ccomptr-class.md
@@ -43,7 +43,7 @@ ATL uses `CComPtr` and [`CComQIPtr`](../../atl/reference/ccomqiptr-class.md) to
The `CComPtr` and [`CComQIPtr`](../../atl/reference/ccomqiptr-class.md) classes can help eliminate memory leaks by performing automatic reference counting. The following functions both do the same logical operations. However, the second version may be less error-prone because it uses the `CComPtr` class:
[!code-cpp[NVC_ATL_Utilities#130](../../atl/codesnippet/cpp/ccomptr-class_1.cpp)]
-
+
[!code-cpp[NVC_ATL_Utilities#131](../../atl/codesnippet/cpp/ccomptr-class_2.cpp)]
In Debug builds, link atlsd.lib for code tracing.
diff --git a/docs/atl/reference/ccomsafearray-class.md b/docs/atl/reference/ccomsafearray-class.md
index df693cce9a..d9c6729e91 100644
--- a/docs/atl/reference/ccomsafearray-class.md
+++ b/docs/atl/reference/ccomsafearray-class.md
@@ -4,7 +4,6 @@ title: "CComSafeArray Class"
ms.date: "05/06/2019"
f1_keywords: ["CComSafeArray", "ATLSAFE/ATL::CComSafeArray", "ATLSAFE/ATL::CComSafeArray::CComSafeArray", "ATLSAFE/ATL::CComSafeArray::Add", "ATLSAFE/ATL::CComSafeArray::Attach", "ATLSAFE/ATL::CComSafeArray::CopyFrom", "ATLSAFE/ATL::CComSafeArray::CopyTo", "ATLSAFE/ATL::CComSafeArray::Create", "ATLSAFE/ATL::CComSafeArray::Destroy", "ATLSAFE/ATL::CComSafeArray::Detach", "ATLSAFE/ATL::CComSafeArray::GetAt", "ATLSAFE/ATL::CComSafeArray::GetCount", "ATLSAFE/ATL::CComSafeArray::GetDimensions", "ATLSAFE/ATL::CComSafeArray::GetLowerBound", "ATLSAFE/ATL::CComSafeArray::GetSafeArrayPtr", "ATLSAFE/ATL::CComSafeArray::GetType", "ATLSAFE/ATL::CComSafeArray::GetUpperBound", "ATLSAFE/ATL::CComSafeArray::IsSizable", "ATLSAFE/ATL::CComSafeArray::MultiDimGetAt", "ATLSAFE/ATL::CComSafeArray::MultiDimSetAt", "ATLSAFE/ATL::CComSafeArray::Resize", "ATLSAFE/ATL::CComSafeArray::SetAt", "ATLSAFE/ATL::CComSafeArray::m_psa"]
helpviewer_keywords: ["CComSafeArray class"]
-ms.assetid: ee349aef-33db-4c85-bd08-5d86a3c9d53a
---
# `CComSafeArray` Class
@@ -101,7 +100,7 @@ A `CComSafeArray` can contain the following subset of `VARIANT` data types:
## Requirements
-**Header:** atlsafe.h
+**Header:** `atlsafe.h`
## Example
@@ -527,7 +526,7 @@ Retrieves an element from the array.
```cpp
T& operator[](long lindex) const;
-T& operator[]int nindex) const;
+T& operator[](int nindex) const;
```
### Parameters
diff --git a/docs/atl/reference/ccomvariant-class.md b/docs/atl/reference/ccomvariant-class.md
index cb97f860f4..e3b806e113 100644
--- a/docs/atl/reference/ccomvariant-class.md
+++ b/docs/atl/reference/ccomvariant-class.md
@@ -4,7 +4,6 @@ title: "CComVariant class"
ms.date: "11/04/2016"
f1_keywords: ["CComVariant", "ATLCOMCLI/ATL::CComVariant", "ATLCOMCLI/ATL::CComVariant::CComVariant", "ATLCOMCLI/ATL::CComVariant::Attach", "ATLCOMCLI/ATL::CComVariant::ChangeType", "ATLCOMCLI/ATL::CComVariant::Clear", "ATLCOMCLI/ATL::CComVariant::Copy", "ATLCOMCLI/ATL::CComVariant::CopyTo", "ATLCOMCLI/ATL::CComVariant::Detach", "ATLCOMCLI/ATL::CComVariant::GetSize", "ATLCOMCLI/ATL::CComVariant::ReadFromStream", "ATLCOMCLI/ATL::CComVariant::SetByRef", "ATLCOMCLI/ATL::CComVariant::WriteToStream"]
helpviewer_keywords: ["VARIANT macro", "CComVariant class", "VARIANT macro, ATL"]
-ms.assetid: 4d31149c-d005-44b5-a509-10f84afa2b61
---
# `CComVariant` class
@@ -52,7 +51,7 @@ class CComVariant : public tagVARIANT
## Remarks
-`CComVariant` wraps the `VARIANT` and `VARIANTARG` type, which consists of a union and a member indicating the type of the data stored in the union. VARIANTs are typically used in Automation.
+`CComVariant` wraps the `VARIANT` and `VARIANTARG` type, which consists of a union and a member indicating the type of the data stored in the union. `VARIANT`s are typically used in Automation.
`CComVariant` derives from the `VARIANT` type so it can be used wherever a `VARIANT` can be used. You can, for example, use the `V_VT` macro to extract the type of a `CComVariant` or you can access the `vt` member directly just as you can with a `VARIANT`.
@@ -63,7 +62,7 @@ class CComVariant : public tagVARIANT
## Requirements
-**Header:** atlcomcli.h
+**Header:** `atlcomcli.h`
## `CComVariant::Attach`
@@ -183,7 +182,7 @@ HRESULT ChangeType(VARTYPE vtNew, const VARIANT* pSrc = NULL);
[in] The new type for the `CComVariant` object.
*`pSrc`*\
-[in] A pointer to the `VARIANT` whose value is converted to the new type. The default value is NULL, meaning the `CComVariant` object is converted in place.
+[in] A pointer to the `VARIANT` whose value is converted to the new type. The default value is `NULL`, meaning the `CComVariant` object is converted in place.
### Return value
@@ -270,7 +269,7 @@ The contents of the `VARIANT` referenced by *`pDest`* are automatically cleared
## `CComVariant::GetSize`
-For simple-fixed size VARIANTs, this method returns the **`sizeof`** value for the underlying data type plus `sizeof(VARTYPE)`.
+For simple-fixed size `VARIANT`s, this method returns the **`sizeof`** value for the underlying data type plus `sizeof(VARTYPE)`.
```cpp
ULONG GetSize() const;
@@ -282,9 +281,9 @@ The size in bytes of the current contents of the `CComVariant` object.
### Remarks
-If the `VARIANT` contains an interface pointer, `GetSize` queries for `IPersistStream` or `IPersistStreamInit`. If successful, the return value is the low-order 32 bits of the value returned by `GetSizeMax` plus `sizeof(CLSID)` and `sizeof(VARTYPE)`. If the interface pointer is NULL, `GetSize` returns `sizeof(CLSID)` plus `sizeof(VARTYPE)`. If the total size is larger than `ULONG_MAX`, `GetSize` returns `sizeof(VARTYPE)`, which indicates an error.
+If the `VARIANT` contains an interface pointer, `GetSize` queries for `IPersistStream` or `IPersistStreamInit`. If successful, the return value is the low-order 32 bits of the value returned by `GetSizeMax` plus `sizeof(CLSID)` and `sizeof(VARTYPE)`. If the interface pointer is `NULL`, `GetSize` returns `sizeof(CLSID)` plus `sizeof(VARTYPE)`. If the total size is larger than `ULONG_MAX`, `GetSize` returns `sizeof(VARTYPE)`, which indicates an error.
-In all other cases, a temporary `VARIANT` of type `VT_BSTR` is coerced from the current `VARIANT`. The length of this `BSTR` is calculated as the size of the length of the string plus the length of the string itself plus the size of the null character plus `sizeof(VARTYPE)`. If the `VARIANT` cannot be coerced to a `VARIANT` of type `VT_BSTR`, `GetSize` returns `sizeof(VARTYPE)`.
+In all other cases, a temporary `VARIANT` of type `VT_BSTR` is coerced from the current `VARIANT`. The length of this `BSTR` is calculated as the size of the length of the string plus the length of the string itself plus the size of the `NULL` character plus `sizeof(VARTYPE)`. If the `VARIANT` can't be coerced to a `VARIANT` of type `VT_BSTR`, `GetSize` returns `sizeof(VARTYPE)`.
The size returned by this method matches the number of bytes used by [`CComVariant::WriteToStream`](#writetostream) under successful conditions.
diff --git a/docs/atl/reference/ccontainedwindowt-class.md b/docs/atl/reference/ccontainedwindowt-class.md
index 2324c43241..92e55f8f39 100644
--- a/docs/atl/reference/ccontainedwindowt-class.md
+++ b/docs/atl/reference/ccontainedwindowt-class.md
@@ -75,9 +75,9 @@ A traits class that defines styles for your window. The default is `CControlWinT
When you use the **Add control based on** option in the ATL Project Wizard, the wizard will automatically add a `CContainedWindowT` data member to the class implementing the control. The following example shows how the contained window is declared:
[!code-cpp[NVC_ATL_Windowing#38](../../atl/codesnippet/cpp/ccontainedwindowt-class_1.h)]
-
+
[!code-cpp[NVC_ATL_Windowing#39](../../atl/codesnippet/cpp/ccontainedwindowt-class_2.h)]
-
+
[!code-cpp[NVC_ATL_Windowing#40](../../atl/codesnippet/cpp/ccontainedwindowt-class_3.h)]
|For more information about|See|
@@ -197,7 +197,7 @@ HWND Create(
[in] Specifies the name of the window. The default value is NULL.
*dwStyle*
-[in] The style of the window. The default value is WS_CHILD | WS_VISIBLE. For a list of possible values, see [CreateWindow](/windows/win32/api/winuser/nf-winuser-createwindoww) in the Windows SDK.
+[in] The style of the window. The default value is `WS_CHILD | WS_VISIBLE`. For a list of possible values, see [CreateWindow](/windows/win32/api/winuser/nf-winuser-createwindoww) in the Windows SDK.
*dwExStyle*
[in] The extended window style. The default value is 0, meaning no extended style. For a list of possible values, see [CreateWindowEx](/windows/win32/api/winuser/nf-winuser-createwindowexw) in the Windows SDK.
diff --git a/docs/atl/reference/com-map-macros.md b/docs/atl/reference/com-map-macros.md
index cb755491ea..6734604721 100644
--- a/docs/atl/reference/com-map-macros.md
+++ b/docs/atl/reference/com-map-macros.md
@@ -2,7 +2,7 @@
description: "Learn more about: COM Map Macros"
title: "COM Map Macros"
ms.date: "11/04/2016"
-f1_keywords: ["atlcom/ATL::BEGIN_COM_MAP", "atlcom/ATL::END_COM_MAP"]
+f1_keywords: ["atlcom/ATL::BEGIN_COM_MAP", "atlcom/ATL::END_COM_MAP", "ATLCOM/BEGIN_COM_MAP", "ATLCOM/END_COM_MAP"]
helpviewer_keywords: ["COM interfaces, COM map macros"]
ms.assetid: 0f33656d-321f-4996-90cc-9a7f21ab73c3
---
diff --git a/docs/atl/reference/compiler-options-macros.md b/docs/atl/reference/compiler-options-macros.md
index b88df25cda..4c80bb5d9b 100644
--- a/docs/atl/reference/compiler-options-macros.md
+++ b/docs/atl/reference/compiler-options-macros.md
@@ -1,10 +1,9 @@
---
description: "Learn more about: Compiler Options Macros"
title: "Compiler Options Macros"
-ms.date: "08/19/2019"
-f1_keywords: ["_ATL_ALL_WARNINGS", "_ATL_APARTMENT_THREADED", "_ATL_CSTRING_EXPLICIT_CONSTRUCTORS ", "_ATL_ENABLE_PTM_WARNING", "_ATL_FREE_THREADED", "_ATL_MULTI_THREADED", "_ATL_NO_AUTOMATIC_NAMESPACE", "_ATL_NO_COM_SUPPORT", "ATL_NO_VTABLE", "ATL_NOINLINE", "_ATL_SINGLE_THREADED"]
+ms.date: 02/01/2023
+f1_keywords: ["_ATL_ALL_WARNINGS", "_ATL_APARTMENT_THREADED", "_ATL_CSTRING_EXPLICIT_CONSTRUCTORS ", "_ATL_ENABLE_PTM_WARNING", "_ATL_FREE_THREADED", "_ATL_MODULES", "_ATL_MULTI_THREADED", "_ATL_NO_AUTOMATIC_NAMESPACE", "_ATL_NO_COM_SUPPORT", "ATL_NO_VTABLE", "ATL_NOINLINE", "_ATL_SINGLE_THREADED"]
helpviewer_keywords: ["compiler options, macros"]
-ms.assetid: a869adc6-b3de-4299-b040-9ae20b45f82c
---
# Compiler Options Macros
@@ -12,23 +11,24 @@ These macros control specific compiler features.
|Macro|Description|
|-|-|
-|[_ATL_ALL_WARNINGS](#_atl_all_warnings)|A symbol that enables errors in projects converted from previous versions of ATL.|
-|[_ATL_APARTMENT_THREADED](#_atl_apartment_threaded)|Define if one or more of your objects use apartment threading.|
-|[_ATL_CSTRING_EXPLICIT_CONSTRUCTORS](#_atl_cstring_explicit_constructors)|Makes certain `CString` constructors explicit, preventing any unintentional conversions.|
-|[_ATL_ENABLE_PTM_WARNING](#_atl_enable_ptm_warning)|Define this macro to require C++ standard syntax. It generates the C4867 compiler error when non-standard syntax is used to initialize a pointer to a member function.|
-|[_ATL_FREE_THREADED](#_atl_free_threaded)|Define if one or more of your objects use free or neutral threading.|
-|[_ATL_MULTI_THREADED](#_atl_multi_threaded)|A symbol that indicates the project will have objects that are marked as Both, Free or Neutral. The macro [_ATL_FREE_THREADED](#_atl_free_threaded) should be used instead.|
-|[_ATL_NO_AUTOMATIC_NAMESPACE](#_atl_no_automatic_namespace)|A symbol that prevents the default use of namespace as ATL.|
-|[_ATL_NO_COM_SUPPORT](#_atl_no_com_support)|A symbol that prevents COM-related code from being compiled with your project.|
-|[ATL_NO_VTABLE](#atl_no_vtable)|A symbol that prevents the vtable pointer from being initialized in the class's constructor and destructor.|
-|[ATL_NOINLINE](#atl_noinline)|A symbol that indicates a function shouldn't be inlined.|
-|[_ATL_SINGLE_THREADED](#_atl_single_threaded)|Define if all of your objects use the single threading model.|
-
-## _ATL_ALL_WARNINGS
+|[`_ATL_ALL_WARNINGS`](#_atl_all_warnings)|A symbol that enables errors in projects converted from previous versions of ATL.|
+|[`_ATL_APARTMENT_THREADED`](#_atl_apartment_threaded)|Define if one or more of your objects use apartment threading.|
+|[`_ATL_CSTRING_EXPLICIT_CONSTRUCTORS`](#_atl_cstring_explicit_constructors)|Makes certain `CString` constructors explicit, preventing any unintentional conversions.|
+|[`_ATL_ENABLE_PTM_WARNING`](#_atl_enable_ptm_warning)|Define this macro to require C++ standard syntax. It generates the C4867 compiler error when nonstandard syntax is used to initialize a pointer to a member function.|
+|[`_ATL_FREE_THREADED`](#_atl_free_threaded)|Define if one or more of your objects use free or neutral threading.|
+|[`_ATL_MODULES`](#_ATL_MODULES)|Allows you to compile ATL projects with [permissive-](../../build/reference/permissive-standards-conformance.md) and use ATL with [C++ modules](../../cpp/modules-cpp.md).|
+|[`_ATL_MULTI_THREADED`](#_atl_multi_threaded)|A symbol that indicates the project has objects marked as Both, Free or Neutral. The macro [`_ATL_FREE_THREADED`](#_atl_free_threaded) should be used instead.|
+|[`_ATL_NO_AUTOMATIC_NAMESPACE`](#_atl_no_automatic_namespace)|A symbol that prevents the default use of namespace as ATL.|
+|[`_ATL_NO_COM_SUPPORT`](#_atl_no_com_support)|A symbol that prevents COM-related code from being compiled with your project.|
+|[`ATL_NO_VTABLE`](#atl_no_vtable)|A symbol that prevents the vtable pointer from being initialized in the class's constructor and destructor.|
+|[`ATL_NOINLINE`](#atl_noinline)|A symbol that indicates a function shouldn't be inlined.|
+|[`_ATL_SINGLE_THREADED`](#_atl_single_threaded)|Define if all of your objects use the single threading model.|
+
+## `_ATL_ALL_WARNINGS`
A symbol that enables errors in projects converted from previous versions of ATL.
-```
+```cpp
#define _ATL_ALL_WARNINGS
```
@@ -52,7 +52,7 @@ Before Visual C++ .NET 2002, ATL disabled many warnings and left them disabled s
In projects converted from previous versions, these warnings are still disabled by the libraries headers.
-By adding the following line to the *pch.h* (*stdafx.h* in Visual Studio 2017 and earlier) file before including libraries headers, this behavior can be changed.
+To change this behavior, add the following line to the *`pch.h`* (*`stdafx.h`* in Visual Studio 2017 and earlier) file before including libraries headers.
[!code-cpp[NVC_ATL_Utilities#97](../../atl/codesnippet/cpp/compiler-options-macros_1.h)]
@@ -60,11 +60,11 @@ If this `#define` is added, the ATL headers are careful to preserve the state of
New projects have this `#define` set in *pch.h* (*stdafx.h* in Visual Studio 2017 and earlier) by default.
-## _ATL_APARTMENT_THREADED
+## `_ATL_APARTMENT_THREADED`
Define if one or more of your objects use apartment threading.
-```
+```cpp
_ATL_APARTMENT_THREADED
```
@@ -72,23 +72,23 @@ _ATL_APARTMENT_THREADED
Specifies apartment threading. For other options, and a description of the threading models available for an ATL object, see [Specifying the Project's Threading Model](../../atl/specifying-the-threading-model-for-a-project-atl.md) and [Options, ATL Simple Object Wizard](../../atl/reference/options-atl-simple-object-wizard.md).
-## _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
+## `_ATL_CSTRING_EXPLICIT_CONSTRUCTORS`
Makes certain `CString` constructors explicit, preventing any unintentional conversions.
-```cpp
+```
_ATL_CSTRING_EXPLICIT_CONSTRUCTORS
```
### Remarks
-When this constructor is defined, all CString constructors that take a single parameter are compiled with the explicit keyword, which prevents implicit conversions of input arguments. This means, for example, that when _UNICODE is defined, if you attempt to use a char* string as a CString constructor argument, a compiler error will result. Use this macro in situations where you need to prevent implicit conversions between narrow and wide string types.
+When this constructor is defined, all `CString` constructors that take a single parameter are compiled with the explicit keyword, which prevents implicit conversions of input arguments. This means, for example, that when `_UNICODE` is defined, if you attempt to use a `char*` string as a `CString` constructor argument, a compiler error results. Use this macro in situations where you need to prevent implicit conversions between narrow and wide string types.
-By using the _T macro on all constructor string arguments, you can define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS and avoid compile errors regardless of whether _UNICODE is defined.
+By using the `_T` macro on all constructor string arguments, you can define `_ATL_CSTRING_EXPLICIT_CONSTRUCTORS` and avoid compile errors regardless of whether `_UNICODE` is defined.
-## _ATL_ENABLE_PTM_WARNING
+## `_ATL_ENABLE_PTM_WARNING`
-Define this macro in order to force the use of ANSI C++ standard-conforming syntax for pointer to member functions. Using this macro will cause the C4867 compiler error to be generated when non-standard syntax is used to initialize a pointer to a member function.
+Define this macro in order to force the use of ANSI C++ standard-conforming syntax for pointer to member functions. Using this macro causes the C4867 compiler error to be generated when nonstandard syntax is used to initialize a pointer to a member function.
```cpp
#define _ATL_ENABLE_PTM_WARNING
@@ -98,9 +98,9 @@ Define this macro in order to force the use of ANSI C++ standard-conforming synt
The ATL and MFC libraries have been changed to match the Microsoft C++ compiler's improved standard C++ conformance. According to the ANSI C++ standard, the syntax of a pointer to a class member function should be `&CMyClass::MyFunc`.
-When [_ATL_ENABLE_PTM_WARNING](#_atl_enable_ptm_warning) is not defined (the default case), ATL/MFC disables the C4867 error in macro maps (notably message maps) so that code that was created in earlier versions can continue to build as before. If you define **_ATL_ENABLE_PTM_WARNING**, your code should conform to the C++ standard.
+When [`_ATL_ENABLE_PTM_WARNING`](#_atl_enable_ptm_warning) isn't defined (the default case), ATL/MFC disables the C4867 error in macro maps (notably message maps) so that code that was created in earlier versions can continue to build as before. If you define `_ATL_ENABLE_PTM_WARNING`, your code should conform to the C++ standard.
-However, the non-standard form has been deprecated. You need to move existing code to C++ standard syntax. For example, the following code:
+However, the nonstandard form has been deprecated. You need to move existing code to C++ standard syntax. For example, the following code:
[!code-cpp[NVC_MFCListView#14](../../atl/reference/codesnippet/cpp/compiler-options-macros_2.cpp)]
@@ -110,7 +110,7 @@ Should be changed to:
For map macros, add the ampersand '&' character. You shouldn't add the character again in your code.
-## _ATL_FREE_THREADED
+## `_ATL_FREE_THREADED`
Define if one or more of your objects use free or neutral threading.
@@ -122,9 +122,17 @@ _ATL_FREE_THREADED
Specifies free threading. Free threading is equivalent to a multithread apartment model. See [Specifying the Project's Threading Model](../../atl/specifying-the-threading-model-for-a-project-atl.md) for other threading options, and [Options, ATL Simple Object Wizard](../../atl/reference/options-atl-simple-object-wizard.md) for a description of the threading models available for an ATL object.
-## _ATL_MULTI_THREADED
+## `_ATL_MODULES`
+
+Allows you to compile ATL projects with [`permissive-`](../../build/reference/permissive-standards-conformance.md) and use ATL with [C++ modules](../../cpp/modules-cpp.md).
+
+```
+_ATL_MODULES
+```
+
+## `_ATL_MULTI_THREADED`
-A symbol that indicates the project will have objects that are marked as Both, Free or Neutral.
+A symbol that indicates the project has objects that are marked as Both, Free or Neutral.
```
_ATL_MULTI_THREADED
@@ -132,9 +140,9 @@ _ATL_MULTI_THREADED
### Remarks
-If this symbol is defined, ATL will pull in code that will correctly synchronize access to global data. New code should use the equivalent macro [_ATL_FREE_THREADED](#_atl_free_threaded) instead.
+If this symbol is defined, ATL pulls in code that will correctly synchronize access to global data. New code should use the equivalent macro [`_ATL_FREE_THREADED`](#_atl_free_threaded) instead.
-## _ATL_NO_AUTOMATIC_NAMESPACE
+## `_ATL_NO_AUTOMATIC_NAMESPACE`
A symbol that prevents the default use of namespace as ATL.
@@ -144,9 +152,9 @@ _ATL_NO_AUTOMATIC_NAMESPACE
### Remarks
-If this symbol is not defined, including atlbase.h will perform **using namespace ATL** by default, which may lead to naming conflicts. To prevent this, define this symbol.
+If this symbol isn't defined, including `atlbase.h` performs `using namespace ATL` by default, which may lead to naming conflicts. To prevent this, define this symbol.
-## _ATL_NO_COM_SUPPORT
+## `_ATL_NO_COM_SUPPORT`
A symbol that prevents COM-related code from being compiled with your project.
@@ -154,7 +162,7 @@ A symbol that prevents COM-related code from being compiled with your project.
_ATL_NO_COM_SUPPORT
```
-## ATL_NO_VTABLE
+## `ATL_NO_VTABLE`
A symbol that prevents the vtable pointer from being initialized in the class's constructor and destructor.
@@ -164,13 +172,13 @@ ATL_NO_VTABLE
### Remarks
-If the vtable pointer is prevented from being initialized in the class's constructor and destructor, the linker can eliminate the vtable and all of the functions to which it points. Expands to **`__declspec(novtable)`**.
+If the vtable pointer is prevented from being initialized in the class's constructor and destructor, the linker can eliminate the vtable and all of the functions to which it points. Expands to `__declspec(novtable)`.
### Example
[!code-cpp[NVC_ATL_COM#53](../../atl/codesnippet/cpp/compiler-options-macros_4.h)]
-## ATL_NOINLINE
+## `ATL_NOINLINE`
A symbol that indicates a function shouldn't be inlined.
@@ -184,14 +192,14 @@ A symbol that indicates a function shouldn't be inlined.
### Parameters
-*myfunction*
-The function that should not be inlined.
+*`myfunction`*\
+The function that shouldn't be inlined.
### Remarks
-Use this symbol if you want to ensure a function does not get inlined by the compiler, even though it must be declared as inline so that it can be placed in a header file. Expands to **`__declspec(noinline)`**.
+Use this symbol if you want to ensure a function doesn't get inlined by the compiler, even though it must be declared as inline so that it can be placed in a header file. Expands to `__declspec(noinline)`.
-## _ATL_SINGLE_THREADED
+## `_ATL_SINGLE_THREADED`
Define if all of your objects use the single threading model
diff --git a/docs/atl/reference/composite-control-macros.md b/docs/atl/reference/composite-control-macros.md
index 2d9e4e9fee..9721f16031 100644
--- a/docs/atl/reference/composite-control-macros.md
+++ b/docs/atl/reference/composite-control-macros.md
@@ -2,7 +2,7 @@
description: "Learn more about: Composite Control Macros"
title: "Composite Control Macros"
ms.date: "05/06/2019"
-f1_keywords: ["atlcom/ATL::BEGIN_SINK_MAP", "atlcom/ATL::END_SINK_MAP", "atlcom/ATL::SINK_ENTRY"]
+f1_keywords: ["atlcom/ATL::BEGIN_SINK_MAP", "atlcom/ATL::END_SINK_MAP", "atlcom/ATL::SINK_ENTRY", "ATLCOM/BEGIN_SINK_MAP", "ATLCOM/END_SINK_MAP", "ATLCOM/SINK_ENTRY", "ATLCOM/SINK_ENTRY_EX", "ATLCOM/SINK_ENTRY_EX_P", "ATLCOM/SINK_ENTRY_INFO", "ATLCOM/SINK_ENTRY_INFO_P", "BEGIN_SINK_MAP", "END_SINK_MAP", "SINK_ENTRY", "SINK_ENTRY_EX", "SINK_ENTRY_EX_P", "SINK_ENTRY_INFO", "SINK_ENTRY_INFO_P"]
helpviewer_keywords: ["composite controls, macros"]
ms.assetid: 17f2dd5e-07e6-4aa6-b965-7a361c78c45e
---
@@ -15,7 +15,7 @@ These macros define event sink maps and entries.
|[BEGIN_SINK_MAP](#begin_sink_map)|Marks the beginning of the event sink map for the composite control.|
|[END_SINK_MAP](#end_sink_map)|Marks the end of the event sink map for the composite control.|
|[SINK_ENTRY](#sink_entry)|Entry to the event sink map.|
-|[SINK_ENTRY_EX](#sink_entry_ex)|Entry to the event sink map with an additional parameter.|
+|[SINK_ENTRY_EX](#sink_entry_ex)|Entry to the event sink map with an extra parameter.|
|[SINK_ENTRY_EX_P](#sink_entry_ex)| (Visual Studio 2017) Similar to SINK_ENTRY_EX except that it takes a pointer to iid.|
|[SINK_ENTRY_INFO](#sink_entry_info)|Entry to the event sink map with manually supplied type information for use with [IDispEventSimpleImpl](../../atl/reference/idispeventsimpleimpl-class.md).|
|[SINK_ENTRY_INFO_P](#sink_entry_info)| (Visual Studio 2017) Similar to SINK_ENTRY_INFO except that it takes a pointer to iid.|
@@ -43,7 +43,7 @@ BEGIN_SINK_MAP(_class)
### Remarks
-CE ATL implementation of ActiveX event sinks only supports return values of type HRESULT or void from your event handler methods; any other return value is unsupported and its behavior is undefined.
+CE ATL implementation of ActiveX event sinks only supports return values of type HRESULT or void from your event handler methods. Any other return value is unsupported and its behavior is undefined.
## END_SINK_MAP
@@ -59,7 +59,7 @@ END_SINK_MAP()
### Remarks
-CE ATL implementation of ActiveX event sinks only supports return values of type HRESULT or void from your event handler methods; any other return value is unsupported and its behavior is undefined.
+CE ATL implementation of ActiveX event sinks only supports return values of type HRESULT or void from your event handler methods. Any other return value is unsupported and its behavior is undefined.
## SINK_ENTRY
@@ -86,7 +86,7 @@ SINK_ENTRY( id, dispid, fn )
### Remarks
-CE ATL implementation of ActiveX event sinks only supports return values of type HRESULT or void from your event handler methods; any other return value is unsupported and its behavior is undefined.
+CE ATL implementation of ActiveX event sinks only supports return values of type HRESULT or void from your event handler methods. Any other return value is unsupported and its behavior is undefined.
## SINK_ENTRY_EX and SINK_ENTRY_EX_P
@@ -120,7 +120,7 @@ SINK_ENTRY_EX_P( id, piid, dispid, fn ) // (Visual Studio 2017)
### Remarks
-CE ATL implementation of ActiveX event sinks only supports return values of type HRESULT or void from your event handler methods; any other return value is unsupported and its behavior is undefined.
+CE ATL implementation of ActiveX event sinks only supports return values of type HRESULT or void from your event handler methods. Any other return value is unsupported and its behavior is undefined.
## SINK_ENTRY_INFO and SINK_ENTRY_INFO_P
@@ -153,7 +153,7 @@ SINK_ENTRY_INFO_P( id, piid, dispid, fn, info ) // (Visual Studio 2017)
### Remarks
-The first four macro parameters are the same as those for the [SINK_ENTRY_EX](#sink_entry_ex) macro. The final parameter provides type information for the event. CE ATL implementation of ActiveX event sinks only supports return values of type HRESULT or void from your event handler methods; any other return value is unsupported and its behavior is undefined.
+The first four macro parameters are the same as the ones for the [SINK_ENTRY_EX](#sink_entry_ex) macro. The final parameter provides type information for the event. CE ATL implementation of ActiveX event sinks only supports return values of type HRESULT or void from your event handler methods. Any other return value is unsupported and its behavior is undefined.
## See also
diff --git a/docs/atl/reference/connection-point-macros.md b/docs/atl/reference/connection-point-macros.md
index 5fb40db7d0..490abb2c38 100644
--- a/docs/atl/reference/connection-point-macros.md
+++ b/docs/atl/reference/connection-point-macros.md
@@ -2,7 +2,7 @@
description: "Learn more about: Connection Point Macros"
title: "Connection Point Macros"
ms.date: "11/04/2016"
-f1_keywords: ["atlcom/ATL::BEGIN_CONNECTION_POINT_MAP", "atlcom/ATL::END_CONNECTION_POINT_MAP"]
+f1_keywords: ["atlcom/ATL::BEGIN_CONNECTION_POINT_MAP", "atlcom/ATL::END_CONNECTION_POINT_MAP", "ATLCOM/BEGIN_CONNECTION_POINT_MAP", "ATLCOM/END_CONNECTION_POINT_MAP", "ATLCOM/CONNECTION_POINT_ENTRY", "ATLCOM/CONNECTION_POINT_ENTRY_P", "BEGIN_CONNECTION_POINT_MAP", "END_CONNECTION_POINT_MAP", "CONNECTION_POINT_ENTRY", "CONNECTION_POINT_ENTRY_P"]
helpviewer_keywords: ["connection points [C++], macros"]
ms.assetid: cc3a6dd3-5538-45df-b027-1f34963c31e5
---
diff --git a/docs/atl/reference/cregkey-class.md b/docs/atl/reference/cregkey-class.md
index 6738e5cb07..175495ad2e 100644
--- a/docs/atl/reference/cregkey-class.md
+++ b/docs/atl/reference/cregkey-class.md
@@ -4,9 +4,8 @@ title: "CRegKey Class"
ms.date: "11/04/2016"
f1_keywords: ["CRegKey", "ATLBASE/ATL::CRegKey", "ATLBASE/ATL::CRegKey::CRegKey", "ATLBASE/ATL::CRegKey::Attach", "ATLBASE/ATL::CRegKey::Close", "ATLBASE/ATL::CRegKey::Create", "ATLBASE/ATL::CRegKey::DeleteSubKey", "ATLBASE/ATL::CRegKey::DeleteValue", "ATLBASE/ATL::CRegKey::Detach", "ATLBASE/ATL::CRegKey::EnumKey", "ATLBASE/ATL::CRegKey::Flush", "ATLBASE/ATL::CRegKey::GetKeySecurity", "ATLBASE/ATL::CRegKey::NotifyChangeKeyValue", "ATLBASE/ATL::CRegKey::Open", "ATLBASE/ATL::CRegKey::QueryBinaryValue", "ATLBASE/ATL::CRegKey::QueryDWORDValue", "ATLBASE/ATL::CRegKey::QueryGUIDValue", "ATLBASE/ATL::CRegKey::QueryMultiStringValue", "ATLBASE/ATL::CRegKey::QueryQWORDValue", "ATLBASE/ATL::CRegKey::QueryStringValue", "ATLBASE/ATL::CRegKey::QueryValue", "ATLBASE/ATL::CRegKey::RecurseDeleteKey", "ATLBASE/ATL::CRegKey::SetBinaryValue", "ATLBASE/ATL::CRegKey::SetDWORDValue", "ATLBASE/ATL::CRegKey::SetGUIDValue", "ATLBASE/ATL::CRegKey::SetKeySecurity", "ATLBASE/ATL::CRegKey::SetKeyValue", "ATLBASE/ATL::CRegKey::SetMultiStringValue", "ATLBASE/ATL::CRegKey::SetQWORDValue", "ATLBASE/ATL::CRegKey::SetStringValue", "ATLBASE/ATL::CRegKey::SetValue", "ATLBASE/ATL::CRegKey::m_hKey", "ATLBASE/ATL::CRegKey::m_pTM"]
helpviewer_keywords: ["CRegKey class", "ATL, registry", "registry, deleting values", "registry, writing to", "registry, deleting keys"]
-ms.assetid: 3afce82b-ba2c-4c1a-8404-dc969e1af74b
---
-# CRegKey Class
+# `CRegKey` Class
This class provides methods for manipulating entries in the system registry.
@@ -25,55 +24,55 @@ class CRegKey
|Name|Description|
|----------|-----------------|
-|[CRegKey::CRegKey](#cregkey)|The constructor.|
-|[CRegKey::~CRegKey](#dtor)|The destructor.|
+|[`CRegKey::CRegKey`](#cregkey)|The constructor.|
+|[`CRegKey::~CRegKey`](#dtor)|The destructor.|
### Public Methods
|Name|Description|
|----------|-----------------|
-|[CRegKey::Attach](#attach)|Call this method to attach an HKEY to the `CRegKey` object by setting the [m_hKey](#m_hkey) member handle to `hKey`.|
-|[CRegKey::Close](#close)|Call this method to release the [m_hKey](#m_hkey) member handle and set it to NULL.|
-|[CRegKey::Create](#create)|Call this method to create the specified key, if it does not exist as a subkey of `hKeyParent`.|
-|[CRegKey::DeleteSubKey](#deletesubkey)|Call this method to remove the specified key from the registry.|
-|[CRegKey::DeleteValue](#deletevalue)|Call this method to remove a value field from [m_hKey](#m_hkey).|
-|[CRegKey::Detach](#detach)|Call this method to detach the [m_hKey](#m_hkey) member handle from the `CRegKey` object and set `m_hKey` to NULL.|
-|[CRegKey::EnumKey](#enumkey)|Call this method to enumerate the subkeys of the open registry key.|
-|[CRegKey::Flush](#flush)|Call this method to write all of the attributes of the open registry key into the registry.|
-|[CRegKey::GetKeySecurity](#getkeysecurity)|Call this method to retrieve a copy of the security descriptor protecting the open registry key.|
-|[CRegKey::NotifyChangeKeyValue](#notifychangekeyvalue)|This method notifies the caller about changes to the attributes or contents of the open registry key.|
-|[CRegKey::Open](#open)|Call this method to open the specified key and set [m_hKey](#m_hkey) to the handle of this key.|
-|[CRegKey::QueryBinaryValue](#querybinaryvalue)|Call this method to retrieve the binary data for a specified value name.|
-|[CRegKey::QueryDWORDValue](#querydwordvalue)|Call this method to retrieve the DWORD data for a specified value name.|
-|[CRegKey::QueryGUIDValue](#queryguidvalue)|Call this method to retrieve the GUID data for a specified value name.|
-|[CRegKey::QueryMultiStringValue](#querymultistringvalue)|Call this method to retrieve the multistring data for a specified value name.|
-|[CRegKey::QueryQWORDValue](#queryqwordvalue)|Call this method to retrieve the QWORD data for a specified value name.|
-|[CRegKey::QueryStringValue](#querystringvalue)|Call this method to retrieve the string data for a specified value name.|
-|[CRegKey::QueryValue](#queryvalue)|Call this method to retrieve the data for the specified value field of [m_hKey](#m_hkey). Earlier versions of this method are no longer supported and are marked as ATL_DEPRECATED.|
-|[CRegKey::RecurseDeleteKey](#recursedeletekey)|Call this method to remove the specified key from the registry and explicitly remove any subkeys.|
-|[CRegKey::SetBinaryValue](#setbinaryvalue)|Call this method to set the binary value of the registry key.|
-|[CRegKey::SetDWORDValue](#setdwordvalue)|Call this method to set the DWORD value of the registry key.|
-|[CRegKey::SetGUIDValue](#setguidvalue)|Call this method to set the GUID value of the registry key.|
-|[CRegKey::SetKeySecurity](#setkeysecurity)|Call this method to set the security of the registry key.|
-|[CRegKey::SetKeyValue](#setkeyvalue)|Call this method to store data in a specified value field of a specified key.|
-|[CRegKey::SetMultiStringValue](#setmultistringvalue)|Call this method to set the multistring value of the registry key.|
-|[CRegKey::SetQWORDValue](#setqwordvalue)|Call this method to set the QWORD value of the registry key.|
-|[CRegKey::SetStringValue](#setstringvalue)|Call this method to set the string value of the registry key.|
-|[CRegKey::SetValue](#setvalue)|Call this method to store data in the specified value field of [m_hKey](#m_hkey). Earlier versions of this method are no longer supported and are marked as ATL_DEPRECATED.|
+|[`CRegKey::Attach`](#attach)|Call this method to attach an HKEY to the `CRegKey` object by setting the [`m_hKey`](#m_hkey) member handle to `hKey`.|
+|[`CRegKey::Close`](#close)|Call this method to release the [`m_hKey`](#m_hkey) member handle and set it to `NULL`.|
+|[`CRegKey::Create`](#create)|Call this method to create the specified key, if it doesn't exist as a subkey of `hKeyParent`.|
+|[`CRegKey::DeleteSubKey`](#deletesubkey)|Call this method to remove the specified key from the registry.|
+|[`CRegKey::DeleteValue`](#deletevalue)|Call this method to remove a value field from [`m_hKey`](#m_hkey).|
+|[`CRegKey::Detach`](#detach)|Call this method to detach the [`m_hKey`](#m_hkey) member handle from the `CRegKey` object and set `m_hKey` to `NULL`.|
+|[`CRegKey::EnumKey`](#enumkey)|Call this method to enumerate the subkeys of the open registry key.|
+|[`CRegKey::Flush`](#flush)|Call this method to write all of the attributes of the open registry key into the registry.|
+|[`CRegKey::GetKeySecurity`](#getkeysecurity)|Call this method to retrieve a copy of the security descriptor protecting the open registry key.|
+|[`CRegKey::NotifyChangeKeyValue`](#notifychangekeyvalue)|This method notifies the caller about changes to the attributes or contents of the open registry key.|
+|[`CRegKey::Open`](#open)|Call this method to open the specified key and set [`m_hKey`](#m_hkey) to the handle of this key.|
+|[`CRegKey::QueryBinaryValue`](#querybinaryvalue)|Call this method to retrieve the binary data for a specified value name.|
+|[`CRegKey::QueryDWORDValue`](#querydwordvalue)|Call this method to retrieve the `DWORD` data for a specified value name.|
+|[`CRegKey::QueryGUIDValue`](#queryguidvalue)|Call this method to retrieve the GUID data for a specified value name.|
+|[`CRegKey::QueryMultiStringValue`](#querymultistringvalue)|Call this method to retrieve the multistring data for a specified value name.|
+|[`CRegKey::QueryQWORDValue`](#queryqwordvalue)|Call this method to retrieve the `QWORD` data for a specified value name.|
+|[`CRegKey::QueryStringValue`](#querystringvalue)|Call this method to retrieve the string data for a specified value name.|
+|[`CRegKey::QueryValue`](#queryvalue)|Call this method to retrieve the data for the specified value field of [`m_hKey`](#m_hkey). Earlier versions of this method are no longer supported and are marked as `ATL_DEPRECATED`.|
+|[`CRegKey::RecurseDeleteKey`](#recursedeletekey)|Call this method to remove the specified key from the registry and explicitly remove any subkeys.|
+|[`CRegKey::SetBinaryValue`](#setbinaryvalue)|Call this method to set the binary value of the registry key.|
+|[`CRegKey::SetDWORDValue`](#setdwordvalue)|Call this method to set the `DWORD` value of the registry key.|
+|[`CRegKey::SetGUIDValue`](#setguidvalue)|Call this method to set the GUID value of the registry key.|
+|[`CRegKey::SetKeySecurity`](#setkeysecurity)|Call this method to set the security of the registry key.|
+|[`CRegKey::SetKeyValue`](#setkeyvalue)|Call this method to store data in a specified value field of a specified key.|
+|[`CRegKey::SetMultiStringValue`](#setmultistringvalue)|Call this method to set the multistring value of the registry key.|
+|[`CRegKey::SetQWORDValue`](#setqwordvalue)|Call this method to set the `QWORD` value of the registry key.|
+|[`CRegKey::SetStringValue`](#setstringvalue)|Call this method to set the string value of the registry key.|
+|[`CRegKey::SetValue`](#setvalue)|Call this method to store data in the specified value field of [`m_hKey`](#m_hkey). Earlier versions of this method are no longer supported and are marked as `ATL_DEPRECATED`.|
### Public Operators
|Name|Description|
|----------|-----------------|
-|[CRegKey::operator HKEY](#operator_hkey)|Converts a `CRegKey` object to an HKEY.|
-|[CRegKey::operator =](#operator_eq)|Assignment operator.|
+|[`CRegKey::operator HKEY`](#operator_hkey)|Converts a `CRegKey` object to an `HKEY`.|
+|[`CRegKey::operator =`](#operator_eq)|Assignment operator.|
### Public Data Members
|Name|Description|
|----------|-----------------|
-|[CRegKey::m_hKey](#m_hkey)|Contains a handle of the registry key associated with the `CRegKey` object.|
-|[CRegKey::m_pTM](#m_ptm)|Pointer to `CAtlTransactionManager` object|
+|[`CRegKey::m_hKey`](#m_hkey)|Contains a handle of the registry key associated with the `CRegKey` object.|
+|[`CRegKey::m_pTM`](#m_ptm)|Pointer to `CAtlTransactionManager` object|
## Remarks
@@ -81,18 +80,18 @@ class CRegKey
`CRegKey` provides a programming interface to the system registry for a given machine. For example, to open a particular registry key, call `CRegKey::Open`. To retrieve or modify a data value, call `CRegKey::QueryValue` or `CRegKey::SetValue`, respectively. To close a key, call `CRegKey::Close`.
-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.
+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.
> [!IMPORTANT]
-> 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.
+> 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.
## Requirements
-**Header:** atlbase.h
+**Header:** `atlbase.h`
-## CRegKey::Attach
+## `CRegKey::Attach`
-Call this method to attach an HKEY to the `CRegKey` object by setting the [m_hKey](#m_hkey) member handle to *hKey*.
+Call this method to attach an `HKEY` to the `CRegKey` object by setting the [`m_hKey`](#m_hkey) member handle to *`hKey`*.
```cpp
void Attach(HKEY hKey) throw();
@@ -100,16 +99,16 @@ void Attach(HKEY hKey) throw();
### Parameters
-*hKey*
+`hKey`\
The handle of a registry key.
### Remarks
-`Attach` will assert if `m_hKey` is non-NULL.
+`Attach` will assert if `m_hKey` is non-`NULL`.
-## CRegKey::Close
+## `CRegKey::Close`
-Call this method to release the [m_hKey](#m_hkey) member handle and set it to NULL.
+Call this method to release the [`m_hKey`](#m_hkey) member handle and set it to `NULL`.
```
LONG Close() throw();
@@ -117,11 +116,11 @@ LONG Close() throw();
### Return Value
-If successful, returns ERROR_SUCCESS; otherwise returns an error value.
+If successful, returns `ERROR_SUCCESS`; otherwise returns an error value.
-## CRegKey::Create
+## `CRegKey::Create`
-Call this method to create the specified key, if it does not exist as a subkey of *hKeyParent*.
+Call this method to create the specified key, if it doesn't exist as a subkey of *`hKeyParent`*.
```
LONG Create(
@@ -136,36 +135,36 @@ LONG Create(
### Parameters
-*hKeyParent*
+*`hKeyParent`*\
The handle of an open key.
-*lpszKeyName*
-Specifies the name of a key to be created or opened. This name must be a subkey of *hKeyParent*.
+*`lpszKeyName`*\
+Specifies the name of a key to be created or opened. This name must be a subkey of *`hKeyParent`*.
-*lpszClass*
+*`lpszClass`*\
Specifies the class of the key to be created or opened. The default value is REG_NONE.
-*dwOptions*
-Options for the key. The default value is REG_OPTION_NON_VOLATILE. For a list of possible values and descriptions, see [RegCreateKeyEx](/windows/win32/api/winreg/nf-winreg-regcreatekeyexw) in the Windows SDK.
+*`dwOptions`*\
+Options for the key. The default value is `REG_OPTION_NON_VOLATILE`. For a list of possible values and descriptions, see [`RegCreateKeyEx`](/windows/win32/api/winreg/nf-winreg-regcreatekeyexw) in the Windows SDK.
-*samDesired*
-The security access for the key. The default value is KEY_READ | KEY_WRITE. For a list of possible values and descriptions, see `RegCreateKeyEx`.
+*`samDesired`*\
+The security access for the key. The default value is `KEY_READ | KEY_WRITE`. For a list of possible values and descriptions, see `RegCreateKeyEx`.
-*lpSecAttr*
-A pointer to a [SECURITY_ATTRIBUTES](/previous-versions/windows/desktop/legacy/aa379560\(v=vs.85\)) structure that indicates whether the handle of the key can be inherited by a child process. By default, this parameter is NULL (meaning the handle cannot be inherited).
+*`lpSecAttr`*\
+A pointer to a [`SECURITY_ATTRIBUTES`](/previous-versions/windows/desktop/legacy/aa379560\(v=vs.85\)) structure that indicates whether the handle of the key can be inherited by a child process. By default, this parameter is `NULL` (meaning the handle can't be inherited).
-*lpdwDisposition*
-[out] If non-NULL, retrieves either REG_CREATED_NEW_KEY (if the key did not exist and was created) or REG_OPENED_EXISTING_KEY (if the key existed and was opened).
+*`lpdwDisposition`*\
+[out] If non-`NULL`, retrieves either `REG_CREATED_NEW_KEY` (if the key didn't exist and was created) or `REG_OPENED_EXISTING_KEY` (if the key existed and was opened).
### Return Value
-If successful, returns ERROR_SUCCESS and opens the key. If the method fails, the return value is a nonzero error code defined in WINERROR.H.
+If successful, returns `ERROR_SUCCESS` and opens the key. If the method fails, the return value is a nonzero error code defined in `WINERROR.H`.
### Remarks
-`Create` sets the [m_hKey](#m_hkey) member to the handle of this key.
+`Create` sets the [`m_hKey`](#m_hkey) member to the handle of this key.
-## CRegKey::CRegKey
+## `CRegKey::CRegKey`
The constructor.
@@ -178,20 +177,20 @@ CRegKey(CAtlTransactionManager* pTM) throw();
### Parameters
-*key*
+*`key`*\
A reference to a `CRegKey` object.
-*hKey*
+`hKey`\
A handle to a registry key.
-*pTM*
-Pointer to CAtlTransactionManager object
+*`pTM`*\
+Pointer to `CAtlTransactionManager` object
### Remarks
Creates a new `CRegKey` object. The object can be created from an existing `CRegKey` object, or from a handle to a registry key.
-## CRegKey::~CRegKey
+## `CRegKey::~CRegKey`
The destructor.
@@ -203,7 +202,7 @@ The destructor.
The destructor releases `m_hKey`.
-## CRegKey::DeleteSubKey
+## `CRegKey::DeleteSubKey`
Call this method to remove the specified key from the registry.
@@ -213,20 +212,20 @@ LONG DeleteSubKey(LPCTSTR lpszSubKey) throw();
### Parameters
-*lpszSubKey*
-Specifies the name of the key to delete. This name must be a subkey of [m_hKey](#m_hkey).
+*`lpszSubKey`*\
+Specifies the name of the key to delete. This name must be a subkey of [`m_hKey`](#m_hkey).
### Return Value
-If successful, returns ERROR_SUCCESS. If the method fails, the return value is a nonzero error code defined in WINERROR.H.
+If successful, returns `ERROR_SUCCESS`. If the method fails, the return value is a nonzero error code defined in `WINERROR.H`.
### Remarks
-`DeleteSubKey` can only delete a key that has no subkeys. If the key has subkeys, call [RecurseDeleteKey](#recursedeletekey) instead.
+`DeleteSubKey` can only delete a key that has no subkeys. If the key has subkeys, call [`RecurseDeleteKey`](#recursedeletekey) instead.
-## CRegKey::DeleteValue
+## `CRegKey::DeleteValue`
-Call this method to remove a value field from [m_hKey](#m_hkey).
+Call this method to remove a value field from [`m_hKey`](#m_hkey).
```
LONG DeleteValue(LPCTSTR lpszValue) throw();
@@ -234,16 +233,16 @@ LONG DeleteValue(LPCTSTR lpszValue) throw();
### Parameters
-*lpszValue*
+*`lpszValue`*\
Specifies the value field to remove.
### Return Value
-If successful, returns ERROR_SUCCESS. If the method fails, the return value is a nonzero error code defined in WINERROR.H.
+If successful, returns `ERROR_SUCCESS`. If the method fails, the return value is a nonzero error code defined in `WINERROR.H`.
-## CRegKey::Detach
+## `CRegKey::Detach`
-Call this method to detach the [m_hKey](#m_hkey) member handle from the `CRegKey` object and set `m_hKey` to NULL.
+Call this method to detach the [`m_hKey`](#m_hkey) member handle from the `CRegKey` object and set `m_hKey` to `NULL`.
```
HKEY Detach() throw();
@@ -253,7 +252,7 @@ HKEY Detach() throw();
The HKEY associated with the `CRegKey` object.
-## CRegKey::EnumKey
+## `CRegKey::EnumKey`
Call this method to enumerate the subkeys of the open registry key.
@@ -267,27 +266,27 @@ LONG EnumKey(
### Parameters
-*iIndex*
+*`iIndex`*\
The subkey index. This parameter should be zero for the first call and then incremented for subsequent calls
-*pszName*
+*`pszName`*\
Pointer to a buffer that receives the name of the subkey, including the terminating null character. Only the name of the subkey is copied to the buffer, not the full key hierarchy.
-*pnNameLength*
-Pointer to a variable that specifies the size, in TCHARs, of the buffer specified by the *pszName* parameter. This size should include the terminating null character. When the method returns, the variable pointed to by *pnNameLength* contains the number of characters stored in the buffer. The count returned does not include the terminating null character.
+*`pnNameLength`*\
+Pointer to a variable that specifies the size, in `TCHARs`, of the buffer specified by the *`pszName`* parameter. This size should include the terminating null character. When the method returns, the variable pointed to by *`pnNameLength`* contains the number of characters stored in the buffer. The count returned doesn't include the terminating null character.
-*pftLastWriteTime*
+*`pftLastWriteTime`*\
Pointer to a variable that receives the time the enumerated subkey was last written to.
### Return Value
-If the method succeeds, the return value is ERROR_SUCCESS. If the method fails, the return value is a nonzero error code defined in WINERROR.H.
+If the method succeeds, the return value is `ERROR_SUCCESS`. If the method fails, the return value is a nonzero error code defined in `WINERROR.H`.
### Remarks
-To enumerate the subkeys, call `CRegKey::EnumKey` with an index of zero. Increment the index value and repeat until the method returns ERROR_NO_MORE_ITEMS. For more information, see [RegEnumKeyEx](/windows/win32/api/winreg/nf-winreg-regenumkeyexw) in the Windows SDK.
+To enumerate the subkeys, call `CRegKey::EnumKey` with an index of zero. Increment the index value and repeat until the method returns `ERROR_NO_MORE_ITEMS`. For more information, see [`RegEnumKeyEx`](/windows/win32/api/winreg/nf-winreg-regenumkeyexw) in the Windows SDK.
-## CRegKey::Flush
+## `CRegKey::Flush`
Call this method to write all of the attributes of the open registry key into the registry.
@@ -297,13 +296,13 @@ LONG Flush() throw();
### Return Value
-If the method succeeds, the return value is ERROR_SUCCESS. If the method fails, the return value is a nonzero error code defined in WINERROR.H.
+If the method succeeds, the return value is `ERROR_SUCCESS`. If the method fails, the return value is a nonzero error code defined in `WINERROR.H`.
### Remarks
-For more information, see [RegEnumFlush](/windows/win32/api/winreg/nf-winreg-regflushkey) in the Windows SDK.
+For more information, see [`RegEnumFlush`](/windows/win32/api/winreg/nf-winreg-regflushkey) in the Windows SDK.
-## CRegKey::GetKeySecurity
+## `CRegKey::GetKeySecurity`
Call this method to retrieve a copy of the security descriptor protecting the open registry key.
@@ -316,24 +315,24 @@ LONG GetKeySecurity(
### Parameters
-*si*
-The [SECURITY_INFORMATION](/windows/win32/SecAuthZ/security-information) value that indicates the requested security information.
+*`si`*\
+The [`SECURITY_INFORMATION`](/windows/win32/SecAuthZ/security-information) value that indicates the requested security information.
-*psd*
+*`psd`*\
A pointer to a buffer that receives a copy of the requested security descriptor.
-*pnBytes*
-The size, in bytes, of the buffer pointed to by *psd*.
+*`pnBytes`*\
+The size, in bytes, of the buffer pointed to by *`psd`*.
### Return Value
-If the method succeeds, the return value is ERROR_SUCCESS. If the method fails, the return value is a nonzero error code is defined in WINERROR.H.
+If the method succeeds, the return value is `ERROR_SUCCESS`. If the method fails, the return value is a nonzero error code is defined in `WINERROR.H`.
### Remarks
-For more information, see [RegGetKeySecurity](/windows/win32/api/winreg/nf-winreg-reggetkeysecurity).
+For more information, see [`RegGetKeySecurity`](/windows/win32/api/winreg/nf-winreg-reggetkeysecurity).
-## CRegKey::m_hKey
+## `CRegKey::m_hKey`
Contains a handle of the registry key associated with the `CRegKey` object.
@@ -341,7 +340,7 @@ Contains a handle of the registry key associated with the `CRegKey` object.
HKEY m_hKey;
```
-## CRegKey::m_pTM
+## `CRegKey::m_pTM`
Pointer to a `CAtlTransactionManager` object.
@@ -351,7 +350,7 @@ CAtlTransactionManager* m_pTM;
### Remarks
-## CRegKey::NotifyChangeKeyValue
+## `CRegKey::NotifyChangeKeyValue`
This method notifies the caller about changes to the attributes or contents of the open registry key.
@@ -365,39 +364,39 @@ LONG NotifyChangeKeyValue(
### Parameters
-*bWatchSubtree*
-Specifies a flag that indicates whether to report changes in the specified key and all of its subkeys or only in the specified key. If this parameter is TRUE, the method reports changes in the key and its subkeys. If the parameter is FALSE, the method reports changes only in the key.
+*`bWatchSubtree`*\
+Specifies a flag that indicates whether to report changes in the specified key and all of its subkeys or only in the specified key. If this parameter is `TRUE`, the method reports changes in the key and its subkeys. If the parameter is `FALSE`, the method reports changes only in the key.
-*dwNotifyFilter*
+*`dwNotifyFilter`*\
Specifies a set of flags that control which changes should be reported. This parameter can be a combination of the following values:
|Value|Meaning|
|-----------|-------------|
-|REG_NOTIFY_CHANGE_NAME|Notify the caller if a subkey is added or deleted.|
-|REG_NOTIFY_CHANGE_ATTRIBUTES|Notify the caller of changes to the attributes of the key, such as the security descriptor information.|
-|REG_NOTIFY_CHANGE_LAST_SET|Notify the caller of changes to a value of the key. This can include adding or deleting a value, or changing an existing value.|
-|REG_NOTIFY_CHANGE_SECURITY|Notify the caller of changes to the security descriptor of the key.|
+|`REG_NOTIFY_CHANGE_NAME`|Notify the caller if a subkey is added or deleted.|
+|`REG_NOTIFY_CHANGE_ATTRIBUTES`|Notify the caller of changes to the attributes of the key, such as the security descriptor information.|
+|`REG_NOTIFY_CHANGE_LAST_SET`|Notify the caller of changes to a value of the key. This can include adding or deleting a value, or changing an existing value.|
+|`REG_NOTIFY_CHANGE_SECURITY`|Notify the caller of changes to the security descriptor of the key.|
-*hEvent*
-Handle to an event. If the *bAsync* parameter is TRUE, the method returns immediately and changes are reported by signaling this event. If *bAsync* is FALSE, *hEvent* is ignored.
+*`hEvent`*\
+Handle to an event. If the *`bAsync`* parameter is `TRUE`, the method returns immediately and changes are reported by signaling this event. If *`bAsync`* is `FALSE`, *`hEvent`* is ignored.
-*bAsync*
-Specifies a flag that indicates how the method reports changes. If this parameter is TRUE, the method returns immediately and reports changes by signaling the specified event. When this parameter is FALSE, the method does not return until a change has occurred. If *hEvent* does not specify a valid event, the *bAsync* parameter cannot be TRUE.
+*`bAsync`*\
+Specifies a flag that indicates how the method reports changes. If this parameter is `TRUE`, the method returns immediately and reports changes by signaling the specified event. When this parameter is `FALSE`, the method doesn't return until a change has occurred. If *`hEvent`* doesn't specify a valid event, the *`bAsync`* parameter can't be `TRUE`.
### Return Value
-If the method succeeds, the return value is ERROR_SUCCESS. If the method fails, the return value is a nonzero error code defined in WINERROR.H.
+If the method succeeds, the return value is `ERROR_SUCCESS`. If the method fails, the return value is a nonzero error code defined in `WINERROR.H`.
### Remarks
> [!NOTE]
> This method does not notify the caller if the specified key is deleted.
-For more details and a sample program, see [RegNotifyChangeKeyValue](/windows/win32/api/winreg/nf-winreg-regnotifychangekeyvalue).
+For more details and a sample program, see [`RegNotifyChangeKeyValue`](/windows/win32/api/winreg/nf-winreg-regnotifychangekeyvalue).
-## CRegKey::Open
+## `CRegKey::Open`
-Call this method to open the specified key and set [m_hKey](#m_hkey) to the handle of this key.
+Call this method to open the specified key and set [`m_hKey`](#m_hkey) to the handle of this key.
```
LONG Open(
@@ -408,34 +407,34 @@ LONG Open(
### Parameters
-*hKeyParent*
+*`hKeyParent`*\
The handle of an open key.
-*lpszKeyName*
-Specifies the name of a key to be created or opened. This name must be a subkey of *hKeyParent*.
+*`lpszKeyName`*\
+Specifies the name of a key to be created or opened. This name must be a subkey of *`hKeyParent`*.
-*samDesired*
-The security access for the key. The default value is KEY_ALL_ACCESS. For a list of possible values and descriptions, see [RegCreateKeyEx](/windows/win32/api/winreg/nf-winreg-regcreatekeyexw) in the Windows SDK.
+*`samDesired`*\
+The security access for the key. The default value is `KEY_ALL_ACCESS`. For a list of possible values and descriptions, see [`RegCreateKeyEx`](/windows/win32/api/winreg/nf-winreg-regcreatekeyexw) in the Windows SDK.
### Return Value
-If successful, returns ERROR_SUCCESS; otherwise, a non-zero error value defined in WINERROR.H.
+If successful, returns `ERROR_SUCCESS`; otherwise, a non-zero error value defined in `WINERROR.H`.
### Remarks
-If the *lpszKeyName* parameter is NULL or points to an empty string, `Open` opens a new handle of the key identified by *hKeyParent*, but does not close any previously opened handle.
+If the *`lpszKeyName`* parameter is `NULL` or points to an empty string, `Open` opens a new handle of the key identified by *`hKeyParent`*, but doesn't close any previously opened handle.
-Unlike [CRegKey::Create](#create), `Open` will not create the specified key if it does not exist.
+Unlike [`CRegKey::Create`](#create), `Open` won't create the specified key if it doesn't exist.
-## CRegKey::operator HKEY
+## `CRegKey::operator HKEY`
-Converts a `CRegKey` object to an HKEY.
+Converts a `CRegKey` object to an `HKEY`.
```
operator HKEY() const throw();
```
-## CRegKey::operator =
+## `CRegKey::operator =`
Assignment operator.
@@ -445,7 +444,7 @@ CRegKey& operator= (CRegKey& key) throw();
### Parameters
-*key*
+*`key`*\
The key to copy.
### Return Value
@@ -454,9 +453,9 @@ Returns a reference to the new key.
### Remarks
-This operator detaches *key* from its current object and assigns it to the `CRegKey` object instead.
+This operator detaches *`key`* from its current object and assigns it to the `CRegKey` object instead.
-## CRegKey::QueryBinaryValue
+## `CRegKey::QueryBinaryValue`
Call this method to retrieve the binary data for a specified value name.
@@ -469,29 +468,29 @@ LONG QueryBinaryValue(
### Parameters
-*pszValueName*
-Pointer to a null-terminated string containing the name of the value to query.
+*`pszValueName`*\
+Pointer to a `NULL`-terminated string containing the name of the value to query.
-*pValue*
+*`pValue`*\
Pointer to a buffer that receives the value's data.
-*pnBytes*
-Pointer to a variable that specifies the size, in bytes, of the buffer pointed to by the *pValue* parameter. When the method returns, this variable contains the size of the data copied to the buffer.
+*`pnBytes`*\
+Pointer to a variable that specifies the size, in bytes, of the buffer pointed to by the *`pValue`* parameter. When the method returns, this variable contains the size of the data copied to the buffer.
### Return Value
-If the method succeeds, ERROR_SUCCESS is returned. If the method fails to read a value, it returns a nonzero error code defined in WINERROR.H. If the data referenced is not of type REG_BINARY, ERROR_INVALID_DATA is returned.
+If the method succeeds, `ERROR_SUCCESS` is returned. If the method fails to read a value, it returns a nonzero error code defined in `WINERROR.H`. If the data referenced isn't of type `REG_BINARY`, `ERROR_INVALID_DATA` is returned.
### Remarks
-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.
+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.
> [!IMPORTANT]
-> 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.
+> 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.
-## CRegKey::QueryDWORDValue
+## `CRegKey::QueryDWORDValue`
-Call this method to retrieve the DWORD data for a specified value name.
+Call this method to retrieve the `DWORD` data for a specified value name.
```
LONG QueryDWORDValue(
@@ -501,24 +500,24 @@ LONG QueryDWORDValue(
### Parameters
-*pszValueName*
-Pointer to a null-terminated string containing the name of the value to query.
+*`pszValueName`*\
+Pointer to a `NULL`-terminated string containing the name of the value to query.
-*dwValue*
-Pointer to a buffer that receives the DWORD.
+*`dwValue`*\
+Pointer to a buffer that receives the `DWORD`.
### Return Value
-If the method succeeds, ERROR_SUCCESS is returned. If the method fails to read a value, it returns a nonzero error code defined in WINERROR.H. If the data referenced is not of type REG_DWORD, ERROR_INVALID_DATA is returned.
+If the method succeeds, `ERROR_SUCCESS` is returned. If the method fails to read a value, it returns a nonzero error code defined in `WINERROR.H`. If the data referenced isn't of type `REG_DWORD`, `ERROR_INVALID_DATA` is returned.
### Remarks
-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.
+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.
> [!IMPORTANT]
-> 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.
+> 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.
-## CRegKey::QueryGUIDValue
+## `CRegKey::QueryGUIDValue`
Call this method to retrieve the GUID data for a specified value name.
@@ -530,24 +529,24 @@ LONG QueryGUIDValue(
### Parameters
-*pszValueName*
-Pointer to a null-terminated string containing the name of the value to query.
+*`pszValueName`*\
+Pointer to a `NULL`-terminated string containing the name of the value to query.
-*guidValue*
+*`guidValue`*\
Pointer to a variable that receives the GUID.
### Return Value
-If the method succeeds, ERROR_SUCCESS is returned. If the method fails to read a value, it returns a nonzero error code defined in WINERROR.H. If the data referenced is not a valid GUID, ERROR_INVALID_DATA is returned.
+If the method succeeds, `ERROR_SUCCESS` is returned. If the method fails to read a value, it returns a nonzero error code defined in `WINERROR.H`. If the data referenced isn't a valid GUID, `ERROR_INVALID_DATA` is returned.
### Remarks
-This method makes use of `CRegKey::QueryStringValue` and converts the string into a GUID using [CLSIDFromString](/windows/win32/api/combaseapi/nf-combaseapi-clsidfromstring).
+This method makes use of `CRegKey::QueryStringValue` and converts the string into a GUID using [`CLSIDFromString`](/windows/win32/api/combaseapi/nf-combaseapi-clsidfromstring).
> [!IMPORTANT]
> This method allows the caller to specify any registry location, potentially reading data which cannot be trusted.
-## CRegKey::QueryMultiStringValue
+## `CRegKey::QueryMultiStringValue`
Call this method to retrieve the multistring data for a specified value name.
@@ -560,29 +559,29 @@ LONG QueryMultiStringValue(
### Parameters
-*pszValueName*
-Pointer to a null-terminated string containing the name of the value to query.
+*`pszValueName`*\
+Pointer to a `NULL`-terminated string containing the name of the value to query.
-*pszValue*
-Pointer to a buffer that receives the multistring data. A multistring is an array of null-terminated strings, terminated by two null characters.
+*`pszValue`*\
+Pointer to a buffer that receives the multistring data. A multistring is an array of `NULL`-terminated strings, terminated by two null characters.
-*pnChars*
-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.
+*`pnChars`*\
+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.
### Return Value
-If the method succeeds, ERROR_SUCCESS is returned. If the method fails to read a value, it returns a nonzero error code defined in WINERROR.H. If the data referenced is not of type REG_MULTI_SZ, ERROR_INVALID_DATA is returned.
+If the method succeeds, `ERROR_SUCCESS` is returned. If the method fails to read a value, it returns a nonzero error code defined in `WINERROR.H`. If the data referenced isn't of type `REG_MULTI_SZ`, `ERROR_INVALID_DATA` is returned.
### Remarks
-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.
+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.
> [!IMPORTANT]
-> 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.
+> 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.
-## CRegKey::QueryQWORDValue
+## `CRegKey::QueryQWORDValue`
-Call this method to retrieve the QWORD data for a specified value name.
+Call this method to retrieve the `QWORD` data for a specified value name.
```
LONG QueryQWORDValue(
@@ -592,24 +591,24 @@ LONG QueryQWORDValue(
### Parameters
-*pszValueName*
-Pointer to a null-terminated string containing the name of the value to query.
+*`pszValueName`*\
+Pointer to a `NULL`-terminated string containing the name of the value to query.
-*qwValue*
-Pointer to a buffer that receives the QWORD.
+*`qwValue`*\
+Pointer to a buffer that receives the `QWORD`.
### Return Value
-If the method succeeds, ERROR_SUCCESS is returned. If the method fails to read a value, it returns a nonzero error code defined in WINERROR.H. If the data referenced is not of type REG_QWORD, ERROR_INVALID_DATA is returned.
+If the method succeeds, `ERROR_SUCCESS` is returned. If the method fails to read a value, it returns a nonzero error code defined in `WINERROR.H`. If the data referenced isn't of type `REG_QWORD`, `ERROR_INVALID_DATA` is returned.
### Remarks
-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.
+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.
> [!IMPORTANT]
-> 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.
+> 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.
-## CRegKey::QueryStringValue
+## `CRegKey::QueryStringValue`
Call this method to retrieve the string data for a specified value name.
@@ -622,29 +621,29 @@ LONG QueryStringValue(
### Parameters
-*pszValueName*
-Pointer to a null-terminated string containing the name of the value to query.
+*`pszValueName`*\
+Pointer to a `NULL`-terminated string containing the name of the value to query.
-*pszValue*
+*`pszValue`*\
Pointer to a buffer that receives the string data.
-*pnChars*
-The size, in TCHARs, of the buffer pointed to by *pszValue*. When the method returns, *pnChars* contains the size, in TCHARs, of the string retrieved, including a terminating null character.
+*`pnChars`*\
+The size, in TCHARs, of the buffer pointed to by *`pszValue`*. When the method returns, *`pnChars`* contains the size, in `TCHARs`, of the string retrieved, including a terminating null character.
### Return Value
-If the method succeeds, ERROR_SUCCESS is returned. If the method fails to read a value, it returns a nonzero error code defined in WINERROR.H. If the data referenced is not of type REG_SZ, ERROR_INVALID_DATA is returned. If the method returns ERROR_MORE_DATA, *pnChars* equals zero, not the required buffer size in bytes.
+If the method succeeds, `ERROR_SUCCESS` is returned. If the method fails to read a value, it returns a nonzero error code defined in `WINERROR.H`. If the data referenced isn't of type `REG_SZ`, `ERROR_INVALID_DATA` is returned. If the method returns `ERROR_MORE_DATA`, *`pnChars`* equals zero, not the required buffer size in bytes.
### Remarks
-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.
+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.
> [!IMPORTANT]
-> 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.
+> 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.
-## CRegKey::QueryValue
+## `CRegKey::QueryValue`
-Call this method to retrieve the data for the specified value field of [m_hKey](#m_hkey). Earlier versions of this method are no longer supported and are marked as ATL_DEPRECATED.
+Call this method to retrieve the data for the specified value field of [`m_hKey`](#m_hkey). Earlier versions of this method are no longer supported and are marked as `ATL_DEPRECATED`.
```
LONG QueryValue(
@@ -665,44 +664,44 @@ ATL_DEPRECATED LONG QueryValue(
### Parameters
-*pszValueName*
-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.
+*`pszValueName`*\
+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.
-*pdwType*
-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 is not required.
+*`pdwType`*\
+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.
-*pData*
-Pointer to a buffer that receives the value's data. This parameter can be NULL if the data is not required.
+*`pData`*\
+Pointer to a buffer that receives the value's data. This parameter can be `NULL` if the data isn't required.
-*pnBytes*
-Pointer to a variable that specifies the size, in bytes, of the buffer pointed to by the *pData* parameter. When the method returns, this variable contains the size of the data copied to *pData.*
+*`pnBytes`*\
+Pointer to a variable that specifies the size, in bytes, of the buffer pointed to by the *`pData`* parameter. When the method returns, this variable contains the size of the data copied to *`pData`*.
-*dwValue*
+*`dwValue`*\
The value field's numerical data.
-*lpszValueName*
+*`lpszValueName`*\
Specifies the value field to be queried.
-*szValue*
+*`szValue`*\
The value field's string data.
-*pdwCount*
-The size of the string data. Its value is initially set to the size of the *szValue* buffer.
+*`pdwCount`*\
+The size of the string data. Its value is initially set to the size of the *`szValue`* buffer.
### Return Value
-If successful, returns ERROR_SUCCESS; otherwise, a nonzero error code defined in WINERROR.H.
+If successful, returns `ERROR_SUCCESS`; otherwise, a nonzero error code defined in `WINERROR.H`.
### Remarks
-The two original versions of `QueryValue` are no longer supported and are marked as ATL_DEPRECATED. The compiler will issue a warning if these forms are used.
+The two original versions of `QueryValue` are no longer supported and are marked as `ATL_DEPRECATED`. The compiler will issue a warning if these forms are used.
-The remaining method calls RegQueryValueEx.
+The remaining method calls `RegQueryValueEx`.
> [!IMPORTANT]
-> 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.
+> 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.
-## CRegKey::RecurseDeleteKey
+## `CRegKey::RecurseDeleteKey`
Call this method to remove the specified key from the registry and explicitly remove any subkeys.
@@ -712,18 +711,18 @@ LONG RecurseDeleteKey(LPCTSTR lpszKey) throw();
### Parameters
-*lpszKey*
-Specifies the name of the key to delete. This name must be a subkey of [m_hKey](#m_hkey).
+*`lpszKey`*\
+Specifies the name of the key to delete. This name must be a subkey of [`m_hKey`](#m_hkey).
### Return Value
-If successful, returns ERROR_SUCCESS; otherwise, a non-zero error value defined in WINERROR.H.
+If successful, returns `ERROR_SUCCESS`; otherwise, a non-zero error value defined in `WINERROR.H`.
### Remarks
If the key has subkeys, you must call this method to delete the key.
-## CRegKey::SetBinaryValue
+## `CRegKey::SetBinaryValue`
Call this method to set the binary value of the registry key.
@@ -736,26 +735,26 @@ LONG SetBinaryValue(
### Parameters
-*pszValueName*
-Pointer to a string containing the name of the value to set. If a value with this name is not already present, the method adds it to the key.
+*`pszValueName`*\
+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.
-*pValue*
+*`pValue`*\
Pointer to a buffer containing the data to be stored with the specified value name.
-*nBytes*
-Specifies the size, in bytes, of the information pointed to by the *pValue* parameter.
+*`nBytes`*\
+Specifies the size, in bytes, of the information pointed to by the *`pValue`* parameter.
### Return Value
-If the method succeeds, the return value is ERROR_SUCCESS. If the method fails, the return value is a nonzero error code defined in WINERROR.H.
+If the method succeeds, the return value is `ERROR_SUCCESS`. If the method fails, the return value is a nonzero error code defined in `WINERROR.H`.
### Remarks
-This method uses [RegSetValueEx](/windows/win32/api/winreg/nf-winreg-regsetvalueexw) to write the value to the registry.
+This method uses [`RegSetValueEx`](/windows/win32/api/winreg/nf-winreg-regsetvalueexw) to write the value to the registry.
-## CRegKey::SetDWORDValue
+## `CRegKey::SetDWORDValue`
-Call this method to set the DWORD value of the registry key.
+Call this method to set the `DWORD` value of the registry key.
```
LONG SetDWORDValue(LPCTSTR pszValueName, DWORD dwValue) throw();
@@ -763,21 +762,21 @@ LONG SetDWORDValue(LPCTSTR pszValueName, DWORD dwValue) throw();
### Parameters
-*pszValueName*
-Pointer to a string containing the name of the value to set. If a value with this name is not already present, the method adds it to the key.
+*`pszValueName`*\
+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.
-*dwValue*
-The DWORD data to be stored with the specified value name.
+*`dwValue`*\
+The `DWORD` data to be stored with the specified value name.
### Return Value
-If the method succeeds, the return value is ERROR_SUCCESS. If the method fails, the return value is a nonzero error code defined in WINERROR.H.
+If the method succeeds, the return value is `ERROR_SUCCESS`. If the method fails, the return value is a nonzero error code defined in `WINERROR.H`.
### Remarks
-This method uses [RegSetValueEx](/windows/win32/api/winreg/nf-winreg-regsetvalueexw) to write the value to the registry.
+This method uses [`RegSetValueEx`](/windows/win32/api/winreg/nf-winreg-regsetvalueexw) to write the value to the registry.
-## CRegKey::SetGUIDValue
+## `CRegKey::SetGUIDValue`
Call this method to set the GUID value of the registry key.
@@ -787,21 +786,21 @@ LONG SetGUIDValue(LPCTSTR pszValueName, REFGUID guidValue) throw();
### Parameters
-*pszValueName*
-Pointer to a string containing the name of the value to set. If a value with this name is not already present, the method adds it to the key.
+*`pszValueName`*\
+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.
-*guidValue*
+*`guidValue`*\
Reference to the GUID to be stored with the specified value name.
### Return Value
-If the method succeeds, the return value is ERROR_SUCCESS. If the method fails, the return value is a nonzero error code defined in WINERROR.H.
+If the method succeeds, the return value is `ERROR_SUCCESS`. If the method fails, the return value is a nonzero error code defined in `WINERROR.H`.
### Remarks
-This method makes use of `CRegKey::SetStringValue` and converts the GUID into a string using [StringFromGUID2](/windows/win32/api/combaseapi/nf-combaseapi-stringfromguid2).
+This method makes use of `CRegKey::SetStringValue` and converts the GUID into a string using [`StringFromGUID2`](/windows/win32/api/combaseapi/nf-combaseapi-stringfromguid2).
-## CRegKey::SetKeyValue
+## `CRegKey::SetKeyValue`
Call this method to store data in a specified value field of a specified key.
@@ -814,24 +813,24 @@ LONG SetKeyValue(
### Parameters
-*lpszKeyName*
-Specifies the name of the key to be created or opened. This name must be a subkey of [m_hKey](#m_hkey).
+*`lpszKeyName`*\
+Specifies the name of the key to be created or opened. This name must be a subkey of [`m_hKey`](#m_hkey).
-*lpszValue*
-Specifies the data to be stored. This parameter must be non-NULL.
+*`lpszValue`*\
+Specifies the data to be stored. This parameter must be non-`NULL`.
-*lpszValueName*
-Specifies the value field to be set. If a value field with this name does not already exist in the key, it is added.
+*`lpszValueName`*\
+Specifies the value field to be set. If a value field with this name doesn't already exist in the key, it's added.
### Return Value
-If successful, returns ERROR_SUCCESS; otherwise, a nonzero error code defined in WINERROR.H.
+If successful, returns `ERROR_SUCCESS`; otherwise, a nonzero error code defined in `WINERROR.H`.
### Remarks
-Call this method to create or open the *lpszKeyName* key and store the *lpszValue* data in the *lpszValueName* value field.
+Call this method to create or open the *`lpszKeyName`* key and store the *`lpszValue`* data in the *`lpszValueName`* value field.
-## CRegKey::SetKeySecurity
+## `CRegKey::SetKeySecurity`
Call this method to set the security of the registry key.
@@ -841,28 +840,28 @@ LONG SetKeySecurity(SECURITY_INFORMATION si, PSECURITY_DESCRIPTOR psd) throw();
### Parameters
-*si*
+*`si`*\
Specifies the components of the security descriptor to set. The value can be a combination of the following values:
|Value|Meaning|
|-----------|-------------|
-|DACL_SECURITY_INFORMATION|Sets the key's discretionary access-control list (DACL). The key must have WRITE_DAC access, or the calling process must be the object's owner.|
-|GROUP_SECURITY_INFORMATION|Sets the key's primary group security identifier (SID). The key must have WRITE_OWNER access, or the calling process must be the object's owner.|
-|OWNER_SECURITY_INFORMATION|Sets the key's owner SID. The key must have WRITE_OWNER access, or the calling process must be the object's owner or have the SE_TAKE_OWNERSHIP_NAME privilege enabled.|
-|SACL_SECURITY_INFORMATION|Sets the key's system access-control list (SACL). The key must have ACCESS_SYSTEM_SECURITY access. The proper way to get this access is to enable the SE_SECURITY_NAME [privilege](/windows/win32/secauthz/privileges) in the caller's current access token, open the handle for ACCESS_SYSTEM_SECURITY access, and then disable the privilege.|
+|`DACL_SECURITY_INFORMATION`|Sets the key's discretionary access-control list (DACL). The key must have `WRITE_DAC` access, or the calling process must be the object's owner.|
+|`GROUP_SECURITY_INFORMATION`|Sets the key's primary group security identifier (SID). The key must have `WRITE_OWNER` access, or the calling process must be the object's owner.|
+|`OWNER_SECURITY_INFORMATION`|Sets the key's owner SID. The key must have `WRITE_OWNER` access, or the calling process must be the object's owner or have the `SE_TAKE_OWNERSHIP_NAME` privilege enabled.|
+|`SACL_SECURITY_INFORMATION`|Sets the key's system access-control list (SACL). The key must have `ACCESS_SYSTEM_SECURITY` access. The proper way to get this access is to enable the `SE_SECURITY_NAME` [privilege](/windows/win32/secauthz/privileges) in the caller's current access token, open the handle for `ACCESS_SYSTEM_SECURITY` access, and then disable the privilege.|
-*psd*
-Pointer to a [SECURITY_DESCRIPTOR](/windows/win32/api/winnt/ns-winnt-security_descriptor) structure that specifies the security attributes to set for the specified key.
+*`psd`*\
+Pointer to a [`SECURITY_DESCRIPTOR`](/windows/win32/api/winnt/ns-winnt-security_descriptor) structure that specifies the security attributes to set for the specified key.
### Return Value
-If the method succeeds, the return value is ERROR_SUCCESS. If the method fails, the return value is a nonzero error code defined in WINERROR.H.
+If the method succeeds, the return value is `ERROR_SUCCESS`. If the method fails, the return value is a nonzero error code defined in `WINERROR.H`.
### Remarks
-Sets the key's security attributes. See [RegSetKeySecurity](/windows/win32/api/winreg/nf-winreg-regsetkeysecurity) for more details.
+Sets the key's security attributes. See [`RegSetKeySecurity`](/windows/win32/api/winreg/nf-winreg-regsetkeysecurity) for more details.
-## CRegKey::SetMultiStringValue
+## `CRegKey::SetMultiStringValue`
Call this method to set the multistring value of the registry key.
@@ -872,23 +871,23 @@ LONG SetMultiStringValue(LPCTSTR pszValueName, LPCTSTR pszValue) throw();
### Parameters
-*pszValueName*
-Pointer to a string containing the name of the value to set. If a value with this name is not already present, the method adds it to the key.
+*`pszValueName`*\
+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.
-*pszValue*
-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.
+*`pszValue`*\
+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.
### Return Value
-If the method succeeds, the return value is ERROR_SUCCESS. If the method fails, the return value is a nonzero error code defined in WINERROR.H.
+If the method succeeds, the return value is `ERROR_SUCCESS`. If the method fails, the return value is a nonzero error code defined in `WINERROR.H`.
### Remarks
-This method uses [RegSetValueEx](/windows/win32/api/winreg/nf-winreg-regsetvalueexw) to write the value to the registry.
+This method uses [`RegSetValueEx`](/windows/win32/api/winreg/nf-winreg-regsetvalueexw) to write the value to the registry.
-## CRegKey::SetQWORDValue
+## `CRegKey::SetQWORDValue`
-Call this method to set the QWORD value of the registry key.
+Call this method to set the `QWORD` value of the registry key.
```
LONG SetQWORDValue(LPCTSTR pszValueName, ULONGLONG qwValue) throw();
@@ -896,21 +895,21 @@ LONG SetQWORDValue(LPCTSTR pszValueName, ULONGLONG qwValue) throw();
### Parameters
-*pszValueName*
-Pointer to a string containing the name of the value to set. If a value with this name is not already present, the method adds it to the key.
+*`pszValueName`*\
+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.
-*qwValue*
-The QWORD data to be stored with the specified value name.
+*`qwValue`*\
+The `QWORD` data to be stored with the specified value name.
### Return Value
-If the method succeeds, the return value is ERROR_SUCCESS. If the method fails, the return value is a nonzero error code defined in WINERROR.H.
+If the method succeeds, the return value is `ERROR_SUCCESS`. If the method fails, the return value is a nonzero error code defined in `WINERROR.H`.
### Remarks
-This method uses [RegSetValueEx](/windows/win32/api/winreg/nf-winreg-regsetvalueexw) to write the value to the registry.
+This method uses [`RegSetValueEx`](/windows/win32/api/winreg/nf-winreg-regsetvalueexw) to write the value to the registry.
-## CRegKey::SetStringValue
+## `CRegKey::SetStringValue`
Call this method to set the string value of the registry key.
@@ -923,26 +922,26 @@ LONG SetStringValue(
### Parameters
-*pszValueName*
-Pointer to a string containing the name of the value to set. If a value with this name is not already present, the method adds it to the key.
+*`pszValueName`*\
+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.
-*pszValue*
+*`pszValue`*\
Pointer to the string data to be stored with the specified value name.
-*dwType*
-The type of the string to write to the registry: either REG_SZ (the default) or REG_EXPAND_SZ (for multistrings).
+*`dwType`*\
+The type of the string to write to the registry: either `REG_SZ` (the default) or `REG_EXPAND_SZ` (for multistrings).
### Return Value
-If the method succeeds, the return value is ERROR_SUCCESS. If the method fails, the return value is a nonzero error code defined in WINERROR.H.
+If the method succeeds, the return value is `ERROR_SUCCESS`. If the method fails, the return value is a nonzero error code defined in `WINERROR.H`.
### Remarks
-This method uses [RegSetValueEx](/windows/win32/api/winreg/nf-winreg-regsetvalueexw) to write the value to the registry.
+This method uses [`RegSetValueEx`](/windows/win32/api/winreg/nf-winreg-regsetvalueexw) to write the value to the registry.
-## CRegKey::SetValue
+## `CRegKey::SetValue`
-Call this method to store data in the specified value field of [m_hKey](#m_hkey). Earlier versions of this method are no longer supported and are marked as ATL_DEPRECATED.
+Call this method to store data in the specified value field of [`m_hKey`](#m_hkey). Earlier versions of this method are no longer supported and are marked as `ATL_DEPRECATED`.
```
LONG SetValue(
@@ -970,50 +969,50 @@ ATL_DEPRECATED LONG SetValue(
### Parameters
-*pszValueName*
-Pointer to a string containing the name of the value to set. If a value with this name is not already present in the key, the method adds it to the key. If *pszValueName* is NULL or an empty string, "", the method sets the type and data for the key's unnamed or default value.
+*`pszValueName`*\
+Pointer to a string containing the name of the value to set. If a value with this name isn't already present in the key, the method adds it to the key. If *`pszValueName`* is `NULL` or an empty string, `""`, the method sets the type and data for the key's unnamed or default value.
-*dwType*
-Specifies a code indicating the type of data pointed to by the *pValue* parameter.
+*`dwType`*\
+Specifies a code indicating the type of data pointed to by the *`pValue`* parameter.
-*pValue*
+*`pValue`*\
Pointer to a buffer containing the data to be stored with the specified value name.
-*nBytes*
-Specifies the size, in bytes, of the information pointed to by the *pValue* parameter. If the data is of type REG_SZ, REG_EXPAND_SZ, or REG_MULTI_SZ, *nBytes* must include the size of the terminating null character.
+*`nBytes`*\
+Specifies the size, in bytes, of the information pointed to by the *`pValue`* parameter. If the data is of type `REG_SZ`, `REG_EXPAND_SZ`, or `REG_MULTI_SZ`, *`nBytes`* must include the size of the terminating null character.
-*hKeyParent*
+*`hKeyParent`*\
The handle of an open key.
-*lpszKeyName*
-Specifies the name of a key to be created or opened. This name must be a subkey of *hKeyParent*.
+*`lpszKeyName`*\
+Specifies the name of a key to be created or opened. This name must be a subkey of *`hKeyParent`*.
-*lpszValue*
-Specifies the data to be stored. This parameter must be non-NULL.
+*`lpszValue`*\
+Specifies the data to be stored. This parameter must be non-`NULL`.
-*lpszValueName*
-Specifies the value field to be set. If a value field with this name does not already exist in the key, it is added.
+*`lpszValueName`*\
+Specifies the value field to be set. If a value field with this name doesn't already exist in the key, it's added.
-*dwValue*
+*`dwValue`*\
Specifies the data to be stored.
-*bMulti*
-If false, indicates the string is of type REG_SZ. If true, indicates the string is a multistring of type REG_MULTI_SZ.
+*`bMulti`*\
+If false, indicates the string is of type `REG_SZ`. If true, indicates the string is a multistring of type `REG_MULTI_SZ`.
-*nValueLen*
-If *bMulti* is true, *nValueLen* is the length of the *lpszValue* string in characters. If *bMulti* is false, a value of -1 indicates that the method will calculate the length automatically.
+*`nValueLen`*\
+If *`bMulti`* is true, *`nValueLen`* is the length of the *`lpszValue`* string in characters. If *`bMulti`* is false, a value of -1 indicates that the method will calculate the length automatically.
### Return Value
-If successful, returns ERROR_SUCCESS; otherwise, a nonzero error code defined in WINERROR.H.
+If successful, returns `ERROR_SUCCESS`; otherwise, a nonzero error code defined in `WINERROR.H`.
### Remarks
-The two original versions of `SetValue` are marked as ATL_DEPRECATED and should no longer be used. The compiler will issue a warning if these forms are used.
+The two original versions of `SetValue` are marked as `ATL_DEPRECATED` and should no longer be used. The compiler will issue a warning if these forms are used.
-The third method calls [RegSetValueEx](/windows/win32/api/winreg/nf-winreg-regsetvalueexw).
+The third method calls [`RegSetValueEx`](/windows/win32/api/winreg/nf-winreg-regsetvalueexw).
## See also
-[DCOM Sample](../../overview/visual-cpp-samples.md)
+[DCOM Sample](../../overview/visual-cpp-samples.md)\
[Class Overview](../../atl/atl-class-overview.md)
diff --git a/docs/atl/reference/csimplearray-class.md b/docs/atl/reference/csimplearray-class.md
index b79b7e57ab..12a7cd1332 100644
--- a/docs/atl/reference/csimplearray-class.md
+++ b/docs/atl/reference/csimplearray-class.md
@@ -252,7 +252,7 @@ Removes all elements currently stored in the array.
Removes the specified element from the array.
```
-BOOL RemoveAtint nIndex);
+BOOL RemoveAt(int nIndex);
```
### Parameters
diff --git a/docs/atl/reference/cstockpropimpl-class.md b/docs/atl/reference/cstockpropimpl-class.md
index 29b1619156..1f4959941f 100644
--- a/docs/atl/reference/cstockpropimpl-class.md
+++ b/docs/atl/reference/cstockpropimpl-class.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: CStockPropImpl Class"
title: "CStockPropImpl Class"
+description: "Learn more about: CStockPropImpl Class"
ms.date: "05/06/2019"
f1_keywords: ["CStockPropImpl", "ATLCTL/ATL::CStockPropImpl", "ATLCTL/ATL::get_Appearance", "ATLCTL/ATL::get_AutoSize", "ATLCTL/ATL::get_BackColor", "ATLCTL/ATL::get_BackStyle", "ATLCTL/ATL::get_BorderColor", "ATLCTL/ATL::get_BorderStyle", "ATLCTL/ATL::get_BorderVisible", "ATLCTL/ATL::get_BorderWidth", "ATLCTL/ATL::get_Caption", "ATLCTL/ATL::get_DrawMode", "ATLCTL/ATL::get_DrawStyle", "ATLCTL/ATL::get_DrawWidth", "ATLCTL/ATL::get_Enabled", "ATLCTL/ATL::get_FillColor", "ATLCTL/ATL::get_FillStyle", "ATLCTL/ATL::get_Font", "ATLCTL/ATL::get_ForeColor", "ATLCTL/ATL::get_HWND", "ATLCTL/ATL::get_MouseIcon", "ATLCTL/ATL::get_MousePointer", "ATLCTL/ATL::get_Picture", "ATLCTL/ATL::get_ReadyState", "ATLCTL/ATL::get_TabStop", "ATLCTL/ATL::get_Text", "ATLCTL/ATL::getvalid", "ATLCTL/ATL::get_Window", "ATLCTL/ATL::put_Appearance", "ATLCTL/ATL::put_AutoSize", "ATLCTL/ATL::put_BackColor", "ATLCTL/ATL::put_BackStyle", "ATLCTL/ATL::put_BorderColor", "ATLCTL/ATL::put_BorderStyle", "ATLCTL/ATL::put_BorderVisible", "ATLCTL/ATL::put_BorderWidth", "ATLCTL/ATL::put_Caption", "ATLCTL/ATL::put_DrawMode", "ATLCTL/ATL::put_DrawStyle", "ATLCTL/ATL::put_DrawWidth", "ATLCTL/ATL::put_Enabled", "ATLCTL/ATL::put_FillColor", "ATLCTL/ATL::put_FillStyle", "ATLCTL/ATL::put_Font", "ATLCTL/ATL::put_ForeColor", "ATLCTL/ATL::put_HWND", "ATLCTL/ATL::put_MouseIcon", "ATLCTL/ATL::put_MousePointer", "ATLCTL/ATL::put_Picture", "ATLCTL/ATL::put_ReadyState", "ATLCTL/ATL::put_TabStop", "ATLCTL/ATL::put_Text", "ATLCTL/ATL::putvalid", "ATLCTL/ATL::put_Window", "ATLCTL/ATL::putref_Font", "ATLCTL/ATL::putref_MouseIcon", "ATLCTL/ATL::putref_Picture"]
helpviewer_keywords: ["CStockPropImpl class", "controls [ATL], stock properties", "stock properties, ATL controls"]
-ms.assetid: 45f11d7d-6580-4a0e-872d-3bc8b836cfda
---
# CStockPropImpl Class
@@ -607,7 +606,7 @@ Returns S_OK on success, or an error HRESULT on failure.
Call this method to set the value of flag that indicates if the control cannot be any other size.
```
-HRESULT STDMETHODCALLTYPE put_AutoSize(VARIANT_BOOL bAutoSize,);
+HRESULT STDMETHODCALLTYPE put_AutoSize(VARIANT_BOOL bAutoSize);
```
### Parameters
@@ -1100,5 +1099,5 @@ The same as [CStockPropImpl::put_Picture](#put_picture), but with a reference co
## See also
-[Class Overview](../../atl/atl-class-overview.md)
+[Class Overview](../../atl/atl-class-overview.md)\
[IDispatchImpl Class](../../atl/reference/idispatchimpl-class.md)
diff --git a/docs/atl/reference/cthreadpool-class.md b/docs/atl/reference/cthreadpool-class.md
index e5834d8409..0cca6b473f 100644
--- a/docs/atl/reference/cthreadpool-class.md
+++ b/docs/atl/reference/cthreadpool-class.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: CThreadPool Class"
title: "CThreadPool Class"
-ms.date: "11/04/2016"
+description: "Learn more about: CThreadPool Class"
+ms.date: 11/04/2016
f1_keywords: ["CThreadPool", "ATLUTIL/ATL::CThreadPool", "ATLUTIL/ATL::CThreadPool::CThreadPool", "ATLUTIL/ATL::CThreadPool::AddRef", "ATLUTIL/ATL::CThreadPool::GetNumThreads", "ATLUTIL/ATL::CThreadPool::GetQueueHandle", "ATLUTIL/ATL::CThreadPool::GetSize", "ATLUTIL/ATL::CThreadPool::GetTimeout", "ATLUTIL/ATL::CThreadPool::Initialize", "ATLUTIL/ATL::CThreadPool::QueryInterface", "ATLUTIL/ATL::CThreadPool::QueueRequest", "ATLUTIL/ATL::CThreadPool::Release", "ATLUTIL/ATL::CThreadPool::SetSize", "ATLUTIL/ATL::CThreadPool::SetTimeout", "ATLUTIL/ATL::CThreadPool::Shutdown"]
helpviewer_keywords: ["CThreadPool class"]
-ms.assetid: 06683718-01b9-413c-9481-2dc1734ec70f
---
# CThreadPool Class
@@ -265,7 +264,7 @@ This class does not implement lifetime control using reference counting.
Call this method to set the number of threads in the pool.
```
-HRESULT STDMETHODCALLTYPE SetSizeint nNumThreads) throw();
+HRESULT STDMETHODCALLTYPE SetSize(int nNumThreads) throw();
```
### Parameters
diff --git a/docs/atl/reference/cw2aex-class.md b/docs/atl/reference/cw2aex-class.md
index 0be05310ba..9029cccbe7 100644
--- a/docs/atl/reference/cw2aex-class.md
+++ b/docs/atl/reference/cw2aex-class.md
@@ -4,11 +4,10 @@ title: "CW2AEX Class"
ms.date: "11/04/2016"
f1_keywords: ["CW2AEX", "ATLCONV/ATL::CW2AEX", "ATLCONV/ATL::CW2AEX::CW2AEX", "ATLCONV/ATL::CW2AEX::m_psz", "ATLCONV/ATL::CW2AEX::m_szBuffer"]
helpviewer_keywords: ["CW2AEX class"]
-ms.assetid: 44dc2cf5-dd30-440b-a9b9-b21b43f49843
---
-# CW2AEX Class
+# `CW2AEX` Class
-This class is used by the string conversion macros CT2AEX, CW2TEX, CW2CTEX, and CT2CAEX, and the typedef CW2A.
+This class is used by the string conversion macros `CT2AEX`, `CW2TEX`, `CW2CTEX`, and `CT2CAEX`, and the typedef `CW2A`.
> [!IMPORTANT]
> This class and its members cannot be used in applications that execute in the Windows Runtime.
@@ -22,7 +21,7 @@ class CW2AEX
#### Parameters
-*t_nBufferLength*
+*`t_nBufferLength`*\
The size of the buffer used in the translation process. The default length is 128 bytes.
## Members
@@ -31,8 +30,8 @@ The size of the buffer used in the translation process. The default length is 12
|Name|Description|
|----------|-----------------|
-|[CW2AEX::CW2AEX](#cw2aex)|The constructor.|
-|[CW2AEX::~CW2AEX](#dtor)|The destructor.|
+|[`CW2AEX::CW2AEX`](#cw2aex)|The constructor.|
+|[`CW2AEX::~CW2AEX`](#dtor)|The destructor.|
### Public Operators
@@ -44,32 +43,32 @@ The size of the buffer used in the translation process. The default length is 12
|Name|Description|
|----------|-----------------|
-|[CW2AEX::m_psz](#m_psz)|The data member that stores the source string.|
-|[CW2AEX::m_szBuffer](#m_szbuffer)|The static buffer, used to store the converted string.|
+|[`CW2AEX::m_psz`](#m_psz)|The data member that stores the source string.|
+|[`CW2AEX::m_szBuffer`](#m_szbuffer)|The static buffer, used to store the converted string.|
## Remarks
-Unless extra functionality is required, use CT2AEX, CW2TEX, CW2CTEX, CT2CAEX, or CW2A in your code.
+Unless extra functionality is required, use `CT2AEX`, `CW2TEX`, `CW2CTEX`, `CT2CAEX`, or `CW2A` in your code.
-This class contains a fixed-size static buffer which is used to store the result of the conversion. If the result is too large to fit into the static buffer, the class allocates memory using **malloc**, freeing the memory when the object goes out of scope. This ensures that, unlike text conversion macros available in previous versions of ATL, this class is safe to use in loops and that it won't overflow the stack.
+This class contains a fixed-size static buffer that is used to store the result of the conversion. If the result is too large to fit into the static buffer, the class allocates memory using **`malloc`**, freeing the memory when the object goes out of scope. This ensures that, unlike text conversion macros available in previous versions of ATL, this class is safe to use in loops and that it won't overflow the stack.
-If the class tries to allocate memory on the heap and fails, it will call `AtlThrow` with an argument of E_OUTOFMEMORY.
+If the class tries to allocate memory on the heap and fails, it will call `AtlThrow` with an argument of `E_OUTOFMEMORY`.
By default, the ATL conversion classes and macros use the current thread's ANSI code page for the conversion. If you want to override that behavior for a specific conversion, specify the code page as the second parameter to the constructor for the class.
The following macros are based on this class:
-- CT2AEX
+- `CT2AEX`
-- CW2TEX
+- `CW2TEX`
-- CW2CTEX
+- `CW2CTEX`
-- CT2CAEX
+- `CT2CAEX`
The following typedef is based on this class:
-- CW2A
+- `CW2A`
For a discussion of these text conversion macros, see [ATL and MFC String Conversion Macros](string-conversion-macros.md).
@@ -79,9 +78,9 @@ See [ATL and MFC String Conversion Macros](string-conversion-macros.md) for an e
## Requirements
-**Header:** atlconv.h
+**Header:** `atlconv.h`
-## CW2AEX::CW2AEX
+## `CW2AEX::CW2AEX`
The constructor.
@@ -92,17 +91,17 @@ CW2AEX(LPCWSTR psz) throw(...);
### Parameters
-*psz*
+*`psz`*\
The text string to be converted.
-*nCodePage*
-The code page used to perform the conversion. See the code page parameter discussion for the Windows SDK function [MultiByteToWideChar](/windows/win32/api/stringapiset/nf-stringapiset-multibytetowidechar) for more details.
+*`nCodePage`*\
+The code page used to perform the conversion. See the code page parameter discussion for the Windows SDK function [`MultiByteToWideChar`](/windows/win32/api/stringapiset/nf-stringapiset-multibytetowidechar) for more details.
### Remarks
Allocates the buffer used in the translation process.
-## CW2AEX::~CW2AEX
+## `CW2AEX::~CW2AEX`
The destructor.
@@ -114,7 +113,7 @@ The destructor.
Frees the allocated buffer.
-## CW2AEX::m_psz
+## `CW2AEX::m_psz`
The data member that stores the source string.
@@ -122,7 +121,7 @@ The data member that stores the source string.
LPSTR m_psz;
```
-## CW2AEX::m_szBuffer
+## `CW2AEX::m_szBuffer`
The static buffer, used to store the converted string.
@@ -130,7 +129,7 @@ The static buffer, used to store the converted string.
char m_szBuffer[t_nBufferLength];
```
-## CW2AEX::operator LPSTR
+## `CW2AEX::operator LPSTR`
Conversion operator.
@@ -140,13 +139,13 @@ operator LPSTR() const throw();
### Return Value
-Returns the text string as type LPSTR.
+Returns the text string as type `LPSTR`.
## See also
-[CA2AEX Class](../../atl/reference/ca2aex-class.md)
-[CA2CAEX Class](../../atl/reference/ca2caex-class.md)
-[CA2WEX Class](../../atl/reference/ca2wex-class.md)
-[CW2CWEX Class](../../atl/reference/cw2cwex-class.md)
-[CW2WEX Class](../../atl/reference/cw2wex-class.md)
+[`CA2AEX` Class](../../atl/reference/ca2aex-class.md)\
+[`CA2CAEX` Class](../../atl/reference/ca2caex-class.md)\
+[`CA2WEX` Class](../../atl/reference/ca2wex-class.md)\
+[`CW2CWEX` Class](../../atl/reference/cw2cwex-class.md)\
+[`CW2WEX` Class](../../atl/reference/cw2wex-class.md)\
[Class Overview](../../atl/atl-class-overview.md)
diff --git a/docs/atl/reference/cw2wex-class.md b/docs/atl/reference/cw2wex-class.md
index 3c0cfb0946..d5c15f69f2 100644
--- a/docs/atl/reference/cw2wex-class.md
+++ b/docs/atl/reference/cw2wex-class.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: CW2WEX Class"
title: "CW2WEX Class"
+description: "Learn more about: CW2WEX Class"
ms.date: "11/04/2016"
f1_keywords: ["CW2WEX", "ATLCONV/ATL::CW2WEX", "ATLCONV/ATL::CW2WEX::CW2WEX", "ATLCONV/ATL::CW2WEX::m_psz", "ATLCONV/ATL::CW2WEX::m_szBuffer"]
helpviewer_keywords: ["CW2WEX class"]
-ms.assetid: 46262e56-e0d2-41fe-855b-0b67ecc8fcd7
---
# CW2WEX Class
@@ -100,7 +99,7 @@ Creates the buffer required for the translation.
## CW2WEX::~CW2WEX
-The destructor..
+The destructor.
```
~CW2WEX() throw();
@@ -140,9 +139,9 @@ Returns the text string as type LPWSTR.
## See also
-[CA2AEX Class](../../atl/reference/ca2aex-class.md)
-[CA2CAEX Class](../../atl/reference/ca2caex-class.md)
-[CA2WEX Class](../../atl/reference/ca2wex-class.md)
-[CW2AEX Class](../../atl/reference/cw2aex-class.md)
-[CW2CWEX Class](../../atl/reference/cw2cwex-class.md)
+[CA2AEX Class](../../atl/reference/ca2aex-class.md)\
+[CA2CAEX Class](../../atl/reference/ca2caex-class.md)\
+[CA2WEX Class](../../atl/reference/ca2wex-class.md)\
+[CW2AEX Class](../../atl/reference/cw2aex-class.md)\
+[CW2CWEX Class](../../atl/reference/cw2cwex-class.md)\
[Class Overview](../../atl/atl-class-overview.md)
diff --git a/docs/atl/reference/cwindow-class.md b/docs/atl/reference/cwindow-class.md
index f342adc8fa..c91fae3db6 100644
--- a/docs/atl/reference/cwindow-class.md
+++ b/docs/atl/reference/cwindow-class.md
@@ -4,9 +4,8 @@ title: "CWindow Class"
ms.date: "11/04/2016"
f1_keywords: ["CWindow", "ATLWIN/ATL::CWindow", "ATLWIN/ATL::CWindow::CWindow", "ATLWIN/ATL::CWindow::ArrangeIconicWindows", "ATLWIN/ATL::CWindow::Attach", "ATLWIN/ATL::CWindow::BeginPaint", "ATLWIN/ATL::CWindow::BringWindowToTop", "ATLWIN/ATL::CWindow::CenterWindow", "ATLWIN/ATL::CWindow::ChangeClipboardChain", "ATLWIN/ATL::CWindow::CheckDlgButton", "ATLWIN/ATL::CWindow::CheckRadioButton", "ATLWIN/ATL::CWindow::ChildWindowFromPoint", "ATLWIN/ATL::CWindow::ChildWindowFromPointEx", "ATLWIN/ATL::CWindow::ClientToScreen", "ATLWIN/ATL::CWindow::Create", "ATLWIN/ATL::CWindow::CreateCaret", "ATLWIN/ATL::CWindow::CreateGrayCaret", "ATLWIN/ATL::CWindow::CreateSolidCaret", "ATLWIN/ATL::CWindow::DeferWindowPos", "ATLWIN/ATL::CWindow::DestroyWindow", "ATLWIN/ATL::CWindow::Detach", "ATLWIN/ATL::CWindow::DlgDirList", "ATLWIN/ATL::CWindow::DlgDirListComboBox", "ATLWIN/ATL::CWindow::DlgDirSelect", "ATLWIN/ATL::CWindow::DlgDirSelectComboBox", "ATLWIN/ATL::CWindow::DragAcceptFiles", "ATLWIN/ATL::CWindow::DrawMenuBar", "ATLWIN/ATL::CWindow::EnableScrollBar", "ATLWIN/ATL::CWindow::EnableWindow", "ATLWIN/ATL::CWindow::EndPaint", "ATLWIN/ATL::CWindow::FlashWindow", "ATLWIN/ATL::CWindow::GetClientRect", "ATLWIN/ATL::CWindow::GetDC", "ATLWIN/ATL::CWindow::GetDCEx", "ATLWIN/ATL::CWindow::GetDescendantWindow", "ATLWIN/ATL::CWindow::GetDlgControl", "ATLWIN/ATL::CWindow::GetDlgCtrlID", "ATLWIN/ATL::CWindow::GetDlgHost", "ATLWIN/ATL::CWindow::GetDlgItem", "ATLWIN/ATL::CWindow::GetDlgItemInt", "ATLWIN/ATL::CWindow::GetDlgItemText", "ATLWIN/ATL::CWindow::GetExStyle", "ATLWIN/ATL::CWindow::GetFont", "ATLWIN/ATL::CWindow::GetHotKey", "ATLWIN/ATL::CWindow::GetIcon", "ATLWIN/ATL::CWindow::GetLastActivePopup", "ATLWIN/ATL::CWindow::GetMenu", "ATLWIN/ATL::CWindow::GetNextDlgGroupItem", "ATLWIN/ATL::CWindow::GetNextDlgTabItem", "ATLWIN/ATL::CWindow::GetParent", "ATLWIN/ATL::CWindow::GetScrollInfo", "ATLWIN/ATL::CWindow::GetScrollPos", "ATLWIN/ATL::CWindow::GetScrollRange", "ATLWIN/ATL::CWindow::GetStyle", "ATLWIN/ATL::CWindow::GetSystemMenu", "ATLWIN/ATL::CWindow::GetTopLevelParent", "ATLWIN/ATL::CWindow::GetTopLevelWindow", "ATLWIN/ATL::CWindow::GetTopWindow", "ATLWIN/ATL::CWindow::GetUpdateRect", "ATLWIN/ATL::CWindow::GetUpdateRgn", "ATLWIN/ATL::CWindow::GetWindow", "ATLWIN/ATL::CWindow::GetWindowContextHelpId", "ATLWIN/ATL::CWindow::GetWindowDC", "ATLWIN/ATL::CWindow::GetWindowLong", "ATLWIN/ATL::CWindow::GetWindowLongPtr", "ATLWIN/ATL::CWindow::GetWindowPlacement", "ATLWIN/ATL::CWindow::GetWindowProcessID", "ATLWIN/ATL::CWindow::GetWindowRect", "ATLWIN/ATL::CWindow::GetWindowRgn", "ATLWIN/ATL::CWindow::GetWindowText", "ATLWIN/ATL::CWindow::GetWindowTextLength", "ATLWIN/ATL::CWindow::GetWindowThreadID", "ATLWIN/ATL::CWindow::GetWindowWord", "ATLWIN/ATL::CWindow::GotoDlgCtrl", "ATLWIN/ATL::CWindow::HideCaret", "ATLWIN/ATL::CWindow::HiliteMenuItem", "ATLWIN/ATL::CWindow::Invalidate", "ATLWIN/ATL::CWindow::InvalidateRect", "ATLWIN/ATL::CWindow::InvalidateRgn", "ATLWIN/ATL::CWindow::IsChild", "ATLWIN/ATL::CWindow::IsDialogMessage", "ATLWIN/ATL::CWindow::IsDlgButtonChecked", "ATLWIN/ATL::CWindow::IsIconic", "ATLWIN/ATL::CWindow::IsParentDialog", "ATLWIN/ATL::CWindow::IsWindow", "ATLWIN/ATL::CWindow::IsWindowEnabled", "ATLWIN/ATL::CWindow::IsWindowUnicode", "ATLWIN/ATL::CWindow::IsWindowVisible", "ATLWIN/ATL::CWindow::IsZoomed", "ATLWIN/ATL::CWindow::KillTimer", "ATLWIN/ATL::CWindow::LockWindowUpdate", "ATLWIN/ATL::CWindow::MapWindowPoints", "ATLWIN/ATL::CWindow::MessageBox", "ATLWIN/ATL::CWindow::ModifyStyle", "ATLWIN/ATL::CWindow::ModifyStyleEx", "ATLWIN/ATL::CWindow::MoveWindow", "ATLWIN/ATL::CWindow::NextDlgCtrl", "ATLWIN/ATL::CWindow::OpenClipboard", "ATLWIN/ATL::CWindow::PostMessage", "ATLWIN/ATL::CWindow::PrevDlgCtrl", "ATLWIN/ATL::CWindow::Print", "ATLWIN/ATL::CWindow::PrintClient", "ATLWIN/ATL::CWindow::RedrawWindow", "ATLWIN/ATL::CWindow::ReleaseDC", "ATLWIN/ATL::CWindow::ResizeClient", "ATLWIN/ATL::CWindow::ScreenToClient", "ATLWIN/ATL::CWindow::ScrollWindow", "ATLWIN/ATL::CWindow::ScrollWindowEx", "ATLWIN/ATL::CWindow::SendDlgItemMessage", "ATLWIN/ATL::CWindow::SendMessage", "ATLWIN/ATL::CWindow::SendMessageToDescendants", "ATLWIN/ATL::CWindow::SendNotifyMessage", "ATLWIN/ATL::CWindow::SetActiveWindow", "ATLWIN/ATL::CWindow::SetCapture", "ATLWIN/ATL::CWindow::SetClipboardViewer", "ATLWIN/ATL::CWindow::SetDlgCtrlID", "ATLWIN/ATL::CWindow::SetDlgItemInt", "ATLWIN/ATL::CWindow::SetDlgItemText", "ATLWIN/ATL::CWindow::SetFocus", "ATLWIN/ATL::CWindow::SetFont", "ATLWIN/ATL::CWindow::SetHotKey", "ATLWIN/ATL::CWindow::SetIcon", "ATLWIN/ATL::CWindow::SetMenu", "ATLWIN/ATL::CWindow::SetParent", "ATLWIN/ATL::CWindow::SetRedraw", "ATLWIN/ATL::CWindow::SetScrollInfo", "ATLWIN/ATL::CWindow::SetScrollPos", "ATLWIN/ATL::CWindow::SetScrollRange", "ATLWIN/ATL::CWindow::SetTimer", "ATLWIN/ATL::CWindow::SetWindowContextHelpId", "ATLWIN/ATL::CWindow::SetWindowLong", "ATLWIN/ATL::CWindow::SetWindowLongPtr", "ATLWIN/ATL::CWindow::SetWindowPlacement", "ATLWIN/ATL::CWindow::SetWindowPos", "ATLWIN/ATL::CWindow::SetWindowRgn", "ATLWIN/ATL::CWindow::SetWindowText", "ATLWIN/ATL::CWindow::SetWindowWord", "ATLWIN/ATL::CWindow::ShowCaret", "ATLWIN/ATL::CWindow::ShowOwnedPopups", "ATLWIN/ATL::CWindow::ShowScrollBar", "ATLWIN/ATL::CWindow::ShowWindow", "ATLWIN/ATL::CWindow::ShowWindowAsync", "ATLWIN/ATL::CWindow::UpdateWindow", "ATLWIN/ATL::CWindow::ValidateRect", "ATLWIN/ATL::CWindow::ValidateRgn", "ATLWIN/ATL::CWindow::WinHelp", "ATLWIN/ATL::CWindow::m_hWnd", "ATLWIN/ATL::CWindow::rcDefault"]
helpviewer_keywords: ["CWindow class"]
-ms.assetid: fefa00c8-f053-4bcf-87bc-dc84f5386683
---
-# CWindow Class
+# `CWindow` Class
This class provides methods for manipulating a window.
@@ -25,206 +24,206 @@ class CWindow
|Name|Description|
|----------|-----------------|
-|[CWindow::CWindow](#cwindow)|Constructor.|
+|[`CWindow::CWindow`](#cwindow)|Constructor.|
### Public Methods
|Name|Description|
|----------|-----------------|
-|[CWindow::ArrangeIconicWindows](#arrangeiconicwindows)|Arranges all minimized child windows.|
-|[CWindow::Attach](#attach)|Attaches a window to the `CWindow` object.|
-|[CWindow::BeginPaint](#beginpaint)|Prepares the window for painting.|
-|[CWindow::BringWindowToTop](#bringwindowtotop)|Brings the window to the top of the Z order.|
-|[CWindow::CenterWindow](#centerwindow)|Centers the window against a given window.|
-|[CWindow::ChangeClipboardChain](#changeclipboardchain)|Removes the window from the chain of Clipboard viewers.|
-|[CWindow::CheckDlgButton](#checkdlgbutton)|Changes the check state of the specified button.|
-|[CWindow::CheckRadioButton](#checkradiobutton)|Checks the specified radio button.|
-|[CWindow::ChildWindowFromPoint](#childwindowfrompoint)|Retrieves the child window containing the specified point.|
-|[CWindow::ChildWindowFromPointEx](#childwindowfrompointex)|Retrieves a particular type of child window containing the specified point.|
-|[CWindow::ClientToScreen](#clienttoscreen)|Converts client coordinates to screen coordinates.|
-|[CWindow::Create](#create)|Creates a window.|
-|[CWindow::CreateCaret](#createcaret)|Creates a new shape for the system caret.|
-|[CWindow::CreateGrayCaret](#creategraycaret)|Creates a gray rectangle for the system caret.|
-|[CWindow::CreateSolidCaret](#createsolidcaret)|Creates a solid rectangle for the system caret.|
-|[CWindow::DeferWindowPos](#deferwindowpos)|Updates the specified multiple-window-position structure for the specified window.|
-|[CWindow::DestroyWindow](#destroywindow)|Destroys the window associated with the `CWindow` object.|
-|[CWindow::Detach](#detach)|Detaches the window from the `CWindow` object.|
-|[CWindow::DlgDirList](#dlgdirlist)|Fills a list box with the names of all files matching a specified path or file name.|
-|[CWindow::DlgDirListComboBox](#dlgdirlistcombobox)|Fills a combo box with the names of all files matching a specified path or file name.|
-|[CWindow::DlgDirSelect](#dlgdirselect)|Retrieves the current selection from a list box.|
-|[CWindow::DlgDirSelectComboBox](#dlgdirselectcombobox)|Retrieves the current selection from a combo box.|
-|[CWindow::DragAcceptFiles](#dragacceptfiles)|Registers whether the window accepts dragged files.|
-|[CWindow::DrawMenuBar](#drawmenubar)|Redraws the window's menu bar.|
-|[CWindow::EnableScrollBar](#enablescrollbar)|Enables or disables the scroll bar arrows.|
-|[CWindow::EnableWindow](#enablewindow)|Enables or disables input.|
-|[CWindow::EndPaint](#endpaint)|Marks the end of painting.|
-|[CWindow::FlashWindow](#flashwindow)|Flashes the window once.|
-|[CWindow::GetClientRect](#getclientrect)|Retrieves the coordinates of the client area.|
-|[CWindow::GetDC](#getdc)|Retrieves a device context for the client area.|
-|[CWindow::GetDCEx](#getdcex)|Retrieves a device context for the client area and allows clipping options.|
-|[CWindow::GetDescendantWindow](#getdescendantwindow)|Retrieves the specified descendant window.|
-|[CWindow::GetDlgControl](#getdlgcontrol)|Retrieves an interface on the specified control.|
-|[CWindow::GetDlgCtrlID](#getdlgctrlid)|Retrieves the window's identifier (for child windows only).|
-|[CWindow::GetDlgHost](#getdlghost)|Retrieves a pointer to an interface to the ATL Control hosting container.|
-|[CWindow::GetDlgItem](#getdlgitem)|Retrieves the specified child window.|
-|[CWindow::GetDlgItemInt](#getdlgitemint)|Translates a control's text to an integer.|
-|[CWindow::GetDlgItemText](#getdlgitemtext)|Retrieves a control's text.|
-|[CWindow::GetExStyle](#getexstyle)|Retrieves the extended window styles.|
-|[CWindow::GetFont](#getfont)|Retrieves the window's current font.|
-|[CWindow::GetHotKey](#gethotkey)|Determines the hot key associated with the window.|
-|[CWindow::GetIcon](#geticon)|Retrieves the window's large or small icon.|
-|[CWindow::GetLastActivePopup](#getlastactivepopup)|Retrieves the most recently active pop-up window.|
-|[CWindow::GetMenu](#getmenu)|Retrieves the window's menu.|
-|[CWindow::GetNextDlgGroupItem](#getnextdlggroupitem)|Retrieves the previous or next control within a group of controls.|
-|[CWindow::GetNextDlgTabItem](#getnextdlgtabitem)|Retrieves the previous or next control having the WS_TABSTOP style.|
-|[CWindow::GetParent](#getparent)|Retrieves the immediate parent window.|
-|[CWindow::GetScrollInfo](#getscrollinfo)|Retrieves the parameters of a scroll bar.|
-|[CWindow::GetScrollPos](#getscrollpos)|Retrieves the position of the scroll box.|
-|[CWindow::GetScrollRange](#getscrollrange)|Retrieves the scroll bar range.|
-|[CWindow::GetStyle](#getstyle)|Retrieves the window styles.|
-|[CWindow::GetSystemMenu](#getsystemmenu)|Creates a copy of the system menu for modification.|
-|[CWindow::GetTopLevelParent](#gettoplevelparent)|Retrieves the top-level parent or owner window.|
-|[CWindow::GetTopLevelWindow](#gettoplevelwindow)|Retrieves the top-level owner window.|
-|[CWindow::GetTopWindow](#gettopwindow)|Retrieves the top-level child window.|
-|[CWindow::GetUpdateRect](#getupdaterect)|Retrieves the coordinates of the smallest rectangle that completely encloses the update region.|
-|[CWindow::GetUpdateRgn](#getupdatergn)|Retrieves the update region and copies it into a specified region.|
-|[CWindow::GetWindow](#getwindow)|Retrieves the specified window.|
-|[CWindow::GetWindowContextHelpId](#getwindowcontexthelpid)|Retrieves the window's help context identifier.|
-|[CWindow::GetWindowDC](#getwindowdc)|Retrieves a device context for the entire window.|
-|[CWindow::GetWindowLong](#getwindowlong)|Retrieves a 32-bit value at a specified offset into the extra window memory.|
-|[CWindow::GetWindowLongPtr](#getwindowlongptr)|Retrieves information about the specified window, including a value at a specified offset into the extra window memory.|
-|[CWindow::GetWindowPlacement](#getwindowplacement)|Retrieves the show state and positions.|
-|[CWindow::GetWindowProcessID](#getwindowprocessid)|Retrieves the identifier of the process that created the window.|
-|[CWindow::GetWindowRect](#getwindowrect)|Retrieves the window's bounding dimensions.|
-|[CWindow::GetWindowRgn](#getwindowrgn)|Obtains a copy of the window region of a window.|
-|[CWindow::GetWindowText](#getwindowtext)|Retrieves the window's text.|
-|[CWindow::GetWindowTextLength](#getwindowtextlength)|Retrieves the length of the window's text.|
-|[CWindow::GetWindowThreadID](#getwindowthreadid)|Retrieves the identifier of the thread that created the specified window.|
-|[CWindow::GetWindowWord](#getwindowword)|Retrieves a 16-bit value at a specified offset into the extra window memory.|
-|[CWindow::GotoDlgCtrl](#gotodlgctrl)|Sets the keyboard focus to a control in the dialog box.|
-|[CWindow::HideCaret](#hidecaret)|Hides the system caret.|
-|[CWindow::HiliteMenuItem](#hilitemenuitem)|Highlights or removes the highlight from a top-level menu item.|
-|[CWindow::Invalidate](#invalidate)|Invalidates the entire client area.|
-|[CWindow::InvalidateRect](#invalidaterect)|Invalidates the client area within the specified rectangle.|
-|[CWindow::InvalidateRgn](#invalidatergn)|Invalidates the client area within the specified region.|
-|[CWindow::IsChild](#ischild)|Determines whether the specified window is a child window.|
-|[CWindow::IsDialogMessage](#isdialogmessage)|Determines whether a message is intended for the specified dialog box.|
-|[CWindow::IsDlgButtonChecked](#isdlgbuttonchecked)|Determines the check state of the button.|
-|[CWindow::IsIconic](#isiconic)|Determines whether the window is minimized.|
-|[CWindow::IsParentDialog](#isparentdialog)|Determines if the parent window of a control is a dialog window.|
-|[CWindow::IsWindow](#iswindow)|Determines whether the specified window handle identifies an existing window.|
-|[CWindow::IsWindowEnabled](#iswindowenabled)|Determines whether the window is enabled for input.|
-|[CWindow::IsWindowUnicode](#iswindowunicode)|Determines whether the specified window is a native Unicode window.|
-|[CWindow::IsWindowVisible](#iswindowvisible)|Determines the window's visibility state.|
-|[CWindow::IsZoomed](#iszoomed)|Determines whether the window is maximized.|
-|[CWindow::KillTimer](#killtimer)|Destroys a timer event.|
-|[CWindow::LockWindowUpdate](#lockwindowupdate)|Disables or enables drawing in the window.|
-|[CWindow::MapWindowPoints](#mapwindowpoints)|Converts a set of points from the window's coordinate space to the coordinate space of another window.|
-|[CWindow::MessageBox](#messagebox)|Displays a message box.|
-|[CWindow::ModifyStyle](#modifystyle)|Modifies the window styles.|
-|[CWindow::ModifyStyleEx](#modifystyleex)|Modifies the extended window styles.|
-|[CWindow::MoveWindow](#movewindow)|Changes the window's size and position.|
-|[CWindow::NextDlgCtrl](#nextdlgctrl)|Sets the keyboard focus to the next control in the dialog box.|
-|[CWindow::OpenClipboard](#openclipboard)|Opens the Clipboard.|
-|[CWindow::PostMessage](#postmessage)|Places a message in the message queue associated with the thread that created the window. Returns without waiting for the thread to process the message.|
-|[CWindow::PrevDlgCtrl](#prevdlgctrl)|Sets the keyboard focus to the previous control in the dialog box.|
-|[CWindow::Print](#print)|Requests that the window be drawn in a specified device context.|
-|[CWindow::PrintClient](#printclient)|Requests that the window's client area be drawn in a specified device context.|
-|[CWindow::RedrawWindow](#redrawwindow)|Updates a specified rectangle or region in the client area.|
-|[CWindow::ReleaseDC](#releasedc)|Releases a device context.|
-|[CWindow::ResizeClient](#resizeclient)|Resizes the window.|
-|[CWindow::ScreenToClient](#screentoclient)|Converts screen coordinates to client coordinates.|
-|[CWindow::ScrollWindow](#scrollwindow)|Scrolls the specified client area.|
-|[CWindow::ScrollWindowEx](#scrollwindowex)|Scrolls the specified client area with additional features.|
-|[CWindow::SendDlgItemMessage](#senddlgitemmessage)|Sends a message to a control.|
-|[CWindow::SendMessage](#sendmessage)|Sends a message to the window and does not return until the window procedure has processed the message.|
-|[CWindow::SendMessageToDescendants](#sendmessagetodescendants)|Sends a message to the specified descendant windows.|
-|[CWindow::SendNotifyMessage](#sendnotifymessage)|Sends a message to the window. If the window was created by the calling thread, `SendNotifyMessage` does not return until the window procedure has processed the message. Otherwise, it returns immediately.|
-|[CWindow::SetActiveWindow](#setactivewindow)|Activates the window.|
-|[CWindow::SetCapture](#setcapture)|Sends all subsequent mouse input to the window.|
-|[CWindow::SetClipboardViewer](#setclipboardviewer)|Adds the window to the Clipboard viewer chain.|
-|[CWindow::SetDlgCtrlID](#setdlgctrlid)|Changes the window's identifier.|
-|[CWindow::SetDlgItemInt](#setdlgitemint)|Changes a control's text to the string representation of an integer value.|
-|[CWindow::SetDlgItemText](#setdlgitemtext)|Changes a control's text.|
-|[CWindow::SetFocus](#setfocus)|Sets the input focus to the window.|
-|[CWindow::SetFont](#setfont)|Changes the window's current font.|
-|[CWindow::SetHotKey](#sethotkey)|Associates a hot key with the window.|
-|[CWindow::SetIcon](#seticon)|Changes the window's large or small icon.|
-|[CWindow::SetMenu](#setmenu)|Changes the window's current menu.|
-|[CWindow::SetParent](#setparent)|Changes the parent window.|
-|[CWindow::SetRedraw](#setredraw)|Sets or clears the redraw flag.|
-|[CWindow::SetScrollInfo](#setscrollinfo)|Sets the parameters of a scroll bar.|
-|[CWindow::SetScrollPos](#setscrollpos)|Changes the position of the scroll box.|
-|[CWindow::SetScrollRange](#setscrollrange)|Changes the scroll bar range.|
-|[CWindow::SetTimer](#settimer)|Creates a timer event.|
-|[CWindow::SetWindowContextHelpId](#setwindowcontexthelpid)|Sets the window's help context identifier.|
-|[CWindow::SetWindowLong](#setwindowlong)|Sets a 32-bit value at a specified offset into the extra window memory.|
-|[CWindow::SetWindowLongPtr](#setwindowlongptr)|Changes an attribute of the specified window, and also sets a value at the specified offset in the extra window memory.|
-|[CWindow::SetWindowPlacement](#setwindowplacement)|Sets the show state and positions.|
-|[CWindow::SetWindowPos](#setwindowpos)|Sets the size, position, and Z order.|
-|[CWindow::SetWindowRgn](#setwindowrgn)|Sets the window region of a window.|
-|[CWindow::SetWindowText](#setwindowtext)|Changes the window's text.|
-|[CWindow::SetWindowWord](#setwindowword)|Sets a 16-bit value at a specified offset into the extra window memory.|
-|[CWindow::ShowCaret](#showcaret)|Displays the system caret.|
-|[CWindow::ShowOwnedPopups](#showownedpopups)|Shows or hides the pop-up windows owned by the window.|
-|[CWindow::ShowScrollBar](#showscrollbar)|Shows or hides a scroll bar.|
-|[CWindow::ShowWindow](#showwindow)|Sets the window's show state.|
-|[CWindow::ShowWindowAsync](#showwindowasync)|Sets the show state of a window created by a different thread.|
-|[CWindow::UpdateWindow](#updatewindow)|Updates the client area.|
-|[CWindow::ValidateRect](#validaterect)|Validates the client area within the specified rectangle.|
-|[CWindow::ValidateRgn](#validatergn)|Validates the client area within the specified region.|
-|[CWindow::WinHelp](#winhelp)|Starts Windows Help.|
+|[`CWindow::ArrangeIconicWindows`](#arrangeiconicwindows)|Arranges all minimized child windows.|
+|[`CWindow::Attach`](#attach)|Attaches a window to the `CWindow` object.|
+|[`CWindow::BeginPaint`](#beginpaint)|Prepares the window for painting.|
+|[`CWindow::BringWindowToTop`](#bringwindowtotop)|Brings the window to the top of the Z order.|
+|[`CWindow::CenterWindow`](#centerwindow)|Centers the window against a given window.|
+|[`CWindow::ChangeClipboardChain`](#changeclipboardchain)|Removes the window from the chain of Clipboard viewers.|
+|[`CWindow::CheckDlgButton`](#checkdlgbutton)|Changes the check state of the specified button.|
+|[`CWindow::CheckRadioButton`](#checkradiobutton)|Checks the specified radio button.|
+|[`CWindow::ChildWindowFromPoint`](#childwindowfrompoint)|Retrieves the child window containing the specified point.|
+|[`CWindow::ChildWindowFromPointEx`](#childwindowfrompointex)|Retrieves a particular type of child window containing the specified point.|
+|[`CWindow::ClientToScreen`](#clienttoscreen)|Converts client coordinates to screen coordinates.|
+|[`CWindow::Create`](#create)|Creates a window.|
+|[`CWindow::CreateCaret`](#createcaret)|Creates a new shape for the system caret.|
+|[`CWindow::CreateGrayCaret`](#creategraycaret)|Creates a gray rectangle for the system caret.|
+|[`CWindow::CreateSolidCaret`](#createsolidcaret)|Creates a solid rectangle for the system caret.|
+|[`CWindow::DeferWindowPos`](#deferwindowpos)|Updates the specified multiple-window-position structure for the specified window.|
+|[`CWindow::DestroyWindow`](#destroywindow)|Destroys the window associated with the `CWindow` object.|
+|[`CWindow::Detach`](#detach)|Detaches the window from the `CWindow` object.|
+|[`CWindow::DlgDirList`](#dlgdirlist)|Fills a list box with the names of all files matching a specified path or file name.|
+|[`CWindow::DlgDirListComboBox`](#dlgdirlistcombobox)|Fills a combo box with the names of all files matching a specified path or file name.|
+|[`CWindow::DlgDirSelect`](#dlgdirselect)|Retrieves the current selection from a list box.|
+|[`CWindow::DlgDirSelectComboBox`](#dlgdirselectcombobox)|Retrieves the current selection from a combo box.|
+|[`CWindow::DragAcceptFiles`](#dragacceptfiles)|Registers whether the window accepts dragged files.|
+|[`CWindow::DrawMenuBar`](#drawmenubar)|Redraws the window's menu bar.|
+|[`CWindow::EnableScrollBar`](#enablescrollbar)|Enables or disables the scroll bar arrows.|
+|[`CWindow::EnableWindow`](#enablewindow)|Enables or disables input.|
+|[`CWindow::EndPaint`](#endpaint)|Marks the end of painting.|
+|[`CWindow::FlashWindow`](#flashwindow)|Flashes the window once.|
+|[`CWindow::GetClientRect`](#getclientrect)|Retrieves the coordinates of the client area.|
+|[`CWindow::GetDC`](#getdc)|Retrieves a device context for the client area.|
+|[`CWindow::GetDCEx`](#getdcex)|Retrieves a device context for the client area and allows clipping options.|
+|[`CWindow::GetDescendantWindow`](#getdescendantwindow)|Retrieves the specified descendant window.|
+|[`CWindow::GetDlgControl`](#getdlgcontrol)|Retrieves an interface on the specified control.|
+|[`CWindow::GetDlgCtrlID`](#getdlgctrlid)|Retrieves the window's identifier (for child windows only).|
+|[`CWindow::GetDlgHost`](#getdlghost)|Retrieves a pointer to an interface to the ATL Control hosting container.|
+|[`CWindow::GetDlgItem`](#getdlgitem)|Retrieves the specified child window.|
+|[`CWindow::GetDlgItemInt`](#getdlgitemint)|Translates a control's text to an integer.|
+|[`CWindow::GetDlgItemText`](#getdlgitemtext)|Retrieves a control's text.|
+|[`CWindow::GetExStyle`](#getexstyle)|Retrieves the extended window styles.|
+|[`CWindow::GetFont`](#getfont)|Retrieves the window's current font.|
+|[`CWindow::GetHotKey`](#gethotkey)|Determines the hot key associated with the window.|
+|[`CWindow::GetIcon`](#geticon)|Retrieves the window's large or small icon.|
+|[`CWindow::GetLastActivePopup`](#getlastactivepopup)|Retrieves the most recently active pop-up window.|
+|[`CWindow::GetMenu`](#getmenu)|Retrieves the window's menu.|
+|[`CWindow::GetNextDlgGroupItem`](#getnextdlggroupitem)|Retrieves the previous or next control within a group of controls.|
+|[`CWindow::GetNextDlgTabItem`](#getnextdlgtabitem)|Retrieves the previous or next control having the `WS_TABSTOP` style.|
+|[`CWindow::GetParent`](#getparent)|Retrieves the immediate parent window.|
+|[`CWindow::GetScrollInfo`](#getscrollinfo)|Retrieves the parameters of a scroll bar.|
+|[`CWindow::GetScrollPos`](#getscrollpos)|Retrieves the position of the scroll box.|
+|[`CWindow::GetScrollRange`](#getscrollrange)|Retrieves the scroll bar range.|
+|[`CWindow::GetStyle`](#getstyle)|Retrieves the window styles.|
+|[`CWindow::GetSystemMenu`](#getsystemmenu)|Creates a copy of the system menu for modification.|
+|[`CWindow::GetTopLevelParent`](#gettoplevelparent)|Retrieves the top-level parent or owner window.|
+|[`CWindow::GetTopLevelWindow`](#gettoplevelwindow)|Retrieves the top-level owner window.|
+|[`CWindow::GetTopWindow`](#gettopwindow)|Retrieves the top-level child window.|
+|[`CWindow::GetUpdateRect`](#getupdaterect)|Retrieves the coordinates of the smallest rectangle that completely encloses the update region.|
+|[`CWindow::GetUpdateRgn`](#getupdatergn)|Retrieves the update region and copies it into a specified region.|
+|[`CWindow::GetWindow`](#getwindow)|Retrieves the specified window.|
+|[`CWindow::GetWindowContextHelpId`](#getwindowcontexthelpid)|Retrieves the window's help context identifier.|
+|[`CWindow::GetWindowDC`](#getwindowdc)|Retrieves a device context for the entire window.|
+|[`CWindow::GetWindowLong`](#getwindowlong)|Retrieves a 32-bit value at a specified offset into the extra window memory.|
+|[`CWindow::GetWindowLongPtr`](#getwindowlongptr)|Retrieves information about the specified window, including a value at a specified offset into the extra window memory.|
+|[`CWindow::GetWindowPlacement`](#getwindowplacement)|Retrieves the show state and positions.|
+|[`CWindow::GetWindowProcessID`](#getwindowprocessid)|Retrieves the identifier of the process that created the window.|
+|[`CWindow::GetWindowRect`](#getwindowrect)|Retrieves the window's bounding dimensions.|
+|[`CWindow::GetWindowRgn`](#getwindowrgn)|Obtains a copy of the window region of a window.|
+|[`CWindow::GetWindowText`](#getwindowtext)|Retrieves the window's text.|
+|[`CWindow::GetWindowTextLength`](#getwindowtextlength)|Retrieves the length of the window's text.|
+|[`CWindow::GetWindowThreadID`](#getwindowthreadid)|Retrieves the identifier of the thread that created the specified window.|
+|[`CWindow::GetWindowWord`](#getwindowword)|Retrieves a 16-bit value at a specified offset into the extra window memory.|
+|[`CWindow::GotoDlgCtrl`](#gotodlgctrl)|Sets the keyboard focus to a control in the dialog box.|
+|[`CWindow::HideCaret`](#hidecaret)|Hides the system caret.|
+|[`CWindow::HiliteMenuItem`](#hilitemenuitem)|Highlights or removes the highlight from a top-level menu item.|
+|[`CWindow::Invalidate`](#invalidate)|Invalidates the entire client area.|
+|[`CWindow::InvalidateRect`](#invalidaterect)|Invalidates the client area within the specified rectangle.|
+|[`CWindow::InvalidateRgn`](#invalidatergn)|Invalidates the client area within the specified region.|
+|[`CWindow::IsChild`](#ischild)|Determines whether the specified window is a child window.|
+|[`CWindow::IsDialogMessage`](#isdialogmessage)|Determines whether a message is intended for the specified dialog box.|
+|[`CWindow::IsDlgButtonChecked`](#isdlgbuttonchecked)|Determines the check state of the button.|
+|[`CWindow::IsIconic`](#isiconic)|Determines whether the window is minimized.|
+|[`CWindow::IsParentDialog`](#isparentdialog)|Determines if the parent window of a control is a dialog window.|
+|[`CWindow::IsWindow`](#iswindow)|Determines whether the specified window handle identifies an existing window.|
+|[`CWindow::IsWindowEnabled`](#iswindowenabled)|Determines whether the window is enabled for input.|
+|[`CWindow::IsWindowUnicode`](#iswindowunicode)|Determines whether the specified window is a native Unicode window.|
+|[`CWindow::IsWindowVisible`](#iswindowvisible)|Determines the window's visibility state.|
+|[`CWindow::IsZoomed`](#iszoomed)|Determines whether the window is maximized.|
+|[`CWindow::KillTimer`](#killtimer)|Destroys a timer event.|
+|[`CWindow::LockWindowUpdate`](#lockwindowupdate)|Disables or enables drawing in the window.|
+|[`CWindow::MapWindowPoints`](#mapwindowpoints)|Converts a set of points from the window's coordinate space to the coordinate space of another window.|
+|[`CWindow::MessageBox`](#messagebox)|Displays a message box.|
+|[`CWindow::ModifyStyle`](#modifystyle)|Modifies the window styles.|
+|[`CWindow::ModifyStyleEx`](#modifystyleex)|Modifies the extended window styles.|
+|[`CWindow::MoveWindow`](#movewindow)|Changes the window's size and position.|
+|[`CWindow::NextDlgCtrl`](#nextdlgctrl)|Sets the keyboard focus to the next control in the dialog box.|
+|[`CWindow::OpenClipboard`](#openclipboard)|Opens the Clipboard.|
+|[`CWindow::PostMessage`](#postmessage)|Places a message in the message queue associated with the thread that created the window. Returns without waiting for the thread to process the message.|
+|[`CWindow::PrevDlgCtrl`](#prevdlgctrl)|Sets the keyboard focus to the previous control in the dialog box.|
+|[`CWindow::Print`](#print)|Requests that the window be drawn in a specified device context.|
+|[`CWindow::PrintClient`](#printclient)|Requests that the window's client area be drawn in a specified device context.|
+|[`CWindow::RedrawWindow`](#redrawwindow)|Updates a specified rectangle or region in the client area.|
+|[`CWindow::ReleaseDC`](#releasedc)|Releases a device context.|
+|[`CWindow::ResizeClient`](#resizeclient)|Resizes the window.|
+|[`CWindow::ScreenToClient`](#screentoclient)|Converts screen coordinates to client coordinates.|
+|[`CWindow::ScrollWindow`](#scrollwindow)|Scrolls the specified client area.|
+|[`CWindow::ScrollWindowEx`](#scrollwindowex)|Scrolls the specified client area with additional features.|
+|[`CWindow::SendDlgItemMessage`](#senddlgitemmessage)|Sends a message to a control.|
+|[`CWindow::SendMessage`](#sendmessage)|Sends a message to the window and doesn't return until the window procedure has processed the message.|
+|[`CWindow::SendMessageToDescendants`](#sendmessagetodescendants)|Sends a message to the specified descendant windows.|
+|[`CWindow::SendNotifyMessage`](#sendnotifymessage)|Sends a message to the window. If the window was created by the calling thread, `SendNotifyMessage` doesn't return until the window procedure has processed the message. Otherwise, it returns immediately.|
+|[`CWindow::SetActiveWindow`](#setactivewindow)|Activates the window.|
+|[`CWindow::SetCapture`](#setcapture)|Sends all subsequent mouse input to the window.|
+|[`CWindow::SetClipboardViewer`](#setclipboardviewer)|Adds the window to the Clipboard viewer chain.|
+|[`CWindow::SetDlgCtrlID`](#setdlgctrlid)|Changes the window's identifier.|
+|[`CWindow::SetDlgItemInt`](#setdlgitemint)|Changes a control's text to the string representation of an integer value.|
+|[`CWindow::SetDlgItemText`](#setdlgitemtext)|Changes a control's text.|
+|[`CWindow::SetFocus`](#setfocus)|Sets the input focus to the window.|
+|[`CWindow::SetFont`](#setfont)|Changes the window's current font.|
+|[`CWindow::SetHotKey`](#sethotkey)|Associates a hot key with the window.|
+|[`CWindow::SetIcon`](#seticon)|Changes the window's large or small icon.|
+|[`CWindow::SetMenu`](#setmenu)|Changes the window's current menu.|
+|[`CWindow::SetParent`](#setparent)|Changes the parent window.|
+|[`CWindow::SetRedraw`](#setredraw)|Sets or clears the redraw flag.|
+|[`CWindow::SetScrollInfo`](#setscrollinfo)|Sets the parameters of a scroll bar.|
+|[`CWindow::SetScrollPos`](#setscrollpos)|Changes the position of the scroll box.|
+|[`CWindow::SetScrollRange`](#setscrollrange)|Changes the scroll bar range.|
+|[`CWindow::SetTimer`](#settimer)|Creates a timer event.|
+|[`CWindow::SetWindowContextHelpId`](#setwindowcontexthelpid)|Sets the window's help context identifier.|
+|[`CWindow::SetWindowLong`](#setwindowlong)|Sets a 32-bit value at a specified offset into the extra window memory.|
+|[`CWindow::SetWindowLongPtr`](#setwindowlongptr)|Changes an attribute of the specified window, and also sets a value at the specified offset in the extra window memory.|
+|[`CWindow::SetWindowPlacement`](#setwindowplacement)|Sets the show state and positions.|
+|[`CWindow::SetWindowPos`](#setwindowpos)|Sets the size, position, and Z order.|
+|[`CWindow::SetWindowRgn`](#setwindowrgn)|Sets the window region of a window.|
+|[`CWindow::SetWindowText`](#setwindowtext)|Changes the window's text.|
+|[`CWindow::SetWindowWord`](#setwindowword)|Sets a 16-bit value at a specified offset into the extra window memory.|
+|[`CWindow::ShowCaret`](#showcaret)|Displays the system caret.|
+|[`CWindow::ShowOwnedPopups`](#showownedpopups)|Shows or hides the pop-up windows owned by the window.|
+|[`CWindow::ShowScrollBar`](#showscrollbar)|Shows or hides a scroll bar.|
+|[`CWindow::ShowWindow`](#showwindow)|Sets the window's show state.|
+|[`CWindow::ShowWindowAsync`](#showwindowasync)|Sets the show state of a window created by a different thread.|
+|[`CWindow::UpdateWindow`](#updatewindow)|Updates the client area.|
+|[`CWindow::ValidateRect`](#validaterect)|Validates the client area within the specified rectangle.|
+|[`CWindow::ValidateRgn`](#validatergn)|Validates the client area within the specified region.|
+|[`CWindow::WinHelp`](#winhelp)|Starts Windows Help.|
### Public Operators
|Name|Description|
|----------|-----------------|
-|[CWindow::operator HWND](#operator_hwnd)|Converts the `CWindow` object to an HWND.|
-|[CWindow::operator =](#operator_eq)|Assigns an HWND to the `CWindow` object.|
+|[`CWindow::operator HWND`](#operator_hwnd)|Converts the `CWindow` object to an `HWND`.|
+|[`CWindow::operator =`](#operator_eq)|Assigns an `HWND` to the `CWindow` object.|
### Public Data Members
|Name|Description|
|----------|-----------------|
-|[CWindow::m_hWnd](#m_hwnd)|The handle to the window associated with the `CWindow` object.|
-|[CWindow::rcDefault](#rcdefault)|Contains default window dimensions.|
+|[`CWindow::m_hWnd`](#m_hwnd)|The handle to the window associated with the `CWindow` object.|
+|[`CWindow::rcDefault`](#rcdefault)|Contains default window dimensions.|
## Remarks
`CWindow` provides the base functionality for manipulating a window in ATL. Many of the `CWindow` methods simply wrap one of the Win32 API functions. For example, compare the prototypes for `CWindow::ShowWindow` and `ShowWindow`:
-|CWindow method|Win32 function|
-|--------------------|--------------------|
-|**BOOL ShowWindow( int** `nCmdShow` **);**|**BOOL ShowWindow( HWND** `hWnd` **, int** `nCmdShow` **);**|
+| CWindow method | Win32 function |
+|--|--|
+| `BOOL ShowWindow( int nCmdShow );` | `BOOL ShowWindow( HWND hWnd , int nCmdShow );` |
`CWindow::ShowWindow` calls the Win32 function `ShowWindow` by passing `CWindow::m_hWnd` as the first parameter. Every `CWindow` method that directly wraps a Win32 function passes the `m_hWnd` member; therefore, much of the `CWindow` documentation will refer you to the Windows SDK.
> [!NOTE]
> Not every window-related Win32 function is wrapped by `CWindow`, and not every `CWindow` method wraps a Win32 function.
-`CWindow::m_hWnd` stores the HWND that identifies a window. An HWND is attached to your object when you:
+`CWindow::m_hWnd` stores the `HWND` that identifies a window. An `HWND` is attached to your object when you:
-- Specify an HWND in `CWindow`'s constructor.
+- Specify an `HWND` in `CWindow`'s constructor.
- Call `CWindow::Attach`.
-- Use `CWindow`'s **operator =**.
+- Use `CWindow`'s **`operator =`**.
- Create or subclass a window using one of the following classes derived from `CWindow`:
-[CWindowImpl](../../atl/reference/cwindowimpl-class.md) Allows you to create a new window or subclass an existing window.
+[`CWindowImpl`](../../atl/reference/cwindowimpl-class.md) Allows you to create a new window or subclass an existing window.
-[CContainedWindow](../../atl/reference/ccontainedwindowt-class.md) Implements a window contained within another object. You can create a new window or subclass an existing window.
+[`CContainedWindow`](../../atl/reference/ccontainedwindowt-class.md) Implements a window contained within another object. You can create a new window or subclass an existing window.
-[CDialogImpl](../../atl/reference/cdialogimpl-class.md) Allows you to create a modal or modeless dialog box.
+[`CDialogImpl`](../../atl/reference/cdialogimpl-class.md) Allows you to create a modal or modeless dialog box.
For more information about windows, see [Windows](/windows/win32/winmsg/windows) and subsequent topics in the Windows SDK. For more information about using windows in ATL, see the article [ATL Window Classes](../../atl/atl-window-classes.md).
## Requirements
-**Header:** atlwin.h
+**Header:** `atlwin.h`
-## CWindow::ArrangeIconicWindows
+## `CWindow::ArrangeIconicWindows`
Arranges all minimized child windows.
@@ -234,11 +233,11 @@ UINT ArrangeIconicWindows() throw();
### Remarks
-See [ArrangeIconicWindows](/windows/win32/api/winuser/nf-winuser-arrangeiconicwindows) in the Windows SDK.
+See [`ArrangeIconicWindows`](/windows/win32/api/winuser/nf-winuser-arrangeiconicwindows) in the Windows SDK.
-## CWindow::Attach
+## `CWindow::Attach`
-Attaches the window identified by *hWndNew* to the `CWindow` object.
+Attaches the window identified by *`hWndNew`* to the `CWindow` object.
```cpp
void Attach(HWND hWndNew) throw();
@@ -246,14 +245,14 @@ void Attach(HWND hWndNew) throw();
### Parameters
-*hWndNew*
+*`hWndNew`*\
[in] The handle to a window.
### Example
[!code-cpp[NVC_ATL_Windowing#1](../../atl/codesnippet/cpp/cwindow-class_1.cpp)]
-## CWindow::BeginPaint
+## `CWindow::BeginPaint`
Prepares the window for painting.
@@ -263,13 +262,13 @@ HDC BeginPaint(LPPAINTSTRUCT lpPaint) throw();
### Remarks
-See [BeginPaint](/windows/win32/api/winuser/nf-winuser-beginpaint) in the Windows SDK.
+See [`BeginPaint`](/windows/win32/api/winuser/nf-winuser-beginpaint) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#2](../../atl/codesnippet/cpp/cwindow-class_2.cpp)]
-## CWindow::BringWindowToTop
+## `CWindow::BringWindowToTop`
Brings the window to the top of the Z order.
@@ -279,13 +278,13 @@ BOOL BringWindowToTop() throw();
### Remarks
-See [BringWindowToTop](/windows/win32/api/winuser/nf-winuser-bringwindowtotop) in the Windows SDK.
+See [`BringWindowToTop`](/windows/win32/api/winuser/nf-winuser-bringwindowtotop) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#3](../../atl/codesnippet/cpp/cwindow-class_3.cpp)]
-## CWindow::CenterWindow
+## `CWindow::CenterWindow`
Centers the window against a given window.
@@ -295,18 +294,18 @@ BOOL CenterWindow(HWND hWndCenter = NULL) throw();
### Parameters
-*hWndCenter*
-[in] The handle to the window against which to center. If this parameter is NULL (the default value), the method will set *hWndCenter* to the window's parent window if it is a child window. Otherwise, it will set *hWndCenter* to the window's owner window.
+*`hWndCenter`*\
+[in] The handle to the window against which to center. If this parameter is `NULL` (the default value), the method will set *`hWndCenter`* to the window's parent window if it's a child window. Otherwise, it will set *`hWndCenter`* to the window's owner window.
### Return Value
-TRUE if the window is successfully centered; otherwise, FALSE.
+`TRUE` if the window is successfully centered; otherwise, `FALSE`.
### Example
[!code-cpp[NVC_ATL_Windowing#4](../../atl/codesnippet/cpp/cwindow-class_4.cpp)]
-## CWindow::ChangeClipboardChain
+## `CWindow::ChangeClipboardChain`
Removes the window from the chain of Clipboard viewers.
@@ -316,9 +315,9 @@ BOOL ChangeClipboardChain(HWND hWndNewNext) throw();
### Remarks
-See [ChangeClipboardChain](/windows/win32/api/winuser/nf-winuser-changeclipboardchain) in the Windows SDK.
+See [`ChangeClipboardChain`](/windows/win32/api/winuser/nf-winuser-changeclipboardchain) in the Windows SDK.
-## CWindow::CheckDlgButton
+## `CWindow::CheckDlgButton`
Changes the check state of the specified button.
@@ -328,9 +327,9 @@ BOOL CheckDlgButton(int nIDButton, UINT nCheck) throw();
### Remarks
-See [CheckDlgButton](/windows/win32/api/winuser/nf-winuser-checkdlgbutton) in the Windows SDK.
+See [`CheckDlgButton`](/windows/win32/api/winuser/nf-winuser-checkdlgbutton) in the Windows SDK.
-## CWindow::CheckRadioButton
+## `CWindow::CheckRadioButton`
Checks the specified radio button.
@@ -343,9 +342,9 @@ BOOL CheckRadioButton(
### Remarks
-See [CheckRadioButton](/windows/win32/api/winuser/nf-winuser-checkradiobutton) in the Windows SDK.
+See [`CheckRadioButton`](/windows/win32/api/winuser/nf-winuser-checkradiobutton) in the Windows SDK.
-## CWindow::ChildWindowFromPoint
+## `CWindow::ChildWindowFromPoint`
Retrieves the child window containing the specified point.
@@ -355,9 +354,9 @@ HWND ChildWindowFromPoint(POINT point) const throw();
### Remarks
-See [ChildWindowFromPoint](/windows/win32/api/winuser/nf-winuser-childwindowfrompoint) in the Windows SDK.
+See [`ChildWindowFromPoint`](/windows/win32/api/winuser/nf-winuser-childwindowfrompoint) in the Windows SDK.
-## CWindow::ChildWindowFromPointEx
+## `CWindow::ChildWindowFromPointEx`
Retrieves a particular type of child window containing the specified point.
@@ -367,9 +366,9 @@ HWND ChildWindowFromPoint(POINT point, UINT uFlags) const throw();
### Remarks
-See [ChildWindowFromPointEx](/windows/win32/api/winuser/nf-winuser-childwindowfrompointex) in the Windows SDK.
+See [`ChildWindowFromPointEx`](/windows/win32/api/winuser/nf-winuser-childwindowfrompointex) in the Windows SDK.
-## CWindow::ClientToScreen
+## `CWindow::ClientToScreen`
Converts client coordinates to screen coordinates.
@@ -380,11 +379,11 @@ BOOL ClientToScreen(LPRECT lpRect) const throw();
### Remarks
-See [ClientToScreen](/windows/win32/api/winuser/nf-winuser-clienttoscreen) in the Windows SDK.
+See [`ClientToScreen`](/windows/win32/api/winuser/nf-winuser-clienttoscreen) in the Windows SDK.
-The second version of this method allows you to convert the coordinates of a [RECT](/windows/win32/api/windef/ns-windef-rect) structure.
+The second version of this method allows you to convert the coordinates of a [`RECT`](/windows/win32/api/windef/ns-windef-rect) structure.
-## CWindow::Create
+## `CWindow::Create`
Creates a window.
@@ -402,43 +401,43 @@ HWND Create(
### Parameters
-*lpstrWndClass*
+*`lpstrWndClass`*\
[in] A pointer to the window's class.
-*hWndParent*
+*`hWndParent`*\
[in] The handle to the parent or owner window.
-*rect*
-[in] A variable of type [_U_RECT](../../atl/reference/u-rect-class.md) specifying the position of the window. The default value is NULL. When this parameter is NULL, the value of `CWindow::rcDefault` is used.
+*`rect`*\
+[in] A variable of type [`_U_RECT`](../../atl/reference/u-rect-class.md) specifying the position of the window. The default value is `NULL`. When this parameter is `NULL`, the value of `CWindow::rcDefault` is used.
-*szWindowName*
-[in] Specifies the name of the window. The default value is NULL.
+*`szWindowName`*\
+[in] Specifies the name of the window. The default value is `NULL`.
-*dwStyle*
-[in] The style of the window. The default value is 0, meaning no style is specified. For a list of possible values, see [CreateWindow](/windows/win32/api/winuser/nf-winuser-createwindoww) in the Windows SDK.
+*`dwStyle`*\
+[in] The style of the window. The default value is 0, meaning no style is specified. For a list of possible values, see [`CreateWindow`](/windows/win32/api/winuser/nf-winuser-createwindoww) in the Windows SDK.
-*dwExStyle*
-[in] The extended window style. The default value is 0, meaning no extended style is specified. For a list of possible values, see [CreateWindowEx](/windows/win32/api/winuser/nf-winuser-createwindowexw) in the Windows SDK.
+*`dwExStyle`*\
+[in] The extended window style. The default value is 0, meaning no extended style is specified. For a list of possible values, see [`CreateWindowEx`](/windows/win32/api/winuser/nf-winuser-createwindowexw) in the Windows SDK.
-*MenuOrID*
-[in] A variable of type [_U_MENUorID](../../atl/reference/u-menuorid-class.md) specifying a handle to a menu or a window identifier. The default value is 0U.
+*`MenuOrID`*\
+[in] A variable of type [`_U_MENUorID`](../../atl/reference/u-menuorid-class.md) specifying a handle to a menu or a window identifier. The default value is `0U`.
-*lpCreateParam*
-A pointer to the window-creation data contained in a [CREATESTRUCT](/windows/win32/api/winuser/ns-winuser-createstructw) structure.
+*`lpCreateParam`*\
+A pointer to the window-creation data contained in a [`CREATESTRUCT`](/windows/win32/api/winuser/ns-winuser-createstructw) structure.
### Return Value
-If successful, the handle to the newly created window, specified by [m_hWnd](#m_hwnd). Otherwise, NULL.
+If successful, the handle to the newly created window, specified by [`m_hWnd`](#m_hwnd). Otherwise, `NULL`.
### Remarks
`CWindow::rcDefault` is defined as `__declspec(selectany) RECT CWindow::rcDefault = {CW_USEDEFAULT, CW_USEDEFAULT, 0, 0};`.
-See [CreateWindow](/windows/win32/api/winuser/nf-winuser-createwindoww) in the Windows SDK for more information.
+See [`CreateWindow`](/windows/win32/api/winuser/nf-winuser-createwindoww) in the Windows SDK for more information.
-**Note** If 0 is used as the value for the *MenuOrID* parameter, it must be specified as 0U (the default value) to avoid a compiler error.
+**Note** If 0 is used as the value for the *`MenuOrID`* parameter, it must be specified as `0U` (the default value) to avoid a compiler error.
-## CWindow::CreateCaret
+## `CWindow::CreateCaret`
Creates a new shape for the system caret.
@@ -448,9 +447,9 @@ BOOL CreateCaret(HBITMAP pBitmap) throw();
### Remarks
-See [CreateCaret](/windows/win32/api/winuser/nf-winuser-createcaret) in the Windows SDK.
+See [`CreateCaret`](/windows/win32/api/winuser/nf-winuser-createcaret) in the Windows SDK.
-## CWindow::CreateGrayCaret
+## `CWindow::CreateGrayCaret`
Creates a gray rectangle for the system caret.
@@ -460,11 +459,11 @@ BOOL CreateGrayCaret(int nWidth, int nHeight) throw();
### Remarks
-See [CreateCaret](/windows/win32/api/winuser/nf-winuser-createcaret) in the Windows SDK.
+See [`CreateCaret`](/windows/win32/api/winuser/nf-winuser-createcaret) in the Windows SDK.
-Passes (HBITMAP) 1 for the bitmap handle parameter to the Win32 function.
+Passes `(HBITMAP) 1` for the bitmap handle parameter to the Win32 function.
-## CWindow::CreateSolidCaret
+## `CWindow::CreateSolidCaret`
Creates a solid rectangle for the system caret.
@@ -474,11 +473,11 @@ BOOL CreateSolidCaret(int nWidth, int nHeight) throw();
### Remarks
-See [CreateCaret](/windows/win32/api/winuser/nf-winuser-createcaret) in the Windows SDK.
+See [`CreateCaret`](/windows/win32/api/winuser/nf-winuser-createcaret) in the Windows SDK.
-Passes (HBITMAP) 0 for the bitmap handle parameter to the Win32 function.
+Passes `(HBITMAP) 0` for the bitmap handle parameter to the Win32 function.
-## CWindow::CWindow
+## `CWindow::CWindow`
The constructor.
@@ -488,17 +487,17 @@ CWindow(HWND hWnd = NULL) throw();
### Parameters
-*hWnd*
+*`hWnd`*\
[in] The handle to a window.
### Remarks
-Initializes the [m_hWnd](#m_hwnd) member to *hWnd*, which by default is NULL.
+Initializes the [`m_hWnd`](#m_hwnd) member to *`hWnd`*, which by default is `NULL`.
> [!NOTE]
-> `CWindow::CWindow` does not create a window. Classes [CWindowImpl](../../atl/reference/cwindowimpl-class.md), [CContainedWindow](../../atl/reference/ccontainedwindowt-class.md), and [CDialogImpl](../../atl/reference/cdialogimpl-class.md) (all of which derive from `CWindow`) provide a method to create a window or dialog box, which is then assigned to `CWindow::m_hWnd`. You can also use the [CreateWindow](/windows/win32/api/winuser/nf-winuser-createwindoww) Win32 function.
+> `CWindow::CWindow` does not create a window. Classes [`CWindowImpl`](../../atl/reference/cwindowimpl-class.md), [`CContainedWindow`](../../atl/reference/ccontainedwindowt-class.md), and [`CDialogImpl`](../../atl/reference/cdialogimpl-class.md) (all of which derive from `CWindow`) provide a method to create a window or dialog box, which is then assigned to `CWindow::m_hWnd`. You can also use the [`CreateWindow`](/windows/win32/api/winuser/nf-winuser-createwindoww) Win32 function.
-## CWindow::DeferWindowPos
+## `CWindow::DeferWindowPos`
Updates the specified multiple-window-position structure for the specified window.
@@ -515,11 +514,11 @@ HDWP DeferWindowPos(
### Remarks
-See [DeferWindowPos](/windows/win32/api/winuser/nf-winuser-deferwindowpos) in the Windows SDK.
+See [`DeferWindowPos`](/windows/win32/api/winuser/nf-winuser-deferwindowpos) in the Windows SDK.
-## CWindow::DestroyWindow
+## `CWindow::DestroyWindow`
-Destroys the window associated with the `CWindow` object and sets [m_hWnd](#m_hwnd) to NULL.
+Destroys the window associated with the `CWindow` object and sets [`m_hWnd`](#m_hwnd) to `NULL`.
```
BOOL DestroyWindow() throw();
@@ -527,17 +526,17 @@ BOOL DestroyWindow() throw();
### Remarks
-See [DestroyWindow](/windows/win32/api/winuser/nf-winuser-destroywindow) in the Windows SDK.
+See [`DestroyWindow`](/windows/win32/api/winuser/nf-winuser-destroywindow) in the Windows SDK.
-It does not destroy the `CWindow` object itself.
+It doesn't destroy the `CWindow` object itself.
### Example
[!code-cpp[NVC_ATL_Windowing#5](../../atl/codesnippet/cpp/cwindow-class_5.cpp)]
-## CWindow::Detach
+## `CWindow::Detach`
-Detaches [m_hWnd](#m_hwnd) from the `CWindow` object and sets `m_hWnd` to NULL.
+Detaches [`m_hWnd`](#m_hwnd) from the `CWindow` object and sets `m_hWnd` to `NULL`.
```
HWND Detach() throw();
@@ -545,13 +544,13 @@ HWND Detach() throw();
### Return Value
-The HWND associated with the `CWindow` object.
+The `HWND` associated with the `CWindow` object.
### Example
[!code-cpp[NVC_ATL_Windowing#6](../../atl/codesnippet/cpp/cwindow-class_6.cpp)]
-## CWindow::DlgDirList
+## `CWindow::DlgDirList`
Fills a list box with the names of all files matching a specified path or file name.
@@ -565,9 +564,9 @@ int DlgDirList(
### Remarks
-See [DlgDirList](/windows/win32/api/winuser/nf-winuser-dlgdirlistw) in the Windows SDK.
+See [`DlgDirList`](/windows/win32/api/winuser/nf-winuser-dlgdirlistw) in the Windows SDK.
-## CWindow::DlgDirListComboBox
+## `CWindow::DlgDirListComboBox`
Fills a combo box with the names of all files matching a specified path or file name.
@@ -581,9 +580,9 @@ int DlgDirListComboBox(
### Remarks
-See [DlgDirListComboBox](/windows/win32/api/winuser/nf-winuser-dlgdirlistcomboboxw) in the Windows SDK.
+See [`DlgDirListComboBox`](/windows/win32/api/winuser/nf-winuser-dlgdirlistcomboboxw) in the Windows SDK.
-## CWindow::DlgDirSelect
+## `CWindow::DlgDirSelect`
Retrieves the current selection from a list box.
@@ -596,9 +595,9 @@ BOOL DlgDirSelect(
### Remarks
-See [DlgDirSelectEx](/windows/win32/api/winuser/nf-winuser-dlgdirselectexw) in the Windows SDK.
+See [`DlgDirSelectEx`](/windows/win32/api/winuser/nf-winuser-dlgdirselectexw) in the Windows SDK.
-## CWindow::DlgDirSelectComboBox
+## `CWindow::DlgDirSelectComboBox`
Retrieves the current selection from a combo box.
@@ -611,9 +610,9 @@ BOOL DlgDirSelectComboBox(
### Remarks
-See [DlgDirSelectComboBoxEx](/windows/win32/api/winuser/nf-winuser-dlgdirselectcomboboxexw) in the Windows SDK.
+See [`DlgDirSelectComboBoxEx`](/windows/win32/api/winuser/nf-winuser-dlgdirselectcomboboxexw) in the Windows SDK.
-## CWindow::DragAcceptFiles
+## `CWindow::DragAcceptFiles`
Registers whether the window accepts dragged files.
@@ -623,9 +622,9 @@ void DragAcceptFiles(BOOL bAccept = TRUE);
### Remarks
-See [DragAcceptFiles](/windows/win32/api/shellapi/nf-shellapi-dragacceptfiles) in the Windows SDK.
+See [`DragAcceptFiles`](/windows/win32/api/shellapi/nf-shellapi-dragacceptfiles) in the Windows SDK.
-## CWindow::DrawMenuBar
+## `CWindow::DrawMenuBar`
Redraws the window's menu bar.
@@ -635,9 +634,9 @@ BOOL DrawMenuBar() throw();
### Remarks
-See [DrawMenuBar](/windows/win32/api/winuser/nf-winuser-drawmenubar) in the Windows SDK.
+See [`DrawMenuBar`](/windows/win32/api/winuser/nf-winuser-drawmenubar) in the Windows SDK.
-## CWindow::EnableScrollBar
+## `CWindow::EnableScrollBar`
Enables or disables the scroll bar arrows.
@@ -647,9 +646,9 @@ BOOL EnableScrollBar(UINT uSBFlags, UINT uArrowFlags = ESB_ENABLE_BOTH) throw();
### Remarks
-See [EnableScrollBar](/windows/win32/api/winuser/nf-winuser-enablescrollbar) in the Windows SDK.
+See [`EnableScrollBar`](/windows/win32/api/winuser/nf-winuser-enablescrollbar) in the Windows SDK.
-## CWindow::EnableWindow
+## `CWindow::EnableWindow`
Enables or disables input.
@@ -659,13 +658,13 @@ BOOL EnableWindow(BOOL bEnable = TRUE) throw();
### Remarks
-See [EnableWindow](/windows/win32/api/winuser/nf-winuser-enablewindow) in the Windows SDK.
+See [`EnableWindow`](/windows/win32/api/winuser/nf-winuser-enablewindow) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#7](../../atl/codesnippet/cpp/cwindow-class_7.cpp)]
-## CWindow::EndPaint
+## `CWindow::EndPaint`
Marks the end of painting.
@@ -675,13 +674,13 @@ void EndPaint(LPPAINTSTRUCT lpPaint) throw();
### Remarks
-See [EndPaint](/windows/win32/api/winuser/nf-winuser-endpaint) in the Windows SDK.
+See [`EndPaint`](/windows/win32/api/winuser/nf-winuser-endpaint) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#2](../../atl/codesnippet/cpp/cwindow-class_2.cpp)]
-## CWindow::FlashWindow
+## `CWindow::FlashWindow`
Flashes the window once.
@@ -691,9 +690,9 @@ BOOL FlashWindow(BOOL bInvert) throw();
### Remarks
-See [FlashWindow](/windows/win32/api/winuser/nf-winuser-flashwindow) in the Windows SDK.
+See [`FlashWindow`](/windows/win32/api/winuser/nf-winuser-flashwindow) in the Windows SDK.
-## CWindow::GetClientRect
+## `CWindow::GetClientRect`
Retrieves the coordinates of the client area.
@@ -703,13 +702,13 @@ BOOL GetClientRect(LPRECT lpRect) const throw();
### Remarks
-See [GetClientRect](/windows/win32/api/winuser/nf-winuser-getclientrect) in the Windows SDK.
+See [`GetClientRect`](/windows/win32/api/winuser/nf-winuser-getclientrect) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#8](../../atl/codesnippet/cpp/cwindow-class_8.cpp)]
-## CWindow::GetDC
+## `CWindow::GetDC`
Retrieves a device context for the client area.
@@ -719,13 +718,13 @@ HDC GetDC() throw();
### Remarks
-See [GetDC](/windows/win32/api/winuser/nf-winuser-getdc) in the Windows SDK.
+See [`GetDC`](/windows/win32/api/winuser/nf-winuser-getdc) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#9](../../atl/codesnippet/cpp/cwindow-class_9.cpp)]
-## CWindow::GetDCEx
+## `CWindow::GetDCEx`
Retrieves a device context for the client area and allows clipping options.
@@ -735,9 +734,9 @@ HDC GetDCEx(HRGN hRgnClip, DWORD flags) throw();
### Remarks
-See [GetDCEx](/windows/win32/api/winuser/nf-winuser-getdcex) in the Windows SDK.
+See [`GetDCEx`](/windows/win32/api/winuser/nf-winuser-getdcex) in the Windows SDK.
-## CWindow::GetDescendantWindow
+## `CWindow::GetDescendantWindow`
Finds the descendant window specified by the given identifier.
@@ -747,7 +746,7 @@ HWND GetDescendantWindow(int nID) const throw();
### Parameters
-*nID*
+*`nID`*\
[in] The identifier of the descendant window to be retrieved.
### Return Value
@@ -758,7 +757,7 @@ The handle to a descendant window.
`GetDescendantWindow` searches the entire tree of child windows, not only the windows that are immediate children.
-## CWindow::GetDlgControl
+## `CWindow::GetDlgControl`
Call this function to get a pointer to an interface of an ActiveX control that is hosted by a composite control or a control-hosting dialog.
@@ -771,24 +770,24 @@ HRESULT GetDlgControl(
### Parameters
-*nID*
+*`nID`*\
[in] The resource ID of the control being retrieved.
-*iid*
+*`iid`*\
[in] The ID of the interface you would like to get from the control.
-*ppCtrl*
+*`ppCtrl`*\
[out] The pointer to the interface.
### Return Value
-Returns S_OK on success or any valid error HRESULT. For example, the function returns E_FAIL if the control specified by *nID* cannot be found and it returns E_NOINTERFACE if the control can be found, but it doesn't support the interface specified by *iid*.
+Returns `S_OK` on success or any valid error `HRESULT`. For example, the function returns `E_FAIL` if the control specified by *`nID`* can't be found and it returns `E_NOINTERFACE` if the control can be found, but it doesn't support the interface specified by *`iid`*.
### Remarks
Using this pointer, you can call methods on the interface.
-## CWindow::GetDlgCtrlID
+## `CWindow::GetDlgCtrlID`
Retrieves the window's identifier (for child windows only).
@@ -798,9 +797,9 @@ int GetDlgCtrlID() const throw();
### Remarks
-See [GetDlgCtrlID](/windows/win32/api/winuser/nf-winuser-getdlgctrlid) in the Windows SDK.
+See [`GetDlgCtrlID`](/windows/win32/api/winuser/nf-winuser-getdlgctrlid) in the Windows SDK.
-## CWindow::GetDlgHost
+## `CWindow::GetDlgHost`
Retrieves a pointer to an interface to the ATL Control hosting container.
@@ -813,24 +812,24 @@ HRESULT GetDlgHost(
### Parameters
-*nID*
+*`nID`*\
[in] The resource ID of the control being retrieved.
-*iid*
+*`iid`*\
[in] The ID of the interface you would like to get from the control.
-*ppHost*
+*`ppHost`*\
[out] The pointer to the interface.
### Return Value
-Returns S_OK if the window specified by *iid* is a Control Container, and the requested interface could be retrieved. Returns E_FAIL if the window is not a Control Container, or if the interface requested could not be retrieved. If a window with the specified ID could not be found, then the return value is equal to HRESULT_FROM_WIN32(ERROR_CONTROL_ID_NOT_FOUND).
+Returns `S_OK` if the window specified by *`iid`* is a Control Container, and the requested interface could be retrieved. Returns `E_FAIL` if the window isn't a Control Container, or if the interface requested couldn't be retrieved. If a window with the specified ID couldn't be found, then the return value is equal to `HRESULT_FROM_WIN32(ERROR_CONTROL_ID_NOT_FOUND)`.
### Remarks
Using this pointer, you can call methods on the interface.
-## CWindow::GetDlgItem
+## `CWindow::GetDlgItem`
Retrieves the specified child window.
@@ -842,7 +841,7 @@ HWND GetDlgItem(int nID) const throw();
See [GetDlgItem](/windows/win32/api/winuser/nf-winuser-getdlgitem) in the Windows SDK.
-## CWindow::GetDlgItemInt
+## `CWindow::GetDlgItemInt`
Translates a control's text to an integer.
@@ -855,9 +854,9 @@ UINT GetDlgItemInt(
### Remarks
-See [GetDlgItemInt](/windows/win32/api/winuser/nf-winuser-getdlgitemint) in the Windows SDK.
+See [`GetDlgItemInt`](/windows/win32/api/winuser/nf-winuser-getdlgitemint) in the Windows SDK.
-## CWindow::GetDlgItemText
+## `CWindow::GetDlgItemText`
Retrieves a control's text.
@@ -876,9 +875,9 @@ BOOL GetDlgItemText(
For more information, see [`GetDlgItemText`](/windows/win32/api/winuser/nf-winuser-getdlgitemtextw) in the Windows SDK.
-The second version of this method allows you to copy the control's text to a BSTR. This version returns TRUE if the text is successfully copied; otherwise, FALSE.
+The second version of this method allows you to copy the control's text to a `BSTR`. This version returns `TRUE` if the text is successfully copied; otherwise, `FALSE`.
-## CWindow::GetExStyle
+## `CWindow::GetExStyle`
Retrieves the extended window styles of the window.
@@ -892,15 +891,15 @@ The window's extended styles.
### Remarks
-To retrieve the regular window styles, call [GetStyle](#getstyle).
+To retrieve the regular window styles, call [`GetStyle`](#getstyle).
### Example
[!code-cpp[NVC_ATL_Windowing#10](../../atl/codesnippet/cpp/cwindow-class_10.cpp)]
-## CWindow::GetFont
+## `CWindow::GetFont`
-Retrieves the window's current font by sending a [WM_GETFONT](/windows/win32/winmsg/wm-getfont) message to the window.
+Retrieves the window's current font by sending a [`WM_GETFONT`](/windows/win32/winmsg/wm-getfont) message to the window.
```
HFONT GetFont() const throw();
@@ -910,9 +909,9 @@ HFONT GetFont() const throw();
A font handle.
-## CWindow::GetHotKey
+## `CWindow::GetHotKey`
-Determines the hot key associated with the window by sending a WM_GETHOTKEY message.
+Determines the hot key associated with the window by sending a `WM_GETHOTKEY` message.
```
DWORD GetHotKey() const throw();
@@ -920,9 +919,9 @@ DWORD GetHotKey() const throw();
### Return Value
-The virtual key code and modifiers for the hot key associated with the window. For a list of possible modifiers, see [WM_GETHOTKEY](/windows/win32/inputdev/wm-gethotkey) in the Windows SDK. For a list of standard virtual key codes, see Winuser.h.
+The virtual key code and modifiers for the hot key associated with the window. For a list of possible modifiers, see [`WM_GETHOTKEY`](/windows/win32/inputdev/wm-gethotkey) in the Windows SDK. For a list of standard virtual key codes, see `Winuser.h`.
-## CWindow::GetIcon
+## `CWindow::GetIcon`
Retrieves the handle to the window's large or small icon.
@@ -932,8 +931,8 @@ HICON GetIcon(BOOL bBigIcon = TRUE) const;
### Parameters
-*bBigIcon*
-[in] If TRUE (the default value) the method returns the large icon. Otherwise, it returns the small icon.
+*`bBigIcon`*\
+[in] If `TRUE` (the default value) the method returns the large icon. Otherwise, it returns the small icon.
### Return Value
@@ -941,9 +940,9 @@ An icon handle.
### Remarks
-`GetIcon` sends a [WM_GETICON](/windows/win32/winmsg/wm-geticon) message to the window.
+`GetIcon` sends a [`WM_GETICON`](/windows/win32/winmsg/wm-geticon) message to the window.
-## CWindow::GetLastActivePopup
+## `CWindow::GetLastActivePopup`
Retrieves the most recently active pop-up window.
@@ -953,9 +952,9 @@ HWND GetLastActivePopup() const throw();
### Remarks
-See [GetLastActivePopup](/windows/win32/api/winuser/nf-winuser-getlastactivepopup) in the Windows SDK.
+See [`GetLastActivePopup`](/windows/win32/api/winuser/nf-winuser-getlastactivepopup) in the Windows SDK.
-## CWindow::GetMenu
+## `CWindow::GetMenu`
Retrieves the window's menu.
@@ -965,9 +964,9 @@ HMENU GetMenu() const throw();
### Remarks
-See [GetMenu](/windows/win32/api/winuser/nf-winuser-getmenu) in the Windows SDK.
+See [`GetMenu`](/windows/win32/api/winuser/nf-winuser-getmenu) in the Windows SDK.
-## CWindow::GetNextDlgGroupItem
+## `CWindow::GetNextDlgGroupItem`
Retrieves the previous or next control within a group of controls.
@@ -977,11 +976,11 @@ HWND GetNextDlgGroupItem(HWND hWndCtl, BOOL bPrevious = FALSE) const throw();
### Remarks
-See [GetNextDlgGroupItem](/windows/win32/api/winuser/nf-winuser-getnextdlggroupitem) in the Windows SDK.
+See [`GetNextDlgGroupItem`](/windows/win32/api/winuser/nf-winuser-getnextdlggroupitem) in the Windows SDK.
-## CWindow::GetNextDlgTabItem
+## `CWindow::GetNextDlgTabItem`
-Retrieves the previous or next control having the WS_TABSTOP style.
+Retrieves the previous or next control having the `WS_TABSTOP` style.
```
HWND GetNextDlgTabItem(HWND hWndCtl, BOOL bPrevious = FALSE) const throw();
@@ -989,9 +988,9 @@ HWND GetNextDlgTabItem(HWND hWndCtl, BOOL bPrevious = FALSE) const throw();
### Remarks
-See [GetNextDlgTabItem](/windows/win32/api/winuser/nf-winuser-getnextdlgtabitem) in the Windows SDK.
+See [`GetNextDlgTabItem`](/windows/win32/api/winuser/nf-winuser-getnextdlgtabitem) in the Windows SDK.
-## CWindow::GetParent
+## `CWindow::GetParent`
Retrieves the immediate parent window.
@@ -1001,13 +1000,13 @@ HWND GetParent() const throw();
### Remarks
-See [GetParent](/windows/win32/api/winuser/nf-winuser-getparent) in the Windows SDK.
+See [`GetParent`](/windows/win32/api/winuser/nf-winuser-getparent) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#11](../../atl/codesnippet/cpp/cwindow-class_11.cpp)]
-## CWindow::GetScrollInfo
+## `CWindow::GetScrollInfo`
Retrieves the parameters of a scroll bar.
@@ -1017,9 +1016,9 @@ BOOL GetScrollInfo(int nBar, LPSCROLLINFO lpScrollInfo) throw();
### Remarks
-See [GetScrollInfo](/windows/win32/api/winuser/nf-winuser-getscrollinfo) in the Windows SDK.
+See [`GetScrollInfo`](/windows/win32/api/winuser/nf-winuser-getscrollinfo) in the Windows SDK.
-## CWindow::GetScrollPos
+## `CWindow::GetScrollPos`
Retrieves the position of the scroll box.
@@ -1029,9 +1028,9 @@ int GetScrollPos(int nBar) const throw();
### Remarks
-See [GetScrollPos](/windows/win32/api/winuser/nf-winuser-getscrollpos) in the Windows SDK.
+See [`GetScrollPos`](/windows/win32/api/winuser/nf-winuser-getscrollpos) in the Windows SDK.
-## CWindow::GetScrollRange
+## `CWindow::GetScrollRange`
Retrieves the scroll bar range.
@@ -1044,9 +1043,9 @@ BOOL GetScrollRange(
### Remarks
-See [GetScrollRange](/windows/win32/api/winuser/nf-winuser-getscrollrange) in the Windows SDK.
+See [`GetScrollRange`](/windows/win32/api/winuser/nf-winuser-getscrollrange) in the Windows SDK.
-## CWindow::GetStyle
+## `CWindow::GetStyle`
Retrieves the window styles of the window.
@@ -1060,13 +1059,13 @@ The window's styles.
### Remarks
-To retrieve the extended window styles, call [GetExStyle](#getexstyle).
+To retrieve the extended window styles, call [`GetExStyle`](#getexstyle).
### Example
[!code-cpp[NVC_ATL_Windowing#12](../../atl/codesnippet/cpp/cwindow-class_12.cpp)]
-## CWindow::GetSystemMenu
+## `CWindow::GetSystemMenu`
Creates a copy of the system menu for modification.
@@ -1076,9 +1075,9 @@ HMENU GetSystemMenu(BOOL bRevert) const throw();
### Remarks
-See [GetSystemMenu](/windows/win32/api/winuser/nf-winuser-getsystemmenu) in the Windows SDK.
+See [`GetSystemMenu`](/windows/win32/api/winuser/nf-winuser-getsystemmenu) in the Windows SDK.
-## CWindow::GetTopLevelParent
+## `CWindow::GetTopLevelParent`
Retrieves the window's top-level parent window.
@@ -1090,7 +1089,7 @@ HWND GetTopLevelParent() const throw();
The handle to the top-level parent window.
-## CWindow::GetTopLevelWindow
+## `CWindow::GetTopLevelWindow`
Retrieves the window's top-level parent or owner window.
@@ -1102,7 +1101,7 @@ HWND GetTopLevelWindow() const throw();
The handle to the top-level owner window.
-## CWindow::GetTopWindow
+## `CWindow::GetTopWindow`
Retrieves the top-level child window.
@@ -1112,13 +1111,13 @@ HWND GetTopWindow() const throw();
### Remarks
-See [GetTopWindow](/windows/win32/api/winuser/nf-winuser-gettopwindow) in the Windows SDK.
+See [`GetTopWindow`](/windows/win32/api/winuser/nf-winuser-gettopwindow) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#13](../../atl/codesnippet/cpp/cwindow-class_13.cpp)]
-## CWindow::GetUpdateRect
+## `CWindow::GetUpdateRect`
Retrieves the coordinates of the smallest rectangle that completely encloses the update region.
@@ -1128,9 +1127,9 @@ BOOL GetUpdateRect(LPRECT lpRect, BOOL bErase = FALSE) throw();
### Remarks
-See [GetUpdateRect](/windows/win32/api/winuser/nf-winuser-getupdaterect) in the Windows SDK.
+See [`GetUpdateRect`](/windows/win32/api/winuser/nf-winuser-getupdaterect) in the Windows SDK.
-## CWindow::GetUpdateRgn
+## `CWindow::GetUpdateRgn`
Retrieves the update region and copies it into a specified region.
@@ -1140,9 +1139,9 @@ int GetUpdateRgn(HRGN hRgn, BOOL bErase = FALSE) throw();
### Remarks
-See [GetUpdateRgn](/windows/win32/api/winuser/nf-winuser-getupdatergn) in the Windows SDK.
+See [`GetUpdateRgn`](/windows/win32/api/winuser/nf-winuser-getupdatergn) in the Windows SDK.
-## CWindow::GetWindow
+## `CWindow::GetWindow`
Retrieves the specified window.
@@ -1154,7 +1153,7 @@ HWND GetWindow(UINT nCmd) const throw();
See `GetWindow` in the Windows SDK.
-## CWindow::GetWindowContextHelpId
+## `CWindow::GetWindowContextHelpId`
Retrieves the window's help context identifier.
@@ -1164,9 +1163,9 @@ DWORD GetWindowContextHelpId() const throw();
### Remarks
-See [GetWindowContextHelpId](/windows/win32/api/winuser/nf-winuser-getwindowcontexthelpid) in the Windows SDK.
+See [`GetWindowContextHelpId`](/windows/win32/api/winuser/nf-winuser-getwindowcontexthelpid) in the Windows SDK.
-## CWindow::GetWindowDC
+## `CWindow::GetWindowDC`
Retrieves a device context for the entire window.
@@ -1176,13 +1175,13 @@ HDC GetWindowDC() throw();
### Remarks
-See [GetWindowDC](/windows/win32/api/winuser/nf-winuser-getwindowdc) in the Windows SDK.
+See [`GetWindowDC`](/windows/win32/api/winuser/nf-winuser-getwindowdc) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#14](../../atl/codesnippet/cpp/cwindow-class_14.cpp)]
-## CWindow::GetWindowLong
+## `CWindow::GetWindowLong`
Retrieves a 32-bit value at a specified offset into the extra window memory.
@@ -1192,12 +1191,12 @@ LONG GetWindowLong(int nIndex) const throw();
### Remarks
-See [GetWindowLong](/windows/win32/api/winuser/nf-winuser-getwindowlongw) in the Windows SDK.
+See [`GetWindowLong`](/windows/win32/api/winuser/nf-winuser-getwindowlongw) in the Windows SDK.
> [!NOTE]
-> To write code that is compatible with both 32-bit and 64-bit versions of Windows, use [CWindow::GetWindowLongPtr](#getwindowlongptr).
+> To write code that is compatible with both 32-bit and 64-bit versions of Windows, use [`CWindow::GetWindowLongPtr`](#getwindowlongptr).
-## CWindow::GetWindowLongPtr
+## `CWindow::GetWindowLongPtr`
Retrieves information about the specified window, including a value at a specified offset into the extra window memory.
@@ -1209,14 +1208,14 @@ LONG_PTR GetWindowLongPtr(int nIndex) const throw();
For more information, see [`GetWindowLongPtr`](/windows/win32/api/winuser/nf-winuser-getwindowlongptrw) in the Windows SDK.
-If you are retrieving a pointer or a handle, this function supersedes the `CWindow::GetWindowLong` method.
+If you're retrieving a pointer or a handle, this function supersedes the `CWindow::GetWindowLong` method.
> [!NOTE]
> Pointers and handles are 32 bits on 32-bit Windows and 64 bits on 64-bit Windows.
To write code that is compatible with both 32-bit and 64-bit versions of Windows, use `CWindow::GetWindowLongPtr`.
-## CWindow::GetWindowPlacement
+## `CWindow::GetWindowPlacement`
Retrieves the show state and positions.
@@ -1226,9 +1225,9 @@ BOOL GetWindowPlacement(WINDOWPLACEMENT FAR* lpwndpl) const throw();
### Remarks
-See [GetWindowPlacement](/windows/win32/api/winuser/nf-winuser-getwindowplacement) in the Windows SDK.
+See [`GetWindowPlacement`](/windows/win32/api/winuser/nf-winuser-getwindowplacement) in the Windows SDK.
-## CWindow::GetWindowProcessID
+## `CWindow::GetWindowProcessID`
Retrieves the identifier of the process that created the window.
@@ -1238,13 +1237,13 @@ DWORD GetWindowProcessID() throw();
### Remarks
-See [GetWindowThreadProcessID](/windows/win32/api/winuser/nf-winuser-getwindowthreadprocessid) in the Windows SDK.
+See [`GetWindowThreadProcessID`](/windows/win32/api/winuser/nf-winuser-getwindowthreadprocessid) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#15](../../atl/codesnippet/cpp/cwindow-class_15.cpp)]
-## CWindow::GetWindowRect
+## `CWindow::GetWindowRect`
Retrieves the window's bounding dimensions.
@@ -1254,9 +1253,9 @@ BOOL GetWindowRect(LPRECT lpRect) const throw();
### Remarks
-See [GetWindowRect](/windows/win32/api/winuser/nf-winuser-getwindowrect) in the Windows SDK.
+See [`GetWindowRect`](/windows/win32/api/winuser/nf-winuser-getwindowrect) in the Windows SDK.
-## CWindow::GetWindowRgn
+## `CWindow::GetWindowRgn`
Obtains a copy of the window region of a window.
@@ -1266,9 +1265,9 @@ int GetWindowRgn(HRGN hRgn) throw();
### Remarks
-See [GetWindowRgn](/windows/win32/api/winuser/nf-winuser-getwindowrgn) in the Windows SDK.
+See [`GetWindowRgn`](/windows/win32/api/winuser/nf-winuser-getwindowrgn) in the Windows SDK.
-## CWindow::GetWindowText
+## `CWindow::GetWindowText`
Retrieves the window's text.
@@ -1280,29 +1279,29 @@ int GetWindowText(CSimpleString& strText) const;
### Parameters
-*lpszStringBuf*
+*`lpszStringBuf`*\
A buffer to which to write the window text.
-*nMaxCount*
+*`nMaxCount`*\
The size of the buffer in characters; also the maximum number of characters to write.
-*bstrText*
-A BSTR in which to store the window text.
+*`bstrText`*\
+A `BSTR` in which to store the window text.
-*strText*
+*`strText`*\
A `CString` in which to store the window text.
### Return Value
-If the text is successfully copied, the return value is TRUE; otherwise, the return value is FALSE.
+If the text is successfully copied, the return value is `TRUE`; otherwise, the return value is `FALSE`.
### Remarks
-See [GetWindowText](/windows/win32/api/winuser/nf-winuser-getwindowtextw) in the Windows SDK.
+See [`GetWindowText`](/windows/win32/api/winuser/nf-winuser-getwindowtextw) in the Windows SDK.
-The second version of this method allows you to store the text in a BSTR; the third version allows you to store the result in a [CString](../../atl-mfc-shared/reference/cstringt-class.md), since `CSimpleString` is the base class of `CString`.
+The second version of this method allows you to store the text in a `BSTR`; the third version allows you to store the result in a [`CString`](../../atl-mfc-shared/reference/cstringt-class.md), since `CSimpleString` is the base class of `CString`.
-## CWindow::GetWindowTextLength
+## `CWindow::GetWindowTextLength`
Retrieves the length of the window's text.
@@ -1312,9 +1311,9 @@ int GetWindowTextLength() const throw();
### Remarks
-See [GetWindowTextLength](/windows/win32/api/winuser/nf-winuser-getwindowtextlengthw) in the Windows SDK.
+See [`GetWindowTextLength`](/windows/win32/api/winuser/nf-winuser-getwindowtextlengthw) in the Windows SDK.
-## CWindow::GetWindowThreadID
+## `CWindow::GetWindowThreadID`
Retrieves the identifier of the thread that created the specified window.
@@ -1324,13 +1323,13 @@ DWORD GetWindowThreadID() throw();
### Remarks
-See [GetWindowThreadProcessID](/windows/win32/api/winuser/nf-winuser-getwindowthreadprocessid) in the Windows SDK.
+See [`GetWindowThreadProcessID`](/windows/win32/api/winuser/nf-winuser-getwindowthreadprocessid) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#16](../../atl/codesnippet/cpp/cwindow-class_16.cpp)]
-## CWindow::GetWindowWord
+## `CWindow::GetWindowWord`
Retrieves a 16-bit value at a specified offset into the extra window memory.
@@ -1340,9 +1339,9 @@ WORD GetWindowWord(int nIndex) const throw();
### Remarks
-See [GetWindowLong](/windows/win32/api/winuser/nf-winuser-getwindowlongw) in the Windows SDK.
+See [`GetWindowLong`](/windows/win32/api/winuser/nf-winuser-getwindowlongw) in the Windows SDK.
-## CWindow::GotoDlgCtrl
+## `CWindow::GotoDlgCtrl`
Sets the keyboard focus to a control in the dialog box.
@@ -1352,9 +1351,9 @@ void GotoDlgCtrl(HWND hWndCtrl) const throw();
### Remarks
-See [WM_NEXTDLGCTL](/windows/win32/dlgbox/wm-nextdlgctl) in the Windows SDK.
+See [`WM_NEXTDLGCTL`](/windows/win32/dlgbox/wm-nextdlgctl) in the Windows SDK.
-## CWindow::HideCaret
+## `CWindow::HideCaret`
Hides the system caret.
@@ -1364,13 +1363,13 @@ BOOL HideCaret() throw();
### Remarks
-See [HideCaret](/windows/win32/api/winuser/nf-winuser-hidecaret) in the Windows SDK.
+See [`HideCaret`](/windows/win32/api/winuser/nf-winuser-hidecaret) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#17](../../atl/codesnippet/cpp/cwindow-class_17.cpp)]
-## CWindow::HiliteMenuItem
+## `CWindow::HiliteMenuItem`
Highlights or removes the highlight from a top-level menu item.
@@ -1383,9 +1382,9 @@ BOOL HiliteMenuItem(
### Remarks
-See [HiliteMenuItem](/windows/win32/api/winuser/nf-winuser-hilitemenuitem) in the Windows SDK.
+See [`HiliteMenuItem`](/windows/win32/api/winuser/nf-winuser-hilitemenuitem) in the Windows SDK.
-## CWindow::Invalidate
+## `CWindow::Invalidate`
Invalidates the entire client area.
@@ -1395,15 +1394,15 @@ BOOL Invalidate(BOOL bErase = TRUE) throw();
### Remarks
-See [InvalidateRect](/windows/win32/api/winuser/nf-winuser-invalidaterect) in the Windows SDK.
+See [`InvalidateRect`](/windows/win32/api/winuser/nf-winuser-invalidaterect) in the Windows SDK.
-Passes NULL for the `RECT` parameter to the `InvalidateRect` Win32 function.
+Passes `NULL` for the `RECT` parameter to the `InvalidateRect` Win32 function.
### Example
[!code-cpp[NVC_ATL_Windowing#18](../../atl/codesnippet/cpp/cwindow-class_18.cpp)]
-## CWindow::InvalidateRect
+## `CWindow::InvalidateRect`
Invalidates the client area within the specified rectangle.
@@ -1413,9 +1412,9 @@ BOOL InvalidateRect(LPCRECT lpRect, BOOL bErase = TRUE) throw();
### Remarks
-See [InvalidateRect](/windows/win32/api/winuser/nf-winuser-invalidaterect) in the Windows SDK.
+See [`InvalidateRect`](/windows/win32/api/winuser/nf-winuser-invalidaterect) in the Windows SDK.
-## CWindow::InvalidateRgn
+## `CWindow::InvalidateRgn`
Invalidates the client area within the specified region.
@@ -1427,9 +1426,9 @@ void InvalidateRgn(HRGN hRgn, BOOL bErase = TRUE) throw();
For more information, see [`InvalidateRgn`](/windows/win32/api/winuser/nf-winuser-invalidatergn) in the Windows SDK.
-Specifies a **`void`** return type, while the `InvalidateRgn` Win32 function always returns TRUE.
+Specifies a **`void`** return type, while the `InvalidateRgn` Win32 function always returns `TRUE`.
-## CWindow::IsChild
+## `CWindow::IsChild`
Determines whether the specified window is a child window.
@@ -1439,9 +1438,9 @@ BOOL IsChild(const HWND hWnd) const throw();
### Remarks
-See [IsChild](/windows/win32/api/winuser/nf-winuser-ischild) in the Windows SDK.
+See [`IsChild`](/windows/win32/api/winuser/nf-winuser-ischild) in the Windows SDK.
-## CWindow::IsDialogMessage
+## `CWindow::IsDialogMessage`
Determines whether a message is intended for the specified dialog box.
@@ -1451,9 +1450,9 @@ BOOL IsDialogMessage(LPMSG lpMsg) throw();
### Remarks
-See [IsDialogMessage](/windows/win32/api/winuser/nf-winuser-isdialogmessagew) in the Windows SDK.
+See [`IsDialogMessage`](/windows/win32/api/winuser/nf-winuser-isdialogmessagew) in the Windows SDK.
-## CWindow::IsDlgButtonChecked
+## `CWindow::IsDlgButtonChecked`
Determines the check state of the button.
@@ -1463,9 +1462,9 @@ UINT IsDlgButtonChecked(int nIDButton) const throw();
### Remarks
-See [IsDlgButtonChecked](/windows/win32/api/winuser/nf-winuser-isdlgbuttonchecked) in the Windows SDK.
+See [`IsDlgButtonChecked`](/windows/win32/api/winuser/nf-winuser-isdlgbuttonchecked) in the Windows SDK.
-## CWindow::IsIconic
+## `CWindow::IsIconic`
Determines whether the window is minimized.
@@ -1475,13 +1474,13 @@ BOOL IsIconic() const throw();
### Remarks
-See [IsIconic](/windows/win32/api/winuser/nf-winuser-isiconic) in the Windows SDK.
+See [`IsIconic`](/windows/win32/api/winuser/nf-winuser-isiconic) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#19](../../atl/codesnippet/cpp/cwindow-class_19.cpp)]
-## CWindow::IsParentDialog
+## `CWindow::IsParentDialog`
Determines if the parent window of the control is a dialog window.
@@ -1491,9 +1490,9 @@ BOOL IsParentDialog() throw();
### Return Value
-Returns TRUE if the parent window is a dialog, FALSE otherwise.
+Returns `TRUE` if the parent window is a dialog, `FALSE` otherwise.
-## CWindow::IsWindow
+## `CWindow::IsWindow`
Determines whether the specified window handle identifies an existing window.
@@ -1503,13 +1502,13 @@ BOOL IsWindow() throw();
### Remarks
-See [IsWindow](/windows/win32/api/winuser/nf-winuser-iswindow) in the Windows SDK.
+See [`IsWindow`](/windows/win32/api/winuser/nf-winuser-iswindow) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#20](../../atl/codesnippet/cpp/cwindow-class_20.cpp)]
-## CWindow::IsWindowEnabled
+## `CWindow::IsWindowEnabled`
Determines whether the window is enabled for input.
@@ -1519,13 +1518,13 @@ BOOL IsWindowEnabled() const throw();
### Remarks
-See [IsWindowEnabled](/windows/win32/api/winuser/nf-winuser-iswindowenabled) in the Windows SDK.
+See [`IsWindowEnabled`](/windows/win32/api/winuser/nf-winuser-iswindowenabled) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#21](../../atl/codesnippet/cpp/cwindow-class_21.cpp)]
-## CWindow::IsWindowVisible
+## `CWindow::IsWindowVisible`
Determines the window's visibility state.
@@ -1535,13 +1534,13 @@ BOOL IsWindowVisible() const throw();
### Remarks
-See [IsWindowVisible](/windows/win32/api/winuser/nf-winuser-iswindowvisible) in the Windows SDK.
+See [`IsWindowVisible`](/windows/win32/api/winuser/nf-winuser-iswindowvisible) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#22](../../atl/codesnippet/cpp/cwindow-class_22.cpp)]
-## CWindow::IsWindowUnicode
+## `CWindow::IsWindowUnicode`
Determines whether the specified window is a native Unicode window.
@@ -1551,13 +1550,13 @@ BOOL IsWindowUnicode() throw();
### Remarks
-See [IsWindowUnicode](/windows/win32/api/winuser/nf-winuser-iswindowunicode) in the Windows SDK.
+See [`IsWindowUnicode`](/windows/win32/api/winuser/nf-winuser-iswindowunicode) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#23](../../atl/codesnippet/cpp/cwindow-class_23.cpp)]
-## CWindow::IsZoomed
+## `CWindow::IsZoomed`
Determines whether the window is maximized.
@@ -1567,9 +1566,9 @@ BOOL IsZoomed() const throw();
### Remarks
-See [IsZoomed](/windows/win32/api/winuser/nf-winuser-iszoomed) in the Windows SDK.
+See [`IsZoomed`](/windows/win32/api/winuser/nf-winuser-iszoomed) in the Windows SDK.
-## CWindow::KillTimer
+## `CWindow::KillTimer`
Destroys a timer event created by `CWindow::SetTimer`.
@@ -1579,11 +1578,11 @@ BOOL KillTimer(UINT nIDEvent) throw();
### Remarks
-See [KillTimer](/windows/win32/api/winuser/nf-winuser-killtimer) in the Windows SDK.
+See [`KillTimer`](/windows/win32/api/winuser/nf-winuser-killtimer) in the Windows SDK.
-## CWindow::LockWindowUpdate
+## `CWindow::LockWindowUpdate`
-Disables or enables drawing in the window by calling the [LockWindowUpdate](/windows/win32/api/winuser/nf-winuser-lockwindowupdate) Win32 function.
+Disables or enables drawing in the window by calling the [`LockWindowUpdate`](/windows/win32/api/winuser/nf-winuser-lockwindowupdate) Win32 function.
```
BOOL LockWindowUpdate(BOOL bLock = TRUE) throw();
@@ -1591,18 +1590,18 @@ BOOL LockWindowUpdate(BOOL bLock = TRUE) throw();
### Parameters
-*bLock*
-[in] If TRUE (the default value), the window will be locked. Otherwise, it will be unlocked.
+*`bLock`*\
+[in] If `TRUE` (the default value), the window will be locked. Otherwise, it will be unlocked.
### Return Value
-TRUE if the window is successfully locked; otherwise, FALSE.
+`TRUE` if the window is successfully locked; otherwise, `FALSE`.
### Remarks
-If *bLock* is TRUE, this method passes [m_hWnd](#m_hwnd) to the Win32 function; otherwise, it passes NULL.
+If *`bLock`* is `TRUE`, this method passes [`m_hWnd`](#m_hwnd) to the Win32 function; otherwise, it passes `NULL`.
-## CWindow::m_hWnd
+## `CWindow::m_hWnd`
Contains a handle to the window associated with the `CWindow` object.
@@ -1610,7 +1609,7 @@ Contains a handle to the window associated with the `CWindow` object.
HWND m_hWnd throw() throw();
```
-## CWindow::MapWindowPoints
+## `CWindow::MapWindowPoints`
Converts a set of points from the window's coordinate space to the coordinate space of another window.
@@ -1627,11 +1626,11 @@ int MapWindowPoints(
### Remarks
-See [MapWindowPoints](/windows/win32/api/winuser/nf-winuser-mapwindowpoints) in the Windows SDK.
+See [`MapWindowPoints`](/windows/win32/api/winuser/nf-winuser-mapwindowpoints) in the Windows SDK.
-The second version of this method allows you to convert the coordinates of a [RECT](/windows/win32/api/windef/ns-windef-rect) structure.
+The second version of this method allows you to convert the coordinates of a [`RECT`](/windows/win32/api/windef/ns-windef-rect) structure.
-## CWindow::MessageBox
+## `CWindow::MessageBox`
Displays a message box.
@@ -1644,13 +1643,13 @@ int MessageBox(
### Remarks
-See [MessageBox](/windows/win32/api/winuser/nf-winuser-messagebox) in the Windows SDK.
+See [`MessageBox`](/windows/win32/api/winuser/nf-winuser-messagebox) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#24](../../atl/codesnippet/cpp/cwindow-class_24.cpp)]
-## CWindow::ModifyStyle
+## `CWindow::ModifyStyle`
Modifies the window styles of the `CWindow` object.
@@ -1663,40 +1662,40 @@ BOOL ModifyStyle(
### Parameters
-*dwRemove*
+*`dwRemove`*\
[in] Specifies the window styles to be removed during style modification.
-*dwAdd*
+*`dwAdd`*\
[in] Specifies the window styles to be added during style modification.
-*nFlags*
-[in] Window-positioning flags. For a list of possible values, see the [SetWindowPos](/windows/win32/api/winuser/nf-winuser-setwindowpos) function in the Windows SDK.
+*`nFlags`*\
+[in] Window-positioning flags. For a list of possible values, see the [`SetWindowPos`](/windows/win32/api/winuser/nf-winuser-setwindowpos) function in the Windows SDK.
### Return Value
-TRUE if the window styles are modified; otherwise, FALSE.
+`TRUE` if the window styles are modified; otherwise, `FALSE`.
### Remarks
-Styles to be added or removed can be combined by using the bitwise OR ( | ) operator. See the [CreateWindow](/windows/win32/api/winuser/nf-winuser-createwindoww) function in the Windows SDKfor information about the available window styles.
+Styles to be added or removed can be combined by using the bitwise "or" (`|`) operator. See the [`CreateWindow`](/windows/win32/api/winuser/nf-winuser-createwindoww) function in the Windows SDKfor information about the available window styles.
-If *nFlags* is nonzero, `ModifyStyle` calls the Win32 function `SetWindowPos`, and redraws the window by combining *nFlags* with the following four flags:
+If *`nFlags`* is nonzero, `ModifyStyle` calls the Win32 function `SetWindowPos`, and redraws the window by combining *`nFlags`* with the following four flags:
-- SWP_NOSIZE Retains the current size.
+- `SWP_NOSIZE` Retains the current size.
-- SWP_NOMOVE Retains the current position.
+- `SWP_NOMOVE` Retains the current position.
-- SWP_NOZORDER Retains the current Z order.
+- `SWP_NOZORDER` Retains the current Z order.
-- SWP_NOACTIVATE Does not activate the window.
+- `SWP_NOACTIVATE` Doesn't activate the window.
-To modify a window's extended styles, call [ModifyStyleEx](#modifystyleex).
+To modify a window's extended styles, call [`ModifyStyleEx`](#modifystyleex).
### Example
[!code-cpp[NVC_ATL_Windowing#25](../../atl/codesnippet/cpp/cwindow-class_25.cpp)]
-## CWindow::ModifyStyleEx
+## `CWindow::ModifyStyleEx`
Modifies the extended window styles of the `CWindow` object.
@@ -1709,40 +1708,40 @@ BOOL ModifyStyleEx(
### Parameters
-*dwRemove*
+*`dwRemove`*\
[in] Specifies the extended styles to be removed during style modification.
-*dwAdd*
+*`dwAdd`*\
[in] Specifies the extended styles to be added during style modification.
-*nFlags*
-[in] Window-positioning flags. For a list of possible values, see the [SetWindowPos](/windows/win32/api/winuser/nf-winuser-setwindowpos) function in the Windows SDK.
+*`nFlags`*\
+[in] Window-positioning flags. For a list of possible values, see the [`SetWindowPos`](/windows/win32/api/winuser/nf-winuser-setwindowpos) function in the Windows SDK.
### Return Value
-TRUE if the extended window styles are modified; otherwise, FALSE.
+`TRUE` if the extended window styles are modified; otherwise, `FALSE`.
### Remarks
-Styles to be added or removed can be combined by using the bitwise OR ( | ) operator. See the [CreateWindowEx](/windows/win32/api/winuser/nf-winuser-createwindowexw) function in the Windows SDKfor information about the available extended styles.
+Styles to be added or removed can be combined by using the bitwise "or" (`|`) operator. See the [`CreateWindowEx`](/windows/win32/api/winuser/nf-winuser-createwindowexw) function in the Windows SDK for information about the available extended styles.
-If *nFlags* is nonzero, `ModifyStyleEx` calls the Win32 function `SetWindowPos`, and redraws the window by combining *nFlags* with the following four flags:
+If *`nFlags`* is nonzero, `ModifyStyleEx` calls the Win32 function `SetWindowPos`, and redraws the window by combining *`nFlags`* with the following four flags:
-- SWP_NOSIZE Retains the current size.
+- `SWP_NOSIZE` Retains the current size.
-- SWP_NOMOVE Retains the current position.
+- `SWP_NOMOVE` Retains the current position.
-- SWP_NOZORDER Retains the current Z order.
+- `SWP_NOZORDER` Retains the current Z order.
-- SWP_NOACTIVATE Does not activate the window.
+- `SWP_NOACTIVATE` Doesn't activate the window.
-To modify windows using regular window styles, call [ModifyStyle](#modifystyle).
+To modify windows using regular window styles, call [`ModifyStyle`](#modifystyle).
### Example
[!code-cpp[NVC_ATL_Windowing#26](../../atl/codesnippet/cpp/cwindow-class_26.cpp)]
-## CWindow::MoveWindow
+## `CWindow::MoveWindow`
Changes the window's size and position.
@@ -1761,11 +1760,11 @@ BOOL MoveWindow(
### Remarks
-For a top-level window object, the x and y parameters are relative to the upper-left corner of the screen. For a child window object, they are relative to the upper-left corner of the parent window's client area.
+For a top-level window object, the `x` and `y` parameters are relative to the upper-left corner of the screen. For a child window object, they're relative to the upper-left corner of the parent window's client area.
-The second version of this method uses a [RECT](/windows/win32/api/windef/ns-windef-rect) structure to determine the window's new position, width, and height.
+The second version of this method uses a [`RECT`](/windows/win32/api/windef/ns-windef-rect) structure to determine the window's new position, width, and height.
-## CWindow::NextDlgCtrl
+## `CWindow::NextDlgCtrl`
Sets the keyboard focus to the next control in the dialog box.
@@ -1775,9 +1774,9 @@ void NextDlgCtrl() const throw();
### Remarks
-See [WM_NEXTDLGCTL](/windows/win32/dlgbox/wm-nextdlgctl) in the Windows SDK.
+See [`WM_NEXTDLGCTL`](/windows/win32/dlgbox/wm-nextdlgctl) in the Windows SDK.
-## CWindow::OpenClipboard
+## `CWindow::OpenClipboard`
Opens the Clipboard.
@@ -1787,25 +1786,25 @@ BOOL OpenClipboard() throw();
### Remarks
-See [OpenClipboard](/windows/win32/api/winuser/nf-winuser-openclipboard) in the Windows SDK.
+See [`OpenClipboard`](/windows/win32/api/winuser/nf-winuser-openclipboard) in the Windows SDK.
-## CWindow::operator HWND
+## `CWindow::operator HWND`
-Converts a `CWindow` object to an HWND.
+Converts a `CWindow` object to an `HWND`.
```
operator HWND() const throw();
```
-## CWindow::operator =
+## `CWindow::operator =`
-Assigns an HWND to the `CWindow` object by setting the [m_hWnd](#m_hwnd) member to `hWnd`.
+Assigns an `HWND` to the `CWindow` object by setting the [`m_hWnd`](#m_hwnd) member to `hWnd`.
```
CWindow& operator= (HWND hWnd) throw();
```
-## CWindow::PostMessage
+## `CWindow::PostMessage`
Places a message in the message queue associated with the thread that created the window.
@@ -1818,7 +1817,7 @@ BOOL PostMessage(
### Remarks
-See [PostMessage](/windows/win32/api/winuser/nf-winuser-postmessagew) in the Windows SDK.
+See [`PostMessage`](/windows/win32/api/winuser/nf-winuser-postmessagew) in the Windows SDK.
Returns without waiting for the thread to process the message.
@@ -1826,7 +1825,7 @@ Returns without waiting for the thread to process the message.
[!code-cpp[NVC_ATL_Windowing#27](../../atl/codesnippet/cpp/cwindow-class_27.cpp)]
-## CWindow::PrevDlgCtrl
+## `CWindow::PrevDlgCtrl`
Sets the keyboard focus to the previous control in the dialog box.
@@ -1836,11 +1835,11 @@ void PrevDlgCtrl() const throw();
### Remarks
-See [WM_NEXTDLGCTL](/windows/win32/dlgbox/wm-nextdlgctl) in the Windows SDK.
+See [`WM_NEXTDLGCTL`](/windows/win32/dlgbox/wm-nextdlgctl) in the Windows SDK.
-## CWindow::Print
+## `CWindow::Print`
-Sends a [WM_PRINT](/windows/win32/gdi/wm-print) message to the window to request that it draw itself in the specified device context.
+Sends a [`WM_PRINT`](/windows/win32/gdi/wm-print) message to the window to request that it draw itself in the specified device context.
```cpp
void Print(HDC hDC, DWORD dwFlags) const throw();
@@ -1848,27 +1847,27 @@ void Print(HDC hDC, DWORD dwFlags) const throw();
### Parameters
-*hDC*
+*`hDC`*\
[in] The handle to a device context.
-*dwFlags*
+*`dwFlags`*\
[in] Specifies the drawing options. You can combine one or more of the following flags:
-- PRF_CHECKVISIBLE Draw the window only if it is visible.
+- `PRF_CHECKVISIBLE` Draw the window only if it's visible.
-- PRF_CHILDREN Draw all visible child windows.
+- `PRF_CHILDREN` Draw all visible child windows.
-- PRF_CLIENT Draw the client area of the window.
+- `PRF_CLIENT` Draw the client area of the window.
-- PRF_ERASEBKGND Erase the background before drawing the window.
+- `PRF_ERASEBKGND` Erase the background before drawing the window.
-- PRF_NONCLIENT Draw the non-client area of the window.
+- `PRF_NONCLIENT` Draw the non-client area of the window.
-- PRF_OWNED Draw all owned windows.
+- `PRF_OWNED` Draw all owned windows.
-## CWindow::PrintClient
+## `CWindow::PrintClient`
-Sends a [WM_PRINTCLIENT](/windows/win32/gdi/wm-printclient) message to the window to request that it draw its client area in the specified device context.
+Sends a [`WM_PRINTCLIENT`](/windows/win32/gdi/wm-printclient) message to the window to request that it draw its client area in the specified device context.
```cpp
void PrintClient(HDC hDC, DWORD dwFlags) const throw();
@@ -1876,25 +1875,25 @@ void PrintClient(HDC hDC, DWORD dwFlags) const throw();
### Parameters
-*hDC*
+*`hDC`*\
[in] The handle to a device context.
-*dwFlags*
+*`dwFlags`*\
[in] Specifies drawing options. You can combine one or more of the following flags:
-- PRF_CHECKVISIBLE Draw the window only if it is visible.
+- `PRF_CHECKVISIBLE` Draw the window only if it's visible.
-- PRF_CHILDREN Draw all visible child windows.
+- `PRF_CHILDREN` Draw all visible child windows.
-- PRF_CLIENT Draw the client area of the window.
+- `PRF_CLIENT` Draw the client area of the window.
-- PRF_ERASEBKGND Erase the background before drawing the window.
+- `PRF_ERASEBKGND` Erase the background before drawing the window.
-- PRF_NONCLIENT Draw the non-client area of the window.
+- `PRF_NONCLIENT` Draw the non-client area of the window.
-- PRF_OWNED Draw all owned windows.
+- `PRF_OWNED` Draw all owned windows.
-## CWindow::rcDefault
+## `CWindow::rcDefault`
Contains default window dimensions.
@@ -1902,7 +1901,7 @@ Contains default window dimensions.
static RECT rcDefault;
```
-## CWindow::RedrawWindow
+## `CWindow::RedrawWindow`
Updates a specified rectangle or region in the client area.
@@ -1917,13 +1916,13 @@ throw()
### Remarks
-See [RedrawWindow](/windows/win32/api/winuser/nf-winuser-redrawwindow) in the Windows SDK.
+See [`RedrawWindow`](/windows/win32/api/winuser/nf-winuser-redrawwindow) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#28](../../atl/codesnippet/cpp/cwindow-class_28.cpp)]
-## CWindow::ReleaseDC
+## `CWindow::ReleaseDC`
Releases a device context.
@@ -1933,13 +1932,13 @@ int ReleaseDC(HDC hDC);
### Remarks
-See [ReleaseDC](/windows/win32/api/winuser/nf-winuser-releasedc) in the Windows SDK.
+See [`ReleaseDC`](/windows/win32/api/winuser/nf-winuser-releasedc) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#9](../../atl/codesnippet/cpp/cwindow-class_9.cpp)]
-## CWindow::ResizeClient
+## `CWindow::ResizeClient`
Resizes the window to the specified client area size.
@@ -1952,16 +1951,16 @@ BOOL ResizeClient(
### Parameters
-*nWidth*
+*`nWidth`*\
New width of the window in pixels.
-*nHeight*
+*`nHeight`*\
New height of the window in pixels.
-*bRedraw*
-A flag indicating whether to redraw changes. Default is FALSE, indicating the window does not redraw changes.
+*`bRedraw`*\
+A flag indicating whether to redraw changes. Default is `FALSE`, indicating the window doesn't redraw changes.
-## CWindow::ScreenToClient
+## `CWindow::ScreenToClient`
Converts screen coordinates to client coordinates.
@@ -1972,11 +1971,11 @@ BOOL ScreenToClient(LPRECT lpRect) const throw();
### Remarks
-See [ScreenToClient](/windows/win32/api/winuser/nf-winuser-screentoclient) in the Windows SDK.
+See [`ScreenToClient`](/windows/win32/api/winuser/nf-winuser-screentoclient) in the Windows SDK.
-The second version of this method allows you to convert the coordinates of a [RECT](/windows/win32/api/windef/ns-windef-rect) structure.
+The second version of this method allows you to convert the coordinates of a [`RECT`](/windows/win32/api/windef/ns-windef-rect) structure.
-## CWindow::ScrollWindow
+## `CWindow::ScrollWindow`
Scrolls the specified client area.
@@ -1990,9 +1989,9 @@ BOOL ScrollWindow(
### Remarks
-See [ScrollWindow](/windows/win32/api/winuser/nf-winuser-scrollwindow) in the Windows SDK.
+See [`ScrollWindow`](/windows/win32/api/winuser/nf-winuser-scrollwindow) in the Windows SDK.
-## CWindow::ScrollWindowEx
+## `CWindow::ScrollWindowEx`
Scrolls the specified client area with additional features.
@@ -2009,9 +2008,9 @@ int ScrollWindowEx(
### Remarks
-See [ScrollWindowEx](/windows/win32/api/winuser/nf-winuser-scrollwindowex) in the Windows SDK.
+See [`ScrollWindowEx`](/windows/win32/api/winuser/nf-winuser-scrollwindowex) in the Windows SDK.
-## CWindow::SendDlgItemMessage
+## `CWindow::SendDlgItemMessage`
Sends a message to a control.
@@ -2025,11 +2024,11 @@ LRESULT SendDlgItemMessage(
### Remarks
-See [SendDlgItemMessage](/windows/win32/api/winuser/nf-winuser-senddlgitemmessagew) in the Windows SDK.
+See [`SendDlgItemMessage`](/windows/win32/api/winuser/nf-winuser-senddlgitemmessagew) in the Windows SDK.
-## CWindow::SendMessage
+## `CWindow::SendMessage`
-Sends a message to the window and does not return until the window procedure has processed the message.
+Sends a message to the window and doesn't return until the window procedure has processed the message.
```
LRESULT SendMessage(
@@ -2046,13 +2045,13 @@ static LRESULT SendMessage(
### Remarks
-See [SendMessage](/windows/win32/api/winuser/nf-winuser-sendmessage) in the Windows SDK.
+See [`SendMessage`](/windows/win32/api/winuser/nf-winuser-sendmessage) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#29](../../atl/codesnippet/cpp/cwindow-class_29.cpp)]
-## CWindow::SendMessageToDescendants
+## `CWindow::SendMessageToDescendants`
Sends the specified message to all immediate children of the `CWindow` object.
@@ -2066,23 +2065,23 @@ void SendMessageToDescendants(
### Parameters
-*message*
+*`message`*\
[in] The message to be sent.
-*wParam*
+*`wParam`*\
[in] Additional message-specific information.
-*lParam*
+*`lParam`*\
[in] Additional message-specific information.
-*bDeep*
-[in] If TRUE (the default value), the message will be sent to all descendant windows; otherwise, it will be sent only to the immediate child windows.
+*`bDeep`*\
+[in] If `TRUE` (the default value), the message will be sent to all descendant windows; otherwise, it will be sent only to the immediate child windows.
### Remarks
-If *bDeep* is TRUE, the message is additionally sent to all other descendant windows.
+If *`bDeep`* is `TRUE`, the message is additionally sent to all other descendant windows.
-## CWindow::SendNotifyMessage
+## `CWindow::SendNotifyMessage`
Sends a message to the window.
@@ -2095,11 +2094,11 @@ BOOL SendNotifyMessage(
### Remarks
-See [SendNotifyMessage](/windows/win32/api/winuser/nf-winuser-sendnotifymessagew) in the Windows SDK.
+See [`SendNotifyMessage`](/windows/win32/api/winuser/nf-winuser-sendnotifymessagew) in the Windows SDK.
-If the window was created by the calling thread, `SendNotifyMessage` does not return until the window procedure has processed the message. Otherwise, it returns immediately.
+If the window was created by the calling thread, `SendNotifyMessage` doesn't return until the window procedure has processed the message. Otherwise, it returns immediately.
-## CWindow::SetActiveWindow
+## `CWindow::SetActiveWindow`
Activates the window.
@@ -2109,13 +2108,13 @@ HWND SetActiveWindow() throw();
### Remarks
-See [SetActiveWindow](/windows/win32/api/winuser/nf-winuser-setactivewindow) in the Windows SDK.
+See [`SetActiveWindow`](/windows/win32/api/winuser/nf-winuser-setactivewindow) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#30](../../atl/codesnippet/cpp/cwindow-class_30.cpp)]
-## CWindow::SetCapture
+## `CWindow::SetCapture`
Sends all subsequent mouse input to the window.
@@ -2125,9 +2124,9 @@ HWND SetCapture() throw();
### Remarks
-See [SetCapture](/windows/win32/api/winuser/nf-winuser-setcapture) in the Windows SDK.
+See [`SetCapture`](/windows/win32/api/winuser/nf-winuser-setcapture) in the Windows SDK.
-## CWindow::SetClipboardViewer
+## `CWindow::SetClipboardViewer`
Adds the window to the Clipboard viewer chain.
@@ -2137,9 +2136,9 @@ HWND SetClipboardViewer() throw();
### Remarks
-See [SetClipboardViewer](/windows/win32/api/winuser/nf-winuser-setclipboardviewer) in the Windows SDK.
+See [`SetClipboardViewer`](/windows/win32/api/winuser/nf-winuser-setclipboardviewer) in the Windows SDK.
-## CWindow::SetDlgCtrlID
+## `CWindow::SetDlgCtrlID`
Sets the identifier of the window to the specified value.
@@ -2149,14 +2148,14 @@ int SetDlgCtrlID(int nID) throw();
### Parameters
-*nID*
+*`nID`*\
[in] The new value to set for the window's identifier.
### Return Value
If successful, the previous identifier of the window; otherwise 0.
-## CWindow::SetDlgItemInt
+## `CWindow::SetDlgItemInt`
Changes a control's text to the string representation of an integer value.
@@ -2169,9 +2168,9 @@ BOOL SetDlgItemInt(
### Remarks
-See [SetDlgItemInt](/windows/win32/api/winuser/nf-winuser-setdlgitemint) in the Windows SDK.
+See [`SetDlgItemInt`](/windows/win32/api/winuser/nf-winuser-setdlgitemint) in the Windows SDK.
-## CWindow::SetDlgItemText
+## `CWindow::SetDlgItemText`
Changes a control's text.
@@ -2181,9 +2180,9 @@ BOOL SetDlgItemText(int nID, LPCTSTR lpszString) throw();
### Remarks
-See [SetDlgItemText](/windows/win32/api/winuser/nf-winuser-setdlgitemtextw) in the Windows SDK.
+See [`SetDlgItemText`](/windows/win32/api/winuser/nf-winuser-setdlgitemtextw) in the Windows SDK.
-## CWindow::SetFocus
+## `CWindow::SetFocus`
Sets the input focus to the window.
@@ -2193,15 +2192,15 @@ HWND SetFocus() throw();
### Remarks
-See [SetFocus](/windows/win32/api/winuser/nf-winuser-setfocus) in the Windows SDK.
+See [`SetFocus`](/windows/win32/api/winuser/nf-winuser-setfocus) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#31](../../atl/codesnippet/cpp/cwindow-class_31.cpp)]
-## CWindow::SetFont
+## `CWindow::SetFont`
-Changes the window's current font by sending a [WM_SETFONT](/windows/win32/winmsg/wm-setfont) message to the window.
+Changes the window's current font by sending a [`WM_SETFONT`](/windows/win32/winmsg/wm-setfont) message to the window.
```cpp
void SetFont(HFONT hFont, BOOL bRedraw = TRUE) throw();
@@ -2209,15 +2208,15 @@ void SetFont(HFONT hFont, BOOL bRedraw = TRUE) throw();
### Parameters
-*hFont*
+*`hFont`*\
[in] The handle to the new font.
-*bRedraw*
-[in] If TRUE (the default value), the window is redrawn. Otherwise, it is not.
+*`bRedraw`*\
+[in] If `TRUE` (the default value), the window is redrawn. Otherwise, it isn't.
-## CWindow::SetHotKey
+## `CWindow::SetHotKey`
-Associates a hot key with the window by sending a WM_SETHOTKEY message.
+Associates a hot key with the window by sending a `WM_SETHOTKEY` message.
```
int SetHotKey(WORD wVirtualKeyCode, WORD wModifiers) throw();
@@ -2225,19 +2224,19 @@ int SetHotKey(WORD wVirtualKeyCode, WORD wModifiers) throw();
### Parameters
-*wVirtualKeyCode*
-[in] The virtual key code of the hot key. For a list of standard virtual key codes, see Winuser.h.
+*`wVirtualKeyCode`*\
+[in] The virtual key code of the hot key. For a list of standard virtual key codes, see `Winuser.h`.
-*wModifiers*
-[in] The modifiers of the hot key. For a list of possible values, see WM_SETHOTKEY in the Windows SDK.
+*`wModifiers`*\
+[in] The modifiers of the hot key. For a list of possible values, see `WM_SETHOTKEY` in the Windows SDK.
### Return Value
-For a list of possible return values, see [WM_SETHOTKEY](/windows/win32/inputdev/wm-sethotkey) in the Windows SDK.
+For a list of possible return values, see [`WM_SETHOTKEY`](/windows/win32/inputdev/wm-sethotkey) in the Windows SDK.
-## CWindow::SetIcon
+## `CWindow::SetIcon`
-Sets the window's large or small icon to the icon identified by *hIcon*.
+Sets the window's large or small icon to the icon identified by *`hIcon`*.
```
HICON SetIcon(HICON hIcon, BOOL bBigIcon = TRUE) throw();
@@ -2245,11 +2244,11 @@ HICON SetIcon(HICON hIcon, BOOL bBigIcon = TRUE) throw();
### Parameters
-*hIcon*
+*`hIcon`*\
[in] The handle to a new icon.
-*bBigIcon*
-[in] If TRUE (the default value), the method sets a large icon. Otherwise, it sets a small icon.
+*`bBigIcon`*\
+[in] If `TRUE` (the default value), the method sets a large icon. Otherwise, it sets a small icon.
### Return Value
@@ -2257,9 +2256,9 @@ The handle to the previous icon.
### Remarks
-`SetIcon` sends a [WM_SETICON](/windows/win32/winmsg/wm-seticon) message to the window.
+`SetIcon` sends a [`WM_SETICON`](/windows/win32/winmsg/wm-seticon) message to the window.
-## CWindow::SetMenu
+## `CWindow::SetMenu`
Changes the window's current menu.
@@ -2269,9 +2268,9 @@ BOOL SetMenu(HMENU hMenu) throw();
### Remarks
-See [SetMenu](/windows/win32/api/winuser/nf-winuser-setmenu) in the Windows SDK.
+See [`SetMenu`](/windows/win32/api/winuser/nf-winuser-setmenu) in the Windows SDK.
-## CWindow::SetParent
+## `CWindow::SetParent`
Changes the parent window.
@@ -2281,15 +2280,15 @@ HWND SetParent(HWND hWndNewParent) throw();
### Remarks
-See [SetParent](/windows/win32/api/winuser/nf-winuser-setparent) in the Windows SDK.
+See [`SetParent`](/windows/win32/api/winuser/nf-winuser-setparent) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#32](../../atl/codesnippet/cpp/cwindow-class_32.cpp)]
-## CWindow::SetRedraw
+## `CWindow::SetRedraw`
-Sets or clears the redraw flag by sending a [WM_SETREDRAW](/windows/win32/gdi/wm-setredraw) message to the window.
+Sets or clears the redraw flag by sending a [`WM_SETREDRAW`](/windows/win32/gdi/wm-setredraw) message to the window.
```cpp
void SetRedraw(BOOL bRedraw = TRUE) throw();
@@ -2297,8 +2296,8 @@ void SetRedraw(BOOL bRedraw = TRUE) throw();
### Parameters
-*bRedraw*
-[in] Specifies the state of the redraw flag. If TRUE (the default value), the redraw flag is set; if FALSE, the flag is cleared.
+*`bRedraw`*\
+[in] Specifies the state of the redraw flag. If `TRUE` (the default value), the redraw flag is set; if `FALSE`, the flag is cleared.
### Remarks
@@ -2308,7 +2307,7 @@ Call `SetRedraw` to allow changes to be redrawn or to prevent changes from being
[!code-cpp[NVC_ATL_Windowing#33](../../atl/codesnippet/cpp/cwindow-class_33.cpp)]
-## CWindow::SetScrollInfo
+## `CWindow::SetScrollInfo`
Sets the parameters of a scroll bar.
@@ -2321,9 +2320,9 @@ int SetScrollInfo(
### Remarks
-See [SetScrollInfo](/windows/win32/api/winuser/nf-winuser-setscrollinfo) in the Windows SDK.
+See [`SetScrollInfo`](/windows/win32/api/winuser/nf-winuser-setscrollinfo) in the Windows SDK.
-## CWindow::SetScrollPos
+## `CWindow::SetScrollPos`
Changes the position of the scroll box.
@@ -2336,9 +2335,9 @@ int SetScrollPos(
### Remarks
-See [SetScrollPos](/windows/win32/api/winuser/nf-winuser-setscrollpos) in the Windows SDK.
+See [`SetScrollPos`](/windows/win32/api/winuser/nf-winuser-setscrollpos) in the Windows SDK.
-## CWindow::SetScrollRange
+## `CWindow::SetScrollRange`
Changes the scroll bar range.
@@ -2352,9 +2351,9 @@ BOOL SetScrollRange(
### Remarks
-See [SetScrollRange](/windows/win32/api/winuser/nf-winuser-setscrollrange) in the Windows SDK.
+See [`SetScrollRange`](/windows/win32/api/winuser/nf-winuser-setscrollrange) in the Windows SDK.
-## CWindow::SetTimer
+## `CWindow::SetTimer`
Creates a timer event.
@@ -2367,9 +2366,9 @@ UINT SetTimer(
### Remarks
-See [SetTimer](/windows/win32/api/winuser/nf-winuser-settimer) in the Windows SDK.
+See [`SetTimer`](/windows/win32/api/winuser/nf-winuser-settimer) in the Windows SDK.
-## CWindow::SetWindowContextHelpId
+## `CWindow::SetWindowContextHelpId`
Sets the window's help context identifier.
@@ -2379,9 +2378,9 @@ BOOL SetWindowContextHelpId(DWORD dwContextHelpId) throw();
### Remarks
-See [SetWindowContextHelpId](/windows/win32/api/winuser/nf-winuser-setwindowcontexthelpid) in the Windows SDK.
+See [`SetWindowContextHelpId`](/windows/win32/api/winuser/nf-winuser-setwindowcontexthelpid) in the Windows SDK.
-## CWindow::SetWindowLong
+## `CWindow::SetWindowLong`
Sets a 32-bit value at a specified offset into the extra window memory.
@@ -2391,12 +2390,12 @@ LONG SetWindowLong(int nIndex, LONG dwNewLong) throw();
### Remarks
-See [SetWindowLong](/windows/win32/api/winuser/nf-winuser-setwindowlongw) in the Windows SDK.
+See [`SetWindowLong`](/windows/win32/api/winuser/nf-winuser-setwindowlongw) in the Windows SDK.
> [!NOTE]
-> To write code that is compatible with both 32-bit and 64-bit versions of Windows, use [CWindow::SetWindowLongPtr](#setwindowlongptr).
+> To write code that is compatible with both 32-bit and 64-bit versions of Windows, use [`CWindow::SetWindowLongPtr`](#setwindowlongptr).
-## CWindow::SetWindowLongPtr
+## `CWindow::SetWindowLongPtr`
Changes an attribute of the specified window, and also sets a value at the specified offset in the extra window memory.
@@ -2406,11 +2405,11 @@ LONG_PTR SetWindowLongPtr(int nIndex, LONG_PTR dwNewLong) throw();
### Remarks
-See [SetWindowLongPtr](/windows/win32/api/winuser/nf-winuser-setwindowlongptrw) in the Windows SDK.
+See [`SetWindowLongPtr`](/windows/win32/api/winuser/nf-winuser-setwindowlongptrw) in the Windows SDK.
This function supersedes the `CWindow::SetWindowLong` method. To write code that is compatible with both 32-bit and 64-bit versions of Windows, use `CWindow::SetWindowLongPtr`.
-## CWindow::SetWindowPlacement
+## `CWindow::SetWindowPlacement`
Sets the show state and positions.
@@ -2420,9 +2419,9 @@ BOOL SetWindowPlacement(const WINDOWPLACEMENT FAR* lpwndpl);
### Remarks
-See [SetWindowPlacement](/windows/win32/api/winuser/nf-winuser-setwindowplacement) in the Windows SDK.
+See [`SetWindowPlacement`](/windows/win32/api/winuser/nf-winuser-setwindowplacement) in the Windows SDK.
-## CWindow::SetWindowPos
+## `CWindow::SetWindowPos`
Sets the size, position, and Z order.
@@ -2443,11 +2442,11 @@ BOOL SetWindowPos(
### Remarks
-See [SetWindowPos](/windows/win32/api/winuser/nf-winuser-setwindowpos) in the Windows SDK.
+See [`SetWindowPos`](/windows/win32/api/winuser/nf-winuser-setwindowpos) in the Windows SDK.
-The second version of this method uses a [RECT](/windows/win32/api/windef/ns-windef-rect) structure to set the window's new position, width, and height.
+The second version of this method uses a [`RECT`](/windows/win32/api/windef/ns-windef-rect) structure to set the window's new position, width, and height.
-## CWindow::SetWindowRgn
+## `CWindow::SetWindowRgn`
Sets the window region of a window.
@@ -2457,9 +2456,9 @@ int SetWindowRgn(HRGN hRgn, BOOL bRedraw = FALSE) throw();
### Remarks
-See [SetWindowRgn](/windows/win32/api/winuser/nf-winuser-setwindowrgn) in the Windows SDK.
+See [`SetWindowRgn`](/windows/win32/api/winuser/nf-winuser-setwindowrgn) in the Windows SDK.
-## CWindow::SetWindowText
+## `CWindow::SetWindowText`
Changes the window's text.
@@ -2469,13 +2468,13 @@ BOOL SetWindowText(LPCTSTR lpszString) throw();
### Remarks
-See [SetWindowText](/windows/win32/api/winuser/nf-winuser-setwindowtextw) in the Windows SDK.
+See [`SetWindowText`](/windows/win32/api/winuser/nf-winuser-setwindowtextw) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#34](../../atl/codesnippet/cpp/cwindow-class_34.cpp)]
-## CWindow::SetWindowWord
+## `CWindow::SetWindowWord`
Sets a 16-bit value at a specified offset into the extra window memory.
@@ -2485,9 +2484,9 @@ WORD SetWindowWord(int nIndex, WORD wNewWord) throw();
### Remarks
-See [SetWindowLong](/windows/win32/api/winuser/nf-winuser-setwindowlongw) in the Windows SDK.
+See [`SetWindowLong`](/windows/win32/api/winuser/nf-winuser-setwindowlongw) in the Windows SDK.
-## CWindow::ShowCaret
+## `CWindow::ShowCaret`
Displays the system caret.
@@ -2497,13 +2496,13 @@ BOOL ShowCaret() throw();
### Remarks
-See [ShowCaret](/windows/win32/api/winuser/nf-winuser-showcaret) in the Windows SDK.
+See [`ShowCaret`](/windows/win32/api/winuser/nf-winuser-showcaret) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#35](../../atl/codesnippet/cpp/cwindow-class_35.cpp)]
-## CWindow::ShowOwnedPopups
+## `CWindow::ShowOwnedPopups`
Shows or hides the pop-up windows owned by the window.
@@ -2513,9 +2512,9 @@ BOOL ShowOwnedPopups(BOOL bShow = TRUE) throw();
### Remarks
-See [ShowOwnedPopups](/windows/win32/api/winuser/nf-winuser-showownedpopups) in the Windows SDK.
+See [`ShowOwnedPopups`](/windows/win32/api/winuser/nf-winuser-showownedpopups) in the Windows SDK.
-## CWindow::ShowScrollBar
+## `CWindow::ShowScrollBar`
Shows or hides a scroll bar.
@@ -2525,9 +2524,9 @@ BOOL ShowScrollBar(UINT nBar, BOOL bShow = TRUE) throw();
### Remarks
-See [ShowScrollBar](/windows/win32/api/winuser/nf-winuser-showscrollbar) in the Windows SDK.
+See [`ShowScrollBar`](/windows/win32/api/winuser/nf-winuser-showscrollbar) in the Windows SDK.
-## CWindow::ShowWindow
+## `CWindow::ShowWindow`
Sets the window's show state.
@@ -2537,13 +2536,13 @@ BOOL ShowWindow(int nCmdShow) throw();
### Remarks
-See [ShowWindow](/windows/win32/api/winuser/nf-winuser-showwindow) in the Windows SDK.
+See [`ShowWindow`](/windows/win32/api/winuser/nf-winuser-showwindow) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#36](../../atl/codesnippet/cpp/cwindow-class_36.cpp)]
-## CWindow::ShowWindowAsync
+## `CWindow::ShowWindowAsync`
Sets the show state of a window created by a different thread.
@@ -2553,9 +2552,9 @@ BOOL ShowWindowAsync(int nCmdShow) throw();
### Remarks
-See [ShowWindowAsync](/windows/win32/api/winuser/nf-winuser-showwindowasync) in the Windows SDK.
+See [`ShowWindowAsync`](/windows/win32/api/winuser/nf-winuser-showwindowasync) in the Windows SDK.
-## CWindow::UpdateWindow
+## `CWindow::UpdateWindow`
Updates the client area.
@@ -2565,13 +2564,13 @@ BOOL UpdateWindow() throw();
### Remarks
-See [UpdateWindow](/windows/win32/api/winuser/nf-winuser-updatewindow) in the Windows SDK.
+See [`UpdateWindow`](/windows/win32/api/winuser/nf-winuser-updatewindow) in the Windows SDK.
### Example
[!code-cpp[NVC_ATL_Windowing#37](../../atl/codesnippet/cpp/cwindow-class_37.cpp)]
-## CWindow::ValidateRect
+## `CWindow::ValidateRect`
Validates the client area within the specified rectangle.
@@ -2581,9 +2580,9 @@ BOOL ValidateRect(LPCRECT lpRect) throw();
### Remarks
-See [ValidateRect](/windows/win32/api/winuser/nf-winuser-validaterect) in the Windows SDK.
+See [`ValidateRect`](/windows/win32/api/winuser/nf-winuser-validaterect) in the Windows SDK.
-## CWindow::ValidateRgn
+## `CWindow::ValidateRgn`
Validates the client area within the specified region.
@@ -2593,9 +2592,9 @@ BOOL ValidateRgn(HRGN hRgn) throw();
### Remarks
-See [ValidateRgn](/windows/win32/api/winuser/nf-winuser-validatergn) in the Windows SDK.
+See [`ValidateRgn`](/windows/win32/api/winuser/nf-winuser-validatergn) in the Windows SDK.
-## CWindow::WinHelp
+## `CWindow::WinHelp`
Starts Windows Help.
@@ -2608,7 +2607,7 @@ BOOL WinHelp(
### Remarks
-See [WinHelp](/windows/win32/api/winuser/nf-winuser-winhelpw) in the Windows SDK.
+See [`WinHelp`](/windows/win32/api/winuser/nf-winuser-winhelpw) in the Windows SDK.
## See also
diff --git a/docs/atl/reference/cwindowimpl-class.md b/docs/atl/reference/cwindowimpl-class.md
index 79957ded9b..d2041bc669 100644
--- a/docs/atl/reference/cwindowimpl-class.md
+++ b/docs/atl/reference/cwindowimpl-class.md
@@ -276,7 +276,7 @@ virtual void OnFinalMessage(HWND hWnd);
### Remarks
-The default implementation of `OnFinalMessage` does nothing, but you can override this function to handle cleanup before destroying a window. If you want to automatically delete your object upon the window destruction, you can call **delete this;** in this function.
+The default implementation of `OnFinalMessage` does nothing, but you can override this function to handle cleanup before destroying a window. If you want to automatically delete your object upon the window destruction, you can call `delete this;` in this function.
## CWindowImpl::SubclassWindow
diff --git a/docs/atl/reference/debugging-and-error-reporting-macros.md b/docs/atl/reference/debugging-and-error-reporting-macros.md
index 59543bc784..463ef4c007 100644
--- a/docs/atl/reference/debugging-and-error-reporting-macros.md
+++ b/docs/atl/reference/debugging-and-error-reporting-macros.md
@@ -2,7 +2,7 @@
description: "Learn more about: Debugging and Error Reporting Macros"
title: "Debugging and Error Reporting Macros"
ms.date: "05/06/2019"
-f1_keywords: ["atldef/ATL::_ATL_DEBUG_INTERFACES", "atldef/ATL::_ATL_DEBUG_QI", "atldef/ATL::ATLASSERT", "afx/ATL::ATLENSURE", "atltrace/ATL::ATLTRACENOTIMPL", "atltrace/ATL::ATLTRACE"]
+f1_keywords: ["atldef/ATL::_ATL_DEBUG_INTERFACES", "atldef/ATL::_ATL_DEBUG_QI", "atldef/ATL::ATLASSERT", "afx/ATL::ATLENSURE", "atltrace/ATL::ATLTRACENOTIMPL", "atltrace/ATL::ATLTRACE", "ATLDEF/_ATL_DEBUG_INTERFACES", "ATLDEF/_ATL_DEBUG_QI", "ATLDEF/ATLASSERT", "AFX/ATLENSURE", "ATLTRACE/ATLTRACENOTIMPL", "ATLTRACE/ATLTRACE", "ATLDEF/ATLSTATIC_ASSERT"]
helpviewer_keywords: ["macros, error reporting"]
ms.assetid: 4da9b87f-ec5c-4a32-ab93-637780909b9d
---
diff --git a/docs/atl/reference/exception-handling-macros.md b/docs/atl/reference/exception-handling-macros.md
index b68a348f62..44f9993452 100644
--- a/docs/atl/reference/exception-handling-macros.md
+++ b/docs/atl/reference/exception-handling-macros.md
@@ -2,7 +2,7 @@
description: "Learn more about: Exception Handling Macros"
title: "Exception Handling Macros"
ms.date: "11/04/2016"
-f1_keywords: ["atldef/ATL::_ATLCATCH", "atldef/ATL::_ATLCATCHALL", "atldef/ATL::_ATLTRY"]
+f1_keywords: ["atldef/ATL::_ATLCATCH", "atldef/ATL::_ATLCATCHALL", "atldef/ATL::_ATLTRY", "ATLDEF/_ATLCATCH", "ATLDEF/_ATLCATCHALL", "ATLDEF/_ATLTRY"]
helpviewer_keywords: ["exception handling, macros", "C++ exception handling, macros"]
ms.assetid: a8385d34-3fb0-4006-a42a-de045cacf0f4
---
diff --git a/docs/atl/reference/idispeventimpl-class.md b/docs/atl/reference/idispeventimpl-class.md
index 74fd3e72c2..ef54c3c7b5 100644
--- a/docs/atl/reference/idispeventimpl-class.md
+++ b/docs/atl/reference/idispeventimpl-class.md
@@ -1,12 +1,11 @@
---
-description: "Learn more about: IDispEventImpl Class"
title: "IDispEventImpl Class"
-ms.date: "11/04/2016"
+description: "Learn more about: IDispEventImpl Class"
+ms.date: 11/04/2016
f1_keywords: ["IDispEventImpl", "ATLCOM/ATL::IDispEventImpl", "ATLCOM/ATL::IDispEventImpl::IDispEventImpl", "ATLCOM/ATL::IDispEventImpl::GetFuncInfoFromId", "ATLCOM/ATL::IDispEventImpl::GetIDsOfNames", "ATLCOM/ATL::IDispEventImpl::GetTypeInfo", "ATLCOM/ATL::IDispEventImpl::GetTypeInfoCount", "ATLCOM/ATL::IDispEventImpl::GetUserDefinedType"]
helpviewer_keywords: ["IDispEventImpl class"]
-ms.assetid: a64b5288-35cb-4638-aad6-2d15b1c7cf7b
---
-# IDispEventImpl Class
+# `IDispEventImpl` Class
This class provides implementations of the `IDispatch` methods.
@@ -15,7 +14,7 @@ This class provides implementations of the `IDispatch` methods.
## Syntax
-```
+```cpp
template
#### Parameters
-*nID*
+*`nID`*\
A unique identifier for the source object. When `IDispEventImpl` is the base class for a composite control, use the resource ID of the desired contained control for this parameter. In other cases, use an arbitrary positive integer.
-*T*
+*`T`*\
The user's class, which is derived from `IDispEventImpl`.
-*pdiid*
-The pointer to the IID of the event dispinterface implemented by this class. This interface must be defined in the type library denoted by *plibid*, *wMajor*, and *wMinor*.
+*`pdiid`*\
+The pointer to the IID of the event dispinterface implemented by this class. This interface must be defined in the type library denoted by *`plibid`*, *`wMajor`*, and *`wMinor`*.
-*plibid*
-A pointer to the type library that defines the dispatch interface pointed to by *pdiid*. If **&GUID_NULL**, the type library will be loaded from the object sourcing the events.
+*`plibid`*\
+A pointer to the type library that defines the dispatch interface pointed to by *`pdiid`*. If **`&GUID_NULL`**, the type library will be loaded from the object sourcing the events.
-*wMajor*
+*`wMajor`*\
The major version of the type library. The default value is 0.
-*wMinor*
+*`wMinor`*\
The minor version of the type library. The default value is 0.
-*tihclass*
-The class used to manage the type information for *T*. The default value is a class of type `CComTypeInfoHolder`; however, you can override this template parameter by providing a class of a type other than `CComTypeInfoHolder`.
+*`tihclass`*\
+The class used to manage the type information for *`T`*. The default value is a class of type `CComTypeInfoHolder`; however, you can override this template parameter by providing a class of a type other than `CComTypeInfoHolder`.
## Members
@@ -54,23 +53,23 @@ The class used to manage the type information for *T*. The default value is a cl
|Name|Description|
|----------|-----------------|
-|[IDispEventImpl::_tihclass](../../atl/reference/idispeventimpl-class.md)|The class used to manage the type information. By default, `CComTypeInfoHolder`.|
+|[`IDispEventImpl::_tihclass`](#_tihclass)|The class used to manage the type information. By default, `CComTypeInfoHolder`.|
### Public Constructors
|Name|Description|
|----------|-----------------|
-|[IDispEventImpl::IDispEventImpl](#idispeventimpl)|The constructor.|
+|[`IDispEventImpl::IDispEventImpl`](#idispeventimpl)|The constructor.|
### Public Methods
|Name|Description|
|----------|-----------------|
-|[IDispEventImpl::GetFuncInfoFromId](#getfuncinfofromid)|Locates the function index for the specified dispatch identifier.|
-|[IDispEventImpl::GetIDsOfNames](#getidsofnames)|Maps a single member and an optional set of argument names to a corresponding set of integer DISPIDs.|
-|[IDispEventImpl::GetTypeInfo](#gettypeinfo)|Retrieves the type information for an object.|
-|[IDispEventImpl::GetTypeInfoCount](#gettypeinfocount)|Retrieves the number of type information interfaces.|
-|[IDispEventImpl::GetUserDefinedType](#getuserdefinedtype)|Retrieves the basic type of a user-defined type.|
+|[`IDispEventImpl::GetFuncInfoFromId`](#getfuncinfofromid)|Locates the function index for the specified dispatch identifier.|
+|[`IDispEventImpl::GetIDsOfNames`](#getidsofnames)|Maps a single member and an optional set of argument names to a corresponding set of integer `DISPID`s.|
+|[`IDispEventImpl::GetTypeInfo`](#gettypeinfo)|Retrieves the type information for an object.|
+|[`IDispEventImpl::GetTypeInfoCount`](#gettypeinfocount)|Retrieves the number of type information interfaces.|
+|[`IDispEventImpl::GetUserDefinedType`](#getuserdefinedtype)|Retrieves the basic type of a user-defined type.|
## Remarks
@@ -78,18 +77,18 @@ The class used to manage the type information for *T*. The default value is a cl
`IDispEventImpl` works in conjunction with the event sink map in your class to route events to the appropriate handler function. To use this class:
-Add a [SINK_ENTRY](composite-control-macros.md#sink_entry) or [SINK_ENTRY_EX](composite-control-macros.md#sink_entry_ex) macro to the event sink map for each event on each object that you want to handle. When using `IDispEventImpl` as a base class of a composite control, you can call [AtlAdviseSinkMap](connection-point-global-functions.md#atladvisesinkmap) to establish and break the connection with the event sources for all entries in the event sink map. In other cases, or for greater control, call [DispEventAdvise](idispeventsimpleimpl-class.md#dispeventadvise) to establish the connection between the source object and the base class. Call [DispEventUnadvise](idispeventsimpleimpl-class.md#dispeventunadvise) to break the connection.
+Add a [`SINK_ENTRY`](composite-control-macros.md#sink_entry) or [`SINK_ENTRY_EX`](composite-control-macros.md#sink_entry_ex) macro to the event sink map for each event on each object that you want to handle. When using `IDispEventImpl` as a base class of a composite control, you can call [`AtlAdviseSinkMap`](connection-point-global-functions.md#atladvisesinkmap) to establish and break the connection with the event sources for all entries in the event sink map. In other cases, or for greater control, call [`DispEventAdvise`](idispeventsimpleimpl-class.md#dispeventadvise) to establish the connection between the source object and the base class. Call [`DispEventUnadvise`](idispeventsimpleimpl-class.md#dispeventunadvise) to break the connection.
-You must derive from `IDispEventImpl` (using a unique value for *nID*) for each object for which you need to handle events. You can reuse the base class by unadvising against one source object then advising against a different source object, but the maximum number of source objects that can be handled by a single object at one time is limited by the number of `IDispEventImpl` base classes.
+You must derive from `IDispEventImpl` (using a unique value for *`nID`*) for each object for which you need to handle events. You can reuse the base class by unadvising against one source object then advising against a different source object, but the maximum number of source objects that can be handled by a single object at one time is limited by the number of `IDispEventImpl` base classes.
-`IDispEventImpl` provides the same functionality as [IDispEventSimpleImpl](../../atl/reference/idispeventsimpleimpl-class.md), except it gets type information about the interface from a type library rather than having it supplied as a pointer to an [_ATL_FUNC_INFO](../../atl/reference/atl-func-info-structure.md) structure. Use `IDispEventSimpleImpl` when you do not have a type library describing the event interface or want to avoid the overhead associated with using the type library.
+`IDispEventImpl` provides the same functionality as [`IDispEventSimpleImpl`](idispeventsimpleimpl-class.md), except it gets type information about the interface from a type library rather than having it supplied as a pointer to an [`_ATL_FUNC_INFO`](atl-func-info-structure.md) structure. Use `IDispEventSimpleImpl` when you do not have a type library describing the event interface or want to avoid the overhead associated with using the type library.
> [!NOTE]
> `IDispEventImpl` and `IDispEventSimpleImpl` provide their own implementation of `IUnknown::QueryInterface` enabling each `IDispEventImpl` and `IDispEventSimpleImpl` base class to act as a separate COM identity while still allowing direct access to class members in your main COM object.
-CE ATL implementation of ActiveX event sinks only supports return values of type HRESULT or void from your event handler methods; any other return value is unsupported and its behavior is undefined.
+CE ATL implementation of ActiveX event sinks only supports return values of type `HRESULT` or `void` from your event handler methods; any other return value is unsupported and its behavior is undefined.
-For more information, see [Supporting IDispEventImpl](../../atl/supporting-idispeventimpl.md).
+For more information, see [Supporting `IDispEventImpl`](../supporting-idispeventimpl.md).
## Inheritance Hierarchy
@@ -97,19 +96,19 @@ For more information, see [Supporting IDispEventImpl](../../atl/supporting-idisp
`_IDispEventLocator`
-[IDispEventSimpleImpl](../../atl/reference/idispeventsimpleimpl-class.md)
+[`IDispEventSimpleImpl`](idispeventsimpleimpl-class.md)
`IDispEventImpl`
## Requirements
-**Header:** atlcom.h
+**Header:** `atlcom.h`
-## IDispEventImpl::GetFuncInfoFromId
+## `IDispEventImpl::GetFuncInfoFromId`
Locates the function index for the specified dispatch identifier.
-```
+```cpp
HRESULT GetFuncInfoFromId(
const IID& iid,
DISPID dispidMember,
@@ -119,27 +118,27 @@ HRESULT GetFuncInfoFromId(
### Parameters
-*iid*
+*`iid`*\
[in] A reference to the ID of the function.
-*dispidMember*
+*`dispidMember`*\
[in] The dispatch ID of the function.
-*lcid*
+*`lcid`*\
[in] The locale context of the function ID.
-*info*
+*`info`*\
[in] The structure indicating how the function is called.
### Return Value
-A standard HRESULT value.
+A standard `HRESULT` value.
-## IDispEventImpl::GetIDsOfNames
+## `IDispEventImpl::GetIDsOfNames`
-Maps a single member and an optional set of argument names to a corresponding set of integer DISPIDs, which can be used on subsequent calls to [IDispatch::Invoke](/windows/win32/api/oaidl/nf-oaidl-idispatch-invoke).
+Maps a single member and an optional set of argument names to a corresponding set of integer `DISPID`s, which can be used on subsequent calls to [`IDispatch::Invoke`](/windows/win32/api/oaidl/nf-oaidl-idispatch-invoke).
-```
+```cpp
STDMETHOD(GetIDsOfNames)(
REFIID riid,
LPOLESTR* rgszNames,
@@ -150,38 +149,36 @@ STDMETHOD(GetIDsOfNames)(
### Remarks
-See [IDispatch::GetIDsOfNames](/windows/win32/api/oaidl/nf-oaidl-idispatch-getidsofnames) in the Windows SDK.
+See [`IDispatch::GetIDsOfNames`](/windows/win32/api/oaidl/nf-oaidl-idispatch-getidsofnames) in the Windows SDK.
-## IDispEventImpl::GetTypeInfo
+## `IDispEventImpl::GetTypeInfo`
Retrieves the type information for an object, which can then be used to get the type information for an interface.
-```
+```cpp
STDMETHOD(GetTypeInfo)(
UINT itinfo,
LCID lcid,
ITypeInfo** pptinfo);
```
-### Remarks
-
-## IDispEventImpl::GetTypeInfoCount
+## `IDispEventImpl::GetTypeInfoCount`
Retrieves the number of type information interfaces that an object provides (either 0 or 1).
-```
+```cpp
STDMETHOD(GetTypeInfoCount)(UINT* pctinfo);
```
### Remarks
-See [IDispatch::GetTypeInfoCount](/windows/win32/api/oaidl/nf-oaidl-idispatch-gettypeinfocount) in the Windows SDK.
+See [`IDispatch::GetTypeInfoCount`](/windows/win32/api/oaidl/nf-oaidl-idispatch-gettypeinfocount) in the Windows SDK.
-## IDispEventImpl::GetUserDefinedType
+## `IDispEventImpl::GetUserDefinedType`
Retrieves the basic type of a user-defined type.
-```
+```cpp
VARTYPE GetUserDefinedType(
ITypeInfo* pTI,
HREFTYPE hrt);
@@ -189,10 +186,10 @@ VARTYPE GetUserDefinedType(
### Parameters
-*pTI*
-[in] A pointer to the [ITypeInfo](/windows/win32/api/oaidl/nn-oaidl-itypeinfo) interface containing the user-defined type.
+*`pTI`*\
+[in] A pointer to the [`ITypeInfo`](/windows/win32/api/oaidl/nn-oaidl-itypeinfo) interface containing the user-defined type.
-*hrt*
+*`hrt`*\
[in] A handle to the type description to be retrieved.
### Return Value
@@ -201,21 +198,21 @@ The type of variant.
### Remarks
-See [ITypeInfo::GetRefTypeInfo](/windows/win32/api/oaidl/nf-oaidl-itypeinfo-getreftypeinfo).
+See [`ITypeInfo::GetRefTypeInfo`](/windows/win32/api/oaidl/nf-oaidl-itypeinfo-getreftypeinfo).
-## IDispEventImpl::IDispEventImpl
+## `IDispEventImpl::IDispEventImpl`
-The constructor. Stores the values of the class template parameters *plibid*, *pdiid*, *wMajor*, and *wMinor*.
+The constructor. Stores the values of the class template parameters *`plibid`*, *`pdiid`*, *`wMajor`*, and *`wMinor`*.
-```
+```cpp
IDispEventImpl();
```
-## IDispEventImpl::tihclass
+## `IDispEventImpl::_tihclass`
-This typedef is an instance of the class template parameter *tihclass*.
+This typedef is an instance of the class template parameter *`tihclass`*.
-```
+```cpp
typedef tihclass _tihclass;
```
@@ -225,10 +222,10 @@ By default, the class is `CComTypeInfoHolder`. `CComTypeInfoHolder` manages the
## See also
-[_ATL_FUNC_INFO Structure](../../atl/reference/atl-func-info-structure.md)
-[IDispatchImpl Class](../../atl/reference/idispatchimpl-class.md)
-[IDispEventSimpleImpl Class](../../atl/reference/idispeventsimpleimpl-class.md)
-[SINK_ENTRY](composite-control-macros.md#sink_entry)
-[SINK_ENTRY_EX](composite-control-macros.md#sink_entry_ex)
-[SINK_ENTRY_INFO](composite-control-macros.md#sink_entry_info)
-[Class Overview](../../atl/atl-class-overview.md)
+[`_ATL_FUNC_INFO` Structure](atl-func-info-structure.md)\
+[`IDispatchImpl` Class](idispatchimpl-class.md)\
+[`IDispEventSimpleImpl` Class](idispeventsimpleimpl-class.md)\
+[`SINK_ENTRY`](composite-control-macros.md#sink_entry)\
+[`SINK_ENTRY_EX`](composite-control-macros.md#sink_entry_ex)\
+[`SINK_ENTRY_INFO`](composite-control-macros.md#sink_entry_info)\
+[Class Overview](../atl-class-overview.md)
diff --git a/docs/atl/reference/iolecontrolimpl-class.md b/docs/atl/reference/iolecontrolimpl-class.md
index 6dc7d0f8a8..6c3430e9ce 100644
--- a/docs/atl/reference/iolecontrolimpl-class.md
+++ b/docs/atl/reference/iolecontrolimpl-class.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: IOleControlImpl Class"
title: "IOleControlImpl Class"
+description: "Learn more about: IOleControlImpl Class"
ms.date: "11/04/2016"
f1_keywords: ["IOleControlImpl", "ATLCTL/ATL::IOleControlImpl", "ATLCTL/ATL::IOleControlImpl::FreezeEvents", "ATLCTL/ATL::IOleControlImpl::GetControlInfo", "ATLCTL/ATL::IOleControlImpl::OnAmbientPropertyChange", "ATLCTL/ATL::IOleControlImpl::OnMnemonic"]
helpviewer_keywords: ["IOleControlImpl class"]
-ms.assetid: 5a4255ad-ede4-49ca-ba9a-07c2e919fa85
---
# IOleControlImpl Class
@@ -22,7 +21,7 @@ class IOleControlImpl
#### Parameters
-*T*
+*T*\
Your class, derived from `IOleControlImpl`.
## Members
@@ -76,7 +75,7 @@ HRESULT GetControlInfo(LPCONTROLINFO pCI);
### Remarks
-See [IOleControl:GetControlInfo](/windows/win32/api/ocidl/nf-ocidl-iolecontrol-getcontrolinfo) in the Windows SDK.
+See [IOleControl::GetControlInfo](/windows/win32/api/ocidl/nf-ocidl-iolecontrol-getcontrolinfo) in the Windows SDK.
### Return Value
@@ -116,6 +115,6 @@ See [IOleControl::OnMnemonic](/windows/win32/api/ocidl/nf-ocidl-iolecontrol-onmn
## See also
-[IOleObjectImpl Class](../../atl/reference/ioleobjectimpl-class.md)
-[ActiveX Controls Interfaces](/windows/win32/com/activex-controls-interfaces)
+[IOleObjectImpl Class](../../atl/reference/ioleobjectimpl-class.md)\
+[ActiveX Controls Interfaces](/windows/win32/com/activex-controls-interfaces)\
[Class Overview](../../atl/atl-class-overview.md)
diff --git a/docs/atl/reference/iperpropertybrowsingimpl-class.md b/docs/atl/reference/iperpropertybrowsingimpl-class.md
index f81692daec..c5f0e2678e 100644
--- a/docs/atl/reference/iperpropertybrowsingimpl-class.md
+++ b/docs/atl/reference/iperpropertybrowsingimpl-class.md
@@ -16,7 +16,6 @@ This class implements `IUnknown` and allows a client to access the information i
## Syntax
```
-
template
class ATL_NO_VTABLE IPerPropertyBrowsingImpl :
public IPerPropertyBrowsing
diff --git a/docs/atl/reference/ipersiststorageimpl-class.md b/docs/atl/reference/ipersiststorageimpl-class.md
index 9b8e3de985..a5396bee53 100644
--- a/docs/atl/reference/ipersiststorageimpl-class.md
+++ b/docs/atl/reference/ipersiststorageimpl-class.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: IPersistStorageImpl Class"
title: "IPersistStorageImpl Class"
+description: "Learn more about: IPersistStorageImpl Class"
ms.date: "11/04/2016"
f1_keywords: ["IPersistStorageImpl", "ATLCOM/ATL::IPersistStorageImpl", "ATLCOM/ATL::IPersistStorageImpl::GetClassID", "ATLCOM/ATL::IPersistStorageImpl::HandsOffStorage", "ATLCOM/ATL::IPersistStorageImpl::InitNew", "ATLCOM/ATL::IPersistStorageImpl::IsDirty", "ATLCOM/ATL::IPersistStorageImpl::Load", "ATLCOM/ATL::IPersistStorageImpl::Save", "ATLCOM/ATL::IPersistStorageImpl::SaveCompleted"]
helpviewer_keywords: ["storage, ATL", "IPersistStorageImpl class"]
-ms.assetid: d652f02c-239c-47c7-9a50-3e9fc3014fff
---
# IPersistStorageImpl Class
@@ -22,7 +21,7 @@ class ATL_NO_VTABLE IPersistStorageImpl : public IPersistStorage
#### Parameters
-*T*
+*T*\
Your class, derived from `IPersistStorageImpl`.
## Members
@@ -97,7 +96,7 @@ STDMETHOD(InitNew)(IStorage*);
The ATL implementation delegates to the [IPersistStreamInit](/windows/win32/api/ocidl/nn-ocidl-ipersiststreaminit) interface.
-See [IPersistStorage:InitNew](/windows/win32/api/objidl/nf-objidl-ipersiststorage-initnew) in the Windows SDK.
+See [IPersistStorage::InitNew](/windows/win32/api/objidl/nf-objidl-ipersiststorage-initnew) in the Windows SDK.
## IPersistStorageImpl::IsDirty
@@ -111,7 +110,7 @@ STDMETHOD(IsDirty)(void);
The ATL implementation delegates to the [IPersistStreamInit](/windows/win32/api/ocidl/nn-ocidl-ipersiststreaminit) interface.
-See [IPersistStorage:IsDirty](/windows/win32/api/objidl/nf-objidl-ipersiststorage-isdirty) in the Windows SDK.
+See [IPersistStorage::IsDirty](/windows/win32/api/objidl/nf-objidl-ipersiststorage-isdirty) in the Windows SDK.
## IPersistStorageImpl::Load
@@ -125,7 +124,7 @@ STDMETHOD(Load)(IStorage* pStorage);
The ATL implementation delegates to the [IPersistStreamInit](/windows/win32/api/ocidl/nn-ocidl-ipersiststreaminit) interface. `Load` uses a stream named "Contents" to retrieve the object's data. The [Save](#save) method originally creates this stream.
-See [IPersistStorage:Load](/windows/win32/api/objidl/nf-objidl-ipersiststorage-load) in the Windows SDK.
+See [IPersistStorage::Load](/windows/win32/api/objidl/nf-objidl-ipersiststorage-load) in the Windows SDK.
## IPersistStorageImpl::Save
@@ -139,7 +138,7 @@ STDMETHOD(Save)(IStorage* pStorage, BOOL fSameAsLoad);
The ATL implementation delegates to the [IPersistStreamInit](/windows/win32/api/ocidl/nn-ocidl-ipersiststreaminit) interface. When `Save` is first called, it creates a stream named "Contents" on the specified storage. This stream is then used in later calls to `Save` and in calls to [Load](#load).
-See [IPersistStorage:Save](/windows/win32/api/objidl/nf-objidl-ipersiststorage-save) in the Windows SDK.
+See [IPersistStorage::Save](/windows/win32/api/objidl/nf-objidl-ipersiststorage-save) in the Windows SDK.
## IPersistStorageImpl::SaveCompleted
@@ -155,11 +154,11 @@ Returns S_OK.
### Remarks
-See [IPersistStorage:SaveCompleted](/windows/win32/api/objidl/nf-objidl-ipersiststorage-savecompleted) in the Windows SDK.
+See [IPersistStorage::SaveCompleted](/windows/win32/api/objidl/nf-objidl-ipersiststorage-savecompleted) in the Windows SDK.
## See also
-[Storages and Streams](/windows/win32/Stg/storages-and-streams)
-[IPersistStreamInitImpl Class](../../atl/reference/ipersiststreaminitimpl-class.md)
-[IPersistPropertyBagImpl Class](../../atl/reference/ipersistpropertybagimpl-class.md)
+[Storages and Streams](/windows/win32/Stg/storages-and-streams)\
+[IPersistStreamInitImpl Class](../../atl/reference/ipersiststreaminitimpl-class.md)\
+[IPersistPropertyBagImpl Class](../../atl/reference/ipersistpropertybagimpl-class.md)\
[Class Overview](../../atl/atl-class-overview.md)
diff --git a/docs/atl/reference/message-map-macros-atl.md b/docs/atl/reference/message-map-macros-atl.md
index 5752c16d10..99775caee5 100644
--- a/docs/atl/reference/message-map-macros-atl.md
+++ b/docs/atl/reference/message-map-macros-atl.md
@@ -2,7 +2,7 @@
description: "Learn more about: Message Map Macros (ATL)"
title: "Message Map Macros (ATL)"
ms.date: "11/04/2016"
-f1_keywords: ["atlwin/ATL::ALT_MSG_MAP", "atlwin/ATL::BEGIN_MSG_MAP", "atlwin/ATL::CHAIN_MSG_MAP_ALT", "atlwin/ATL::CHAIN_MSG_MAP_ALT_MEMBER", "atlwin/ATL::CHAIN_MSG_MAP", "atlwin/ATL::CHAIN_MSG_MAP_DYNAMIC", "atlwin/ATL::CHAIN_MSG_MAP_MEMBER", "atlwin/ATL::COMMAND_CODE_HANDLER", "atlwin/ATL::COMMAND_HANDLER", "atlwin/ATL::COMMAND_ID_HANDLER", "atlwin/ATL::COMMAND_RANGE_CODE_HANDLER", "atlwin/ATL::COMMAND_RANGE_HANDLER", "atlwin/ATL::DECLARE_EMPTY_MSG_MAP", "atlwin/ATL::DEFAULT_REFLECTION_HANDLER", "atlwin/ATL::END_MSG_MAP", "atlwin/ATL::FORWARD_NOTIFICATIONS", "atlwin/ATL::MESSAGE_HANDLER", "atlwin/ATL::MESSAGE_RANGE_HANDLER", "atlwin/ATL::NOTIFY_CODE_HANDLER", "atlwin/ATL::NOTIFY_HANDLER", "atlwin/ATL::NOTIFY_ID_HANDLER", "atlwin/ATL::NOTIFY_RANGE_CODE_HANDLER", "atlwin/ATL::NOTIFY_RANGE_HANDLER", "atlwin/ATL::REFLECT_NOTIFICATIONS", "atlwin/ATL::REFLECTED_COMMAND_CODE_HANDLER", "atlwin/ATL::REFLECTED_COMMAND_HANDLER", "atlwin/ATL::REFLECTED_COMMAND_ID_HANDLER", "atlwin/ATL::REFLECTED_COMMAND_RANGE_CODE_HANDLER", "atlwin/ATL::REFLECTED_COMMAND_RANGE_HANDLER", "atlwin/ATL::REFLECTED_NOTIFY_CODE_HANDLER", "atlwin/ATL::REFLECTED_NOTIFY_HANDLER", "atlwin/ATL::REFLECTED_NOTIFY_ID_HANDLER", "atlwin/ATL::REFLECTED_NOTIFY_RANGE_CODE_HANDLER", "atlwin/ATL::REFLECTED_NOTIFY_RANGE_HANDLER"]
+f1_keywords: ["atlwin/ATL::ALT_MSG_MAP", "atlwin/ATL::BEGIN_MSG_MAP", "atlwin/ATL::CHAIN_MSG_MAP_ALT", "atlwin/ATL::CHAIN_MSG_MAP_ALT_MEMBER", "atlwin/ATL::CHAIN_MSG_MAP", "atlwin/ATL::CHAIN_MSG_MAP_DYNAMIC", "atlwin/ATL::CHAIN_MSG_MAP_MEMBER", "atlwin/ATL::COMMAND_CODE_HANDLER", "atlwin/ATL::COMMAND_HANDLER", "atlwin/ATL::COMMAND_ID_HANDLER", "atlwin/ATL::COMMAND_RANGE_CODE_HANDLER", "atlwin/ATL::COMMAND_RANGE_HANDLER", "atlwin/ATL::DECLARE_EMPTY_MSG_MAP", "atlwin/ATL::DEFAULT_REFLECTION_HANDLER", "atlwin/ATL::END_MSG_MAP", "atlwin/ATL::FORWARD_NOTIFICATIONS", "atlwin/ATL::MESSAGE_HANDLER", "atlwin/ATL::MESSAGE_RANGE_HANDLER", "atlwin/ATL::NOTIFY_CODE_HANDLER", "atlwin/ATL::NOTIFY_HANDLER", "atlwin/ATL::NOTIFY_ID_HANDLER", "atlwin/ATL::NOTIFY_RANGE_CODE_HANDLER", "atlwin/ATL::NOTIFY_RANGE_HANDLER", "atlwin/ATL::REFLECT_NOTIFICATIONS", "atlwin/ATL::REFLECTED_COMMAND_CODE_HANDLER", "atlwin/ATL::REFLECTED_COMMAND_HANDLER", "atlwin/ATL::REFLECTED_COMMAND_ID_HANDLER", "atlwin/ATL::REFLECTED_COMMAND_RANGE_CODE_HANDLER", "atlwin/ATL::REFLECTED_COMMAND_RANGE_HANDLER", "atlwin/ATL::REFLECTED_NOTIFY_CODE_HANDLER", "atlwin/ATL::REFLECTED_NOTIFY_HANDLER", "atlwin/ATL::REFLECTED_NOTIFY_ID_HANDLER", "atlwin/ATL::REFLECTED_NOTIFY_RANGE_CODE_HANDLER", "atlwin/ATL::REFLECTED_NOTIFY_RANGE_HANDLER", "ATLWIN/ALT_MSG_MAP", "ATLWIN/BEGIN_MSG_MAP", "ATLWIN/CHAIN_MSG_MAP_ALT", "ATLWIN/CHAIN_MSG_MAP_ALT_MEMBER", "ATLWIN/CHAIN_MSG_MAP", "ATLWIN/CHAIN_MSG_MAP_DYNAMIC", "ATLWIN/CHAIN_MSG_MAP_MEMBER", "ATLWIN/COMMAND_CODE_HANDLER", "ATLWIN/COMMAND_HANDLER", "ATLWIN/COMMAND_ID_HANDLER", "ATLWIN/COMMAND_RANGE_CODE_HANDLER", "ATLWIN/COMMAND_RANGE_HANDLER", "ATLWIN/DECLARE_EMPTY_MSG_MAP", "ATLWIN/DEFAULT_REFLECTION_HANDLER", "ATLWIN/END_MSG_MAP", "ATLWIN/FORWARD_NOTIFICATIONS", "ATLWIN/MESSAGE_HANDLER", "ATLWIN/MESSAGE_RANGE_HANDLER", "ATLWIN/NOTIFY_CODE_HANDLER", "ATLWIN/NOTIFY_HANDLER", "ATLWIN/NOTIFY_ID_HANDLER", "ATLWIN/NOTIFY_RANGE_CODE_HANDLER", "ATLWIN/NOTIFY_RANGE_HANDLER", "ATLWIN/REFLECT_NOTIFICATIONS", "ATLWIN/REFLECTED_COMMAND_CODE_HANDLER", "ATLWIN/REFLECTED_COMMAND_HANDLER", "ATLWIN/REFLECTED_COMMAND_ID_HANDLER", "ATLWIN/REFLECTED_COMMAND_RANGE_CODE_HANDLER", "ATLWIN/REFLECTED_COMMAND_RANGE_HANDLER", "ATLWIN/REFLECTED_NOTIFY_CODE_HANDLER", "ATLWIN/REFLECTED_NOTIFY_HANDLER", "ATLWIN/REFLECTED_NOTIFY_ID_HANDLER", "ATLWIN/REFLECTED_NOTIFY_RANGE_CODE_HANDLER", "ATLWIN/REFLECTED_NOTIFY_RANGE_HANDLER"]
ms.assetid: eefdd546-8934-4a30-b263-9c06a8addcbd
---
# Message Map Macros (ATL)
diff --git a/docs/atl/reference/object-map-macros.md b/docs/atl/reference/object-map-macros.md
index c9ebdbdbbe..e0d53e8236 100644
--- a/docs/atl/reference/object-map-macros.md
+++ b/docs/atl/reference/object-map-macros.md
@@ -2,7 +2,7 @@
description: "Learn more about: Object Map Macros"
title: "Object Map Macros"
ms.date: "11/04/2016"
-f1_keywords: ["atlcom/ATL::DECLARE_OBJECT_DESCRIPTION", "atlcom/ATL::OBJECT_ENTRY_AUTO", "atlcom/ATL::OBJECT_ENTRY_NON_CREATEABLE_EX_AUTO"]
+f1_keywords: ["atlcom/ATL::DECLARE_OBJECT_DESCRIPTION", "atlcom/ATL::OBJECT_ENTRY_AUTO", "atlcom/ATL::OBJECT_ENTRY_NON_CREATEABLE_EX_AUTO", "ATLCOM/DECLARE_OBJECT_DESCRIPTION", "ATLCOM/OBJECT_ENTRY_AUTO", "ATLCOM/OBJECT_ENTRY_NON_CREATEABLE_EX_AUTO"]
ms.assetid: 680087f4-9894-41dd-a79c-6f337e1f13c1
---
# Object Map Macros
diff --git a/docs/atl/reference/object-status-macros.md b/docs/atl/reference/object-status-macros.md
index 81f8189659..06a9bdb39f 100644
--- a/docs/atl/reference/object-status-macros.md
+++ b/docs/atl/reference/object-status-macros.md
@@ -2,7 +2,7 @@
description: "Learn more about: Object Status Macros"
title: "Object Status Macros"
ms.date: "11/04/2016"
-f1_keywords: ["atlcom/ATL::DECLARE_OLEMISC_STATUS"]
+f1_keywords: ["atlcom/ATL::DECLARE_OLEMISC_STATUS", "ATLCOM/DECLARE_OLEMISC_STATUS"]
ms.assetid: 727dbef2-a342-4157-9d64-a421805d9747
---
# Object Status Macros
diff --git a/docs/atl/reference/property-map-macros.md b/docs/atl/reference/property-map-macros.md
index 038b525d2f..c0e785543d 100644
--- a/docs/atl/reference/property-map-macros.md
+++ b/docs/atl/reference/property-map-macros.md
@@ -2,7 +2,7 @@
description: "Learn more about: Property Map Macros"
title: "Property Map Macros"
ms.date: "11/04/2016"
-f1_keywords: ["atlcom/ATL::BEGIN_PROP_MAP", "atlcom/ATL::PROP_DATA_ENTRY", "atlcom/ATL::PROP_ENTRY_TYPE", "atlcom/ATL::PROP_ENTRY_TYPE_EX", "atlcom/ATL::PROP_PAGE", "atlcom/ATL::END_PROP_MAP"]
+f1_keywords: ["atlcom/ATL::BEGIN_PROP_MAP", "atlcom/ATL::PROP_DATA_ENTRY", "atlcom/ATL::PROP_ENTRY_TYPE", "atlcom/ATL::PROP_ENTRY_TYPE_EX", "atlcom/ATL::PROP_PAGE", "atlcom/ATL::END_PROP_MAP", "ATLCOM/BEGIN_PROP_MAP", "ATLCOM/PROP_DATA_ENTRY", "ATLCOM/PROP_ENTRY_TYPE", "ATLCOM/PROP_ENTRY_TYPE_EX", "ATLCOM/PROP_PAGE", "ATLCOM/END_PROP_MAP"]
helpviewer_keywords: ["property maps"]
ms.assetid: 128bc742-2b98-4b97-a243-684dbb83db77
---
@@ -78,7 +78,7 @@ When you create an ActiveX control, the wizard inserts this macro after the prop
In the following example, the extent of the object (`m_sizeExtent`) is being persisted.
[!code-cpp[NVC_ATL_Windowing#131](../../atl/codesnippet/cpp/property-map-macros_2.h)]
-
+
[!code-cpp[NVC_ATL_Windowing#132](../../atl/codesnippet/cpp/property-map-macros_3.h)]
## PROP_ENTRY_TYPE
diff --git a/docs/atl/reference/registry-data-exchange-macros.md b/docs/atl/reference/registry-data-exchange-macros.md
index 06dce60c45..98857707a3 100644
--- a/docs/atl/reference/registry-data-exchange-macros.md
+++ b/docs/atl/reference/registry-data-exchange-macros.md
@@ -2,7 +2,7 @@
description: "Learn more about: Registry Data Exchange Macros"
title: "Registry Data Exchange Macros"
ms.date: "11/04/2016"
-f1_keywords: ["atlplus/ATL::BEGIN_RDX_MAP", "atlplus/ATL::END_RDX_MAP", "atlplus/ATL::RDX_BINARY", "atlplus/ATL::RDX_CSTRING_TEXT", "atlplus/ATL::RDX_DWORD", "atlplus/ATL::RDX_TEXT"]
+f1_keywords: ["atlplus/ATL::BEGIN_RDX_MAP", "atlplus/ATL::END_RDX_MAP", "atlplus/ATL::RDX_BINARY", "atlplus/ATL::RDX_CSTRING_TEXT", "atlplus/ATL::RDX_DWORD", "atlplus/ATL::RDX_TEXT", "ATLPLUS/BEGIN_RDX_MAP", "ATLPLUS/END_RDX_MAP", "ATLPLUS/RDX_BINARY", "ATLPLUS/RDX_CSTRING_TEXT", "ATLPLUS/RDX_DWORD", "ATLPLUS/RDX_TEXT"]
helpviewer_keywords: ["RegistryDataExchange function, macros"]
ms.assetid: c1bc5e79-2307-43d2-9d10-3a62ffadf473
---
diff --git a/docs/atl/reference/registry-macros.md b/docs/atl/reference/registry-macros.md
index 930c43fb1a..f18617f0fe 100644
--- a/docs/atl/reference/registry-macros.md
+++ b/docs/atl/reference/registry-macros.md
@@ -2,7 +2,7 @@
description: "Learn more about: Registry Macros"
title: "Registry Macros"
ms.date: "08/19/2019"
-f1_keywords: ["atlcom/ATL::_ATL_STATIC_REGISTRY", "atlcom/ATL::DECLARE_LIBID", "atlcom/ATL::DECLARE_NO_REGISTRY", "atlcom/ATL::DECLARE_REGISTRY", "atlcom/ATL::DECLARE_REGISTRY_APPID_RESOURCEID", "atlcom/ATL::DECLARE_REGISTRY_RESOURCE", "atlcom/ATL::DECLARE_REGISTRY_RESOURCEID"]
+f1_keywords: ["ATLBASE/_ATL_STATIC_REGISTRY", "ATLBASE/DECLARE_LIBID", "ATLBASE/DECLARE_NO_REGISTRY", "ATLBASE/DECLARE_REGISTRY", "ATLBASE/DECLARE_REGISTRY_APPID_RESOURCEID", "ATLBASE/DECLARE_REGISTRY_RESOURCE", "ATLBASE/DECLARE_REGISTRY_RESOURCEID", "_ATL_STATIC_REGISTRY", "DECLARE_LIBID", "DECLARE_NO_REGISTRY", "DECLARE_REGISTRY", "DECLARE_REGISTRY_APPID_RESOURCEID", "DECLARE_REGISTRY_RESOURCE", "DECLARE_REGISTRY_RESOURCEID"]
helpviewer_keywords: ["registry, ATL macros"]
ms.assetid: 3ee041da-c63b-42a4-89cf-2a4b2a6f81ae
---
diff --git a/docs/atl/reference/service-map-macros.md b/docs/atl/reference/service-map-macros.md
index 76906d95cc..b42010306a 100644
--- a/docs/atl/reference/service-map-macros.md
+++ b/docs/atl/reference/service-map-macros.md
@@ -2,7 +2,7 @@
description: "Learn more about: Service Map Macros"
title: "Service Map Macros"
ms.date: "11/04/2016"
-f1_keywords: ["atlcom/ATL::BEGIN_SERVICE_MAP", "atlcom/ATL::END_SERVICE_MAP", "atlcom/ATL::SERVICE_ENTRY", "atlcom/ATL::SERVICE_ENTRY_CHAIN"]
+f1_keywords: ["atlcom/ATL::BEGIN_SERVICE_MAP", "atlcom/ATL::END_SERVICE_MAP", "atlcom/ATL::SERVICE_ENTRY", "atlcom/ATL::SERVICE_ENTRY_CHAIN", "ATLCOM/BEGIN_SERVICE_MAP", "ATLCOM/END_SERVICE_MAP", "ATLCOM/SERVICE_ENTRY", "ATLCOM/SERVICE_ENTRY_CHAIN"]
ms.assetid: ca02a125-454a-4cf6-aac2-1c5585025ed4
---
# Service Map Macros
@@ -115,7 +115,7 @@ STDMETHOD(QueryService)(
### Return Value
-The returned HRESULT value is one of the following:
+The returned HRESULT is one of the following values:
|Return value|Meaning|
|------------------|-------------|
@@ -123,23 +123,23 @@ The returned HRESULT value is one of the following:
|E_INVALIDARG|One or more of the arguments is invalid.|
|E_OUTOFMEMORY|Memory is insufficient to create the service.|
|E_UNEXPECTED|An unknown error occurred.|
-|E_NOINTERFACE|The requested interface is not part of this service, or the service is unknown.|
+|E_NOINTERFACE|The requested interface isn't part of this service, or the service is unknown.|
### Remarks
-`QueryService` returns an indirect pointer to the requested interface in the specified service. The caller is responsible for releasing this pointer when it is no longer required.
+`QueryService` returns an indirect pointer to the requested interface in the specified service. The caller is responsible for releasing this pointer when it's no longer required.
When you call `QueryService`, you pass both a service identifier (*guidService*) and an interface identifier (*riid*). The *guidService* specifies the service to which you want access, and the *riid* identifies an interface that is part of the service. In return, you receive an indirect pointer to the interface.
-The object that implements the interface might also implement interfaces that are part of other services. Consider the following:
+The object that implements the interface might also implement interfaces that are part of other services. Consider the following possibilities:
- Some of these interfaces might be optional. Not all interfaces defined in the service description are necessarily present on every implementation of the service or on every returned object.
-- Unlike calls to `QueryInterface`, passing a different service identifier does not necessarily mean that a different Component Object Model (COM) object is returned.
+- Unlike calls to `QueryInterface`, passing a different service identifier doesn't necessarily mean that a different Component Object Model (COM) object is returned.
-- The returned object might have additional interfaces that are not part of the definition of the service.
+- The returned object might have other interfaces that aren't part of the definition of the service.
-Two different services, such as SID_SMyService and SID_SYourService, can both specify the use of the same interface, even though the implementation of the interface might have nothing in common between the two services. This works, because a call to `QueryService` (SID_SMyService, IID_IDispatch) can return a different object than `QueryService` (SID_SYourService, IID_IDispatch). Object identity is not assumed when you specify a different service identifier.
+Two different services, such as SID_SMyService and SID_SYourService, can both specify the use of the same interface, even though the implementation of the interface might have nothing in common between the two services. This approach works, because a call to `QueryService` (SID_SMyService, IID_IDispatch) can return a different object than `QueryService` (SID_SYourService, IID_IDispatch). Object identity isn't assumed when you specify a different service identifier.
## See also
diff --git a/docs/atl/reference/snap-in-object-macros.md b/docs/atl/reference/snap-in-object-macros.md
index 434f4d34ca..380f4cf116 100644
--- a/docs/atl/reference/snap-in-object-macros.md
+++ b/docs/atl/reference/snap-in-object-macros.md
@@ -2,7 +2,7 @@
description: "Learn more about: Snap-In Object Macros"
title: "Snap-In Object Macros"
ms.date: "11/04/2016"
-f1_keywords: ["atlsnap/ATL::BEGIN_EXTENSION_SNAPIN_NODEINFO_MAP", "atlsnap/ATL::BEGIN_SNAPINTOOLBARID_MAP", "atlsnap/ATL::END_EXTENSION_SNAPIN_NODEINFO_MAP", "atlsnap/ATL::END_SNAPINTOOLBARID_MAP", "atlsnap/ATL::EXTENSION_SNAPIN_DATACLASS", "atlsnap/ATL::EXTENSION_SNAPIN_NODEINFO_ENTRY", "atlsnap/ATL::SNAPINMENUID", "atlsnap/ATL::SNAPINTOOLBARID_ENTRY"]
+f1_keywords: ["atlsnap/ATL::BEGIN_EXTENSION_SNAPIN_NODEINFO_MAP", "atlsnap/ATL::BEGIN_SNAPINTOOLBARID_MAP", "atlsnap/ATL::END_EXTENSION_SNAPIN_NODEINFO_MAP", "atlsnap/ATL::END_SNAPINTOOLBARID_MAP", "atlsnap/ATL::EXTENSION_SNAPIN_DATACLASS", "atlsnap/ATL::EXTENSION_SNAPIN_NODEINFO_ENTRY", "atlsnap/ATL::SNAPINMENUID", "atlsnap/ATL::SNAPINTOOLBARID_ENTRY", "ATLSNAP/BEGIN_EXTENSION_SNAPIN_NODEINFO_MAP", "ATLSNAP/BEGIN_SNAPINTOOLBARID_MAP", "ATLSNAP/END_EXTENSION_SNAPIN_NODEINFO_MAP", "ATLSNAP/END_SNAPINTOOLBARID_MAP", "ATLSNAP/EXTENSION_SNAPIN_DATACLASS", "ATLSNAP/EXTENSION_SNAPIN_NODEINFO_ENTRY", "ATLSNAP/SNAPINMENUID", "ATLSNAP/SNAPINTOOLBARID_ENTRY"]
ms.assetid: 4e9850c0-e395-4929-86c9-584a81828053
---
# Snap-In Object Macros
diff --git a/docs/atl/reference/string-conversion-macros.md b/docs/atl/reference/string-conversion-macros.md
index 9930172187..9b67e45e5f 100644
--- a/docs/atl/reference/string-conversion-macros.md
+++ b/docs/atl/reference/string-conversion-macros.md
@@ -2,7 +2,7 @@
description: "Learn more about: String Conversion Macros"
title: "String Conversion Macros"
ms.date: "11/04/2016"
-f1_keywords: ["atlconv/ATL::DEVMODEA2W", "atlconv/ATL::TEXTMETRICA2W", "atlconv/ATL::DEVMODEOLE2T", "atlconv/ATL::TEXTMETRICOLE2T", "atlconv/ATL::DEVMODET2OLE", "atlconv/ATL::TEXTMETRICT2OLE", "atlconv/ATL::DEVMODEW2A", "atlconv/ATL::TEXTMETRICW2A"]
+f1_keywords: ["atlconv/ATL::DEVMODEA2W", "atlconv/ATL::TEXTMETRICA2W", "atlconv/ATL::DEVMODEOLE2T", "atlconv/ATL::TEXTMETRICOLE2T", "atlconv/ATL::DEVMODET2OLE", "atlconv/ATL::TEXTMETRICT2OLE", "atlconv/ATL::DEVMODEW2A", "atlconv/ATL::TEXTMETRICW2A", "ATLCONV/DEVMODEA2W", "ATLCONV/TEXTMETRICA2W", "ATLCONV/DEVMODEOLE2T", "ATLCONV/TEXTMETRICOLE2T", "ATLCONV/DEVMODET2OLE", "ATLCONV/TEXTMETRICT2OLE", "ATLCONV/DEVMODEW2A", "ATLCONV/TEXTMETRICW2A"]
ms.assetid: 2ff7c0b6-2bde-45fe-897f-6128e18e0c27
---
# String Conversion Macros
diff --git a/docs/atl/reference/window-class-macros.md b/docs/atl/reference/window-class-macros.md
index 1e0a546539..4804e4b723 100644
--- a/docs/atl/reference/window-class-macros.md
+++ b/docs/atl/reference/window-class-macros.md
@@ -2,7 +2,7 @@
description: "Learn more about: Window Class Macros"
title: "Window Class Macros"
ms.date: "11/04/2016"
-f1_keywords: ["atlwin/ATL::DECLARE_WND_CLASS", "atlwin/ATL::DECLARE_WND_SUPERCLASS", "atlwin/ATL::DECLARE_WND_CLASS_EX"]
+f1_keywords: ["atlwin/ATL::DECLARE_WND_CLASS", "atlwin/ATL::DECLARE_WND_SUPERCLASS", "atlwin/ATL::DECLARE_WND_CLASS_EX", "ATLWIN/DECLARE_WND_CLASS", "ATLWIN/DECLARE_WND_SUPERCLASS", "ATLWIN/DECLARE_WND_CLASS_EX"]
ms.assetid: ce18681a-2bab-4453-9895-0f3ea47c2b24
---
# Window Class Macros
diff --git a/docs/atl/reference/windows-messages-macros.md b/docs/atl/reference/windows-messages-macros.md
index 3bcec790e6..0675305320 100644
--- a/docs/atl/reference/windows-messages-macros.md
+++ b/docs/atl/reference/windows-messages-macros.md
@@ -2,7 +2,7 @@
description: "Learn more about: Windows Messages Macros"
title: "Windows Messages Macros"
ms.date: "11/04/2016"
-f1_keywords: ["atlbase/ATL::WM_FORWARDMSG"]
+f1_keywords: ["atlbase/ATL::WM_FORWARDMSG", "ATLBASE/WM_FORWARDMSG"]
ms.assetid: 63abd22c-372d-4148-bb04-c605950ae64f
---
# Windows Messages Macros
diff --git a/docs/atl/supporting-idispatch-and-ierrorinfo.md b/docs/atl/supporting-idispatch-and-ierrorinfo.md
index 177b65623f..7d0c89d28e 100644
--- a/docs/atl/supporting-idispatch-and-ierrorinfo.md
+++ b/docs/atl/supporting-idispatch-and-ierrorinfo.md
@@ -9,7 +9,7 @@ ms.assetid: 7db2220f-319d-4ce9-9382-d340019f14f7
You can use the template class [IDispatchImpl](../atl/reference/idispatchimpl-class.md) to provide a default implementation of the `IDispatch Interface` portion of any dual interfaces on your object.
-If your object uses the `IErrorInfo` interface to report errors back to the client, then your object must support the `ISupportErrorInfo Interface` interface. The template class [ISupportErrorInfoImpl](../atl/reference/isupporterrorinfoimpl-class.md) provides an easy way to implement this if you only have a single interface that generates errors on your object.
+If your object uses the `IErrorInfo` interface to report errors back to the client, then your object must support the `ISupportErrorInfo` interface. The template class [ISupportErrorInfoImpl](../atl/reference/isupporterrorinfoimpl-class.md) provides an easy way to implement this if you only have a single interface that generates errors on your object.
## See also
diff --git a/docs/build-insights/get-started-with-cpp-build-insights.md b/docs/build-insights/get-started-with-cpp-build-insights.md
index 038b948e19..0ee6e8c583 100644
--- a/docs/build-insights/get-started-with-cpp-build-insights.md
+++ b/docs/build-insights/get-started-with-cpp-build-insights.md
@@ -14,7 +14,7 @@ The C++ Build Insights tools are available in Visual Studio 2019 and later. To s
::: moniker-end
::: moniker range=">=msvc-160"
-C++ Build Insights is a collection of tools that provides increased visibility into the Microsoft Visual C++ (MSVC) tool chain. The tools collect data about your C++ builds, and present it in a format that can help you answer common questions, like:
+C++ Build Insights is a collection of tools that collect data about your C++ builds, and present it in a format that can help you answer common questions such as:
- Are my builds sufficiently parallelized?
- What should I include in my pre-compiled header (PCH)?
@@ -22,16 +22,16 @@ C++ Build Insights is a collection of tools that provides increased visibility i
The main components of this technology are:
-- *vcperf.exe*, a command-line utility that you can use to collect traces for your builds,
-- a Windows Performance Analyzer (WPA) extension that allows you to view build traces in WPA, and
-- the C++ Build Insights SDK, a software development kit for creating your own tools that consume C++ Build Insights data.
+- `vcperf.exe`, a command-line utility that you can use to collect traces for your builds
+- A Windows Performance Analyzer (WPA) extension that allows you to view build traces in WPA, and
+- The C++ Build Insights software development kit for creating your own tools that consume C++ Build Insights data.
## Documentation sections
-[Tutorial: vcperf and Windows Performance Analyzer](tutorials/vcperf-and-wpa.md)\
+[vcperf and Windows Performance Analyzer](tutorials/vcperf-and-wpa.md)\
Learn how to collect build traces for your C++ projects and how to view them in WPA.
-[Tutorial: Windows Performance Basics](tutorials/wpa-basics.md)\
+[Windows Performance Basics](tutorials/wpa-basics.md)\
Discover useful WPA tips for analyzing your build traces.
[C++ Build Insights SDK](reference/sdk/overview.md)\
@@ -41,20 +41,13 @@ An overview of the C++ Build Insights SDK.
Read these articles from the official C++ team blog for more information on C++ Build Insights:
-[Introducing C++ Build Insights](https://devblogs.microsoft.com/cppblog/introducing-c-build-insights/)
-
-[Analyze your builds programmatically with the C++ Build Insights SDK](https://devblogs.microsoft.com/cppblog/analyze-your-builds-programmatically-with-the-c-build-insights-sdk/)
-
-[Finding build bottlenecks with C++ Build Insights](https://devblogs.microsoft.com/cppblog/finding-build-bottlenecks-with-cpp-build-insights/)
-
-[Faster builds with PCH suggestions from C++ Build Insights](https://devblogs.microsoft.com/cppblog/faster-builds-with-pch-suggestions-from-c-build-insights/)
-
-[Profiling template metaprograms with C++ Build Insights](https://devblogs.microsoft.com/cppblog/profiling-template-metaprograms-with-cpp-build-insights/)
-
-[Improving code generation time with C++ Build Insights](https://devblogs.microsoft.com/cppblog/improving-code-generation-time-with-cpp-build-insights/)
-
-[Introducing vcperf /timetrace for C++ build time analysis](https://devblogs.microsoft.com/cppblog/introducing-vcperf-timetrace-for-cpp-build-time-analysis/)
-
+[Introducing C++ Build Insights](https://devblogs.microsoft.com/cppblog/introducing-c-build-insights/)\
+[Analyze your builds programmatically with the C++ Build Insights SDK](https://devblogs.microsoft.com/cppblog/analyze-your-builds-programmatically-with-the-c-build-insights-sdk/)\
+[Finding build bottlenecks with C++ Build Insights](https://devblogs.microsoft.com/cppblog/finding-build-bottlenecks-with-cpp-build-insights/)\
+[Faster builds with PCH suggestions from C++ Build Insights](https://devblogs.microsoft.com/cppblog/faster-builds-with-pch-suggestions-from-c-build-insights/)\
+[Profiling template metaprograms with C++ Build Insights](https://devblogs.microsoft.com/cppblog/profiling-template-metaprograms-with-cpp-build-insights/)\
+[Improving code generation time with C++ Build Insights](https://devblogs.microsoft.com/cppblog/improving-code-generation-time-with-cpp-build-insights/)\
+[Introducing vcperf /timetrace for C++ build time analysis](https://devblogs.microsoft.com/cppblog/introducing-vcperf-timetrace-for-cpp-build-time-analysis/)\
[Faster C++ builds, simplified: a new metric for time](https://devblogs.microsoft.com/cppblog/faster-cpp-builds-simplified-a-new-metric-for-time/)
::: moniker-end
diff --git a/docs/build-insights/index.yml b/docs/build-insights/index.yml
index 7a68551902..876c27600a 100644
--- a/docs/build-insights/index.yml
+++ b/docs/build-insights/index.yml
@@ -6,8 +6,8 @@ metadata:
title: C++ Build Insights
description: Learn how to use C++ Build Insights to analyze and optimize your builds.
ms.topic: landing-page
- author: corob-msft
- ms.author: corob
+ author: tylermsft
+ ms.author: twhitney
ms.date: 05/26/2020
ms.custom: intro-landing-hub
@@ -25,6 +25,10 @@ landingContent:
url: get-started-with-cpp-build-insights.md
- linkListType: tutorial
links:
+ - text: Build Insights function view
+ url: tutorials/build-insights-function-view.md
+ - text: Build Insights included files view
+ url: tutorials/build-insights-included-files-view.md
- text: vcperf and Windows Performance Analyzer
url: tutorials/vcperf-and-wpa.md
- text: Windows Performance Analyzer basics
diff --git a/docs/build-insights/reference/sdk/c-event-data-types/event-data-struct.md b/docs/build-insights/reference/sdk/c-event-data-types/event-data-struct.md
index 3de2bb7457..734b468058 100644
--- a/docs/build-insights/reference/sdk/c-event-data-types/event-data-struct.md
+++ b/docs/build-insights/reference/sdk/c-event-data-types/event-data-struct.md
@@ -1,7 +1,9 @@
---
-title: "EVENT_DATA structure"
-description: "The C++ Build Insights SDK EVENT_DATA structure reference."
-ms.date: "02/12/2020"
+title: "C++ Build Insights SDK EVENT_DATA structure"
+description: "The C++ Build Insights SDK EVENT_DATA structure reference. The EVENT_DATA structure describes an event received from an analysis or relogging session."
+ms.date: "04/27/2022"
+ms.topic: language-reference
+ms.custom: kr2b-contr-experiment
helpviewer_keywords: ["C++ Build Insights", "C++ Build Insights SDK", "EVENT_DATA", "throughput analysis", "build time analysis", "vcperf.exe"]
---
# EVENT_DATA structure
@@ -13,7 +15,7 @@ The C++ Build Insights SDK is compatible with Visual Studio 2017 and later. To s
::: moniker-end
::: moniker range=">=msvc-150"
-The `EVENT_DATA` structure describes an event received from an analysis or relogging session. These sessions are started by calling the [Analyze](../functions/analyze.md), [AnalyzeA](../functions/analyze-a.md), [AnalyzeW](../functions/analyze-w.md), [Relog](../functions/relog.md), [RelogA](../functions/relog-a.md), or [RelogW](../functions/relog-w.md) functions.
+The `EVENT_DATA` structure describes an event from an analysis or relogging session. The [Analyze](../functions/analyze.md), [AnalyzeA](../functions/analyze-a.md), [AnalyzeW](../functions/analyze-w.md), [Relog](../functions/relog.md), [RelogA](../functions/relog-a.md), or [RelogW](../functions/relog-w.md) functions start these sessions.
## Syntax
@@ -51,14 +53,14 @@ typedef struct EVENT_DATA_TAG
| `EventId` | A number that identifies the event. For a list of event identifiers, see [EVENT_ID](event-id-enum.md). |
| `EventInstanceId` | A number that uniquely identifies the current event inside a trace. This value doesn't change when analyzing or relogging the same trace multiple times. Use this field to identify the same event in multiple analysis or relogging passes over the same trace. |
| `TickFrequency` | The number of ticks per second to use when evaluating a duration measured in ticks. |
-| `StartTimestamp` | When the event is an *Activity*, this field is set to a tick value captured at the time the activity started. If this event is a *Simple Event*, this field is set to a tick value captured at the time the event occurred. |
-| `StopTimestamp` | When the event is an *Activity*, this field is set to a tick value captured at the time the activity stopped. If the stop event hasn't yet been received for this activity, this field is set to zero. If this event is a *Simple Event*, this field is set to zero. |
-| `ExclusiveDurationTicks` | If this event is an *Activity*, this field is set to the number of ticks that occurred directly in this activity. The number of ticks that occurred in a child activity are excluded. This field is set to zero for *Simple Events*. |
-| `CPUTicks` | If this event is an *Activity*, this field is set to the number of CPU ticks that occurred during this activity. A CPU tick is different from a regular tick. CPU ticks are only counted when the CPU is executing code in an activity. CPU ticks aren't counted when the thread associated with the activity is sleeping. This field is set to zero for *Simple Events*. |
-| `ExclusiveCPUTicks` | This field has the same meaning as `CPUTicks`, except that it doesn't include CPU ticks that occurred in children activities. This field is set to zero for *Simple Events*. |
-| `WallClockTimeResponsibilityTicks` | If this event is an *Activity*, this field is set to a tick count that represents this activity's contribution to overall wall-clock time. A wall-clock time responsibility tick is different from a regular tick. Wall-clock time responsibility ticks take into account parallelism between activities. For example, two parallel activities may have a duration of 50 ticks and the same start and stop time. In this case, both will be assigned a wall-clock time responsibility of 25 ticks. This field is set to zero for *Simple Events*. |
-| `ExclusiveWallClockTimeResponsibilityTicks` | This field has the same meaning as `WallClockTimeResponsibilityTicks`, except that it doesn't include the wall-clock time responsibility ticks of children activities. This field is set to zero for *Simple Events*. |
-| `Data` | Points to additional data stored in the event. The type of data pointed to is different, depending on the `EventId` field. |
+| `StartTimestamp` | When the event is an *Activity*, this field is the tick value captured at the time the activity started. If this event is a *Simple Event*, this field is a tick value captured at the time the event occurred. |
+| `StopTimestamp` | When the event is an *Activity*, this field is the tick value captured at the time the activity stopped. If the stop event hasn't yet been received for this activity, this field is zero. If this event is a *Simple Event*, this field is zero. |
+| `ExclusiveDurationTicks` | If this event is an *Activity*, this field is the number of ticks that occurred directly in this activity. The number of ticks that occurred in a child activity are excluded. This field is zero for *Simple Events*. |
+| `CPUTicks` | If this event is an *Activity*, this field is the number of CPU ticks that occurred during this activity. A CPU tick is different from a regular tick. CPU ticks are only counted when the CPU is executing code in an activity. CPU ticks aren't counted when the thread associated with the activity is sleeping. This field is zero for *Simple Events*. |
+| `ExclusiveCPUTicks` | This field has the same meaning as `CPUTicks`, except that it doesn't include CPU ticks that occurred in children activities. This field is zero for *Simple Events*. |
+| `WallClockTimeResponsibilityTicks` | If this event is an *Activity*, this field is a tick count that represents this activity's contribution to overall wall-clock time. A wall-clock time responsibility tick is different from a regular tick. Wall-clock time responsibility ticks take into account parallelism between activities. For example, two parallel activities may have a duration of 50 ticks and the same start and stop time. In this case, both will be assigned a wall-clock time responsibility of 25 ticks. This field is zero for *Simple Events*. |
+| `ExclusiveWallClockTimeResponsibilityTicks` | This field has the same meaning as `WallClockTimeResponsibilityTicks`, except that it doesn't include the wall-clock time responsibility ticks of children activities. This field is zero for *Simple Events*. |
+| `Data` | Points to other data stored in the event. The type of data pointed to is different, depending on the `EventId` field. |
| `ProcessId` | The identifier for the process in which the event occurred. |
| `ThreadId` | The identifier for the thread in which the event occurred. |
| `ProcessorIndex` | The zero-indexed CPU number on which the event occurred. |
@@ -67,9 +69,13 @@ typedef struct EVENT_DATA_TAG
## Remarks
-Many fields in `EVENT_DATA` contain tick counts. C++ Build Insights uses Window's performance counter as a source of ticks. A tick count must be used with the `TickFrequency` field to convert it into an appropriate time unit such as seconds. See the example below for performing this conversion. `EVENT_DATA` doesn't contain a field for the regular tick count of an activity. To obtain this value, subtract `StartTimestamp` from `StopTimestamp`. `EVENT_DATA` is a structure that's meant to be used by C API users. For C++ API users, classes like [Event](../cpp-event-data-types/event.md) do time conversions automatically.
+Many fields in `EVENT_DATA` contain tick counts. C++ Build Insights uses the Windows performance counter as a source of ticks. A tick count must be used with the `TickFrequency` field to convert it into an appropriate time unit such as seconds. See the [tick conversion example](#tick-conversion-example), below.
-The value of the `EVENT_DATA` `Data` field depends on the value of its `EventId` field. The value of `Data` is described in the table below. Some entity identifiers may be missing from the table below. In this case, the `Data` field is set to **`nullptr`** or zero.
+`EVENT_DATA` doesn't contain a field for the regular tick count of an activity. To obtain this value, subtract `StartTimestamp` from `StopTimestamp`.
+
+`EVENT_DATA` is a structure that's meant to be used by C API users. For C++ API users, classes like [Event](../cpp-event-data-types/event.md) do time conversions automatically.
+
+The value of the `EVENT_DATA` `Data` field depends on the value of its `EventId` field. The value of `Data` is described in the table below. Some entity identifiers may be missing from the table below. In this case, the `Data` field is set to `nullptr` or zero.
| `EventId` value | Type pointed to by `Data` |
|--|--|
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/activity.md b/docs/build-insights/reference/sdk/cpp-event-data-types/activity.md
index aa060dc27b..fbf985fe5d 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/activity.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/activity.md
@@ -1,9 +1,12 @@
---
-title: "Activity class"
-description: "The C++ Build Insights SDK Activity class reference."
-ms.date: "02/12/2020"
+title: "Activity class - C++ Build Insights SDK"
+description: "The C++ Build Insights SDK Activity class reference. Use the Activity class to match any activity event."
+ms.date: "06/16/2022"
helpviewer_keywords: ["C++ Build Insights", "C++ Build Insights SDK", "Activity", "throughput analysis", "build time analysis", "vcperf.exe"]
+ms.topic: reference
+ms.custom: kr2b-contr-experiment
---
+
# Activity class
::: moniker range="<=msvc-140"
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/back-end-pass.md b/docs/build-insights/reference/sdk/cpp-event-data-types/back-end-pass.md
index d01ecfb1fb..076d93d4d9 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/back-end-pass.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/back-end-pass.md
@@ -1,9 +1,12 @@
---
-title: "BackEndPass class"
-description: "The C++ Build Insights SDK BackEndPass class reference."
-ms.date: "02/12/2020"
+title: "BackEndPass class - C++ Build Insights SDK"
+description: "The C++ Build Insights SDK BackEndPass class reference. Use the BackEndPass class to match a BACK_END_PASS event."
+ms.date: "06/16/2022"
helpviewer_keywords: ["C++ Build Insights", "C++ Build Insights SDK", "BackEndPass", "throughput analysis", "build time analysis", "vcperf.exe"]
+ms.topic: reference
+ms.custom: kr2b-contr-experiment
---
+
# BackEndPass class
::: moniker range="<=msvc-140"
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/c1-dll.md b/docs/build-insights/reference/sdk/cpp-event-data-types/c1-dll.md
index 8ad2fb4066..3982034e86 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/c1-dll.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/c1-dll.md
@@ -1,9 +1,12 @@
---
-title: "C1DLL class"
-description: "The C++ Build Insights SDK C1DLL class reference."
-ms.date: "02/12/2020"
+title: "C1DLL class - C++ Build Insights SDK"
+description: "The C++ Build Insights SDK C1DLL class reference. Use the C1DLL class to match a C1_DLL event."
+ms.date: "06/16/2022"
helpviewer_keywords: ["C++ Build Insights", "C++ Build Insights SDK", "C1DLL", "throughput analysis", "build time analysis", "vcperf.exe"]
+ms.topic: reference
+ms.custom: kr2b-contr-experiment
---
+
# C1DLL class
::: moniker range="<=msvc-140"
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/compiler-pass.md b/docs/build-insights/reference/sdk/cpp-event-data-types/compiler-pass.md
index b98998fd39..5fc55fa2ab 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/compiler-pass.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/compiler-pass.md
@@ -56,7 +56,7 @@ Along with the inherited members from its [Activity](activity.md) base class, th
[InputSourcePath](#input-source-path)\
[OutputObjectPath](#output-object-path)\
-[PassCode](#pass-code)\
+[PassCode](#pass-code)
## CompilerPass
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/environment-variable.md b/docs/build-insights/reference/sdk/cpp-event-data-types/environment-variable.md
index 7265d140e1..133484cb32 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/environment-variable.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/environment-variable.md
@@ -38,7 +38,7 @@ Along with the inherited members from its [SimpleEvent](simple-event.md) base cl
### Functions
-[Name](#name)
+[Name](#name)\
[Value](#value)
## EnvironmentVariable
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/event-group.md b/docs/build-insights/reference/sdk/cpp-event-data-types/event-group.md
index 0329689f4c..6eeabda6f4 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/event-group.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/event-group.md
@@ -42,11 +42,11 @@ The activity type contained in the group.
### Functions
-[Back](#back)
-[begin](#begin)
-[end](#end)
-[Front](#front)
-[operator[]](#subscript-operator)
+[Back](#back)\
+[begin](#begin)\
+[end](#end)\
+[Front](#front)\
+[operator[]](#subscript-operator)\
[Size](#size)
## Back
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/event-stack.md b/docs/build-insights/reference/sdk/cpp-event-data-types/event-stack.md
index 7b64275549..e206d537cf 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/event-stack.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/event-stack.md
@@ -37,8 +37,8 @@ public:
### Functions
-[Back](#back)
-[operator[]](#subscript-operator)
+[Back](#back)\
+[operator[]](#subscript-operator)\
[Size](#size)
## Back
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/event.md b/docs/build-insights/reference/sdk/cpp-event-data-types/event.md
index f8f8926917..e4518cef9e 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/event.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/event.md
@@ -43,7 +43,7 @@ public:
### Functions
-[Data](#data)
+[Data](#data)\
[EventId](#event-id)\
[EventInstanceId](#event-instance-id)\
[EventName](#event-name)\
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/file-input.md b/docs/build-insights/reference/sdk/cpp-event-data-types/file-input.md
index 74ba8fc4ce..1607802410 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/file-input.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/file-input.md
@@ -48,7 +48,7 @@ Along with the inherited members from its [SimpleEvent](simple-event.md) base cl
### Functions
-[Path](#path)
+[Path](#path)\
[Type](#type)
## FileInput
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/file-output.md b/docs/build-insights/reference/sdk/cpp-event-data-types/file-output.md
index 6772fe813e..f339588c6e 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/file-output.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/file-output.md
@@ -48,7 +48,7 @@ Along with the inherited members from its [SimpleEvent](simple-event.md) base cl
### Functions
-[Path](#path)
+[Path](#path)\
[Type](#type)
## FileOutput
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/force-inlinee.md b/docs/build-insights/reference/sdk/cpp-event-data-types/force-inlinee.md
index edd2ae4ddf..ee9bac8bc6 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/force-inlinee.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/force-inlinee.md
@@ -38,7 +38,7 @@ Along with the inherited members from its [SimpleEvent](simple-event.md) base cl
### Functions
-[Name](#name)
+[Name](#name)\
[Size](#size)
## ForceInlinee
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/function.md b/docs/build-insights/reference/sdk/cpp-event-data-types/function.md
index 8d15a5ce98..bc81e6fbcf 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/function.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/function.md
@@ -1,7 +1,9 @@
---
-title: "Function class"
-description: "The C++ Build Insights SDK Function class reference."
-ms.date: "02/12/2020"
+title: "C++ Build Insights SDK Function class"
+description: "The C++ Build Insights SDK Function class reference. Use the Function class to match a FUNCTION event."
+ms.date: "04/27/2022"
+ms.topic: language-reference
+ms.custom: kr2b-contr-experiment
helpviewer_keywords: ["C++ Build Insights", "C++ Build Insights SDK", "Function", "throughput analysis", "build time analysis", "vcperf.exe"]
---
# Function class
@@ -29,7 +31,7 @@ public:
## Members
-Along with the inherited members from its [Activity](activity.md) base class, the `Function` class contains the following members:
+Along with the inherited members from the [Activity](activity.md) base class, the `Function` class contains the following members:
### Constructors
@@ -39,7 +41,7 @@ Along with the inherited members from its [Activity](activity.md) base class, th
[Name](#name)
-## Function
+## Function
```cpp
Function(const RawEvent& event);
@@ -50,7 +52,7 @@ Function(const RawEvent& event);
*event*\
A [FUNCTION](../event-table.md#function) event.
-## Name
+## Name
```cpp
const char* Name() const;
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/invocation.md b/docs/build-insights/reference/sdk/cpp-event-data-types/invocation.md
index 0006c06a83..3dc40659f7 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/invocation.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/invocation.md
@@ -50,10 +50,10 @@ Along with the inherited members from its [Activity](activity.md) base class, th
### Functions
-[ToolPath](#tool-path)
-[ToolVersion](#tool-version)
-[ToolVersionString](#tool-version-string)
-[Type](#type)
+[ToolPath](#tool-path)\
+[ToolVersion](#tool-version)\
+[ToolVersionString](#tool-version-string)\
+[Type](#type)\
[WorkingDirectory](#working-directory)
## Invocation
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/pass1.md b/docs/build-insights/reference/sdk/cpp-event-data-types/pass1.md
index fc8d17f3cd..6063aeef27 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/pass1.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/pass1.md
@@ -1,7 +1,9 @@
---
-title: "Pass1 class"
-description: "The C++ Build Insights SDK Pass1 class reference."
-ms.date: "02/12/2020"
+title: "C++ Build Insights SDK Pass1 class"
+description: "The C++ Build Insights SDK Pass1 class reference. Use the Pass1 class to match a PASS1 event"
+ms.date: "04/27/2022"
+ms.topic: language-reference
+ms.custom: kr2b-contr-experiment
helpviewer_keywords: ["C++ Build Insights", "C++ Build Insights SDK", "Pass1", "throughput analysis", "build time analysis", "vcperf.exe"]
---
# Pass1 class
@@ -27,13 +29,13 @@ public:
## Members
-Along with the inherited members from its [LinkerPass](linker-pass.md) base class, the `Pass1` class contains the following members:
+Along with the inherited members from the [LinkerPass](linker-pass.md) base class, the `Pass1` class contains the following members:
### Constructors
[Pass1](#pass1)
-## Pass1
+## Pass1
```cpp
Pass1(const RawEvent& event);
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/raw-event.md b/docs/build-insights/reference/sdk/cpp-event-data-types/raw-event.md
index 2d767ed280..ef78df1ffc 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/raw-event.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/raw-event.md
@@ -67,8 +67,8 @@ If you don't want to convert ticks yourself, the `RawEvent` class provides membe
[CPUTime](#cpu-time)\
[Data](#data)\
[Duration](#duration)\
-[EventId](#event-id)
-[EventInstanceId](#event-instance-id)
+[EventId](#event-id)\
+[EventInstanceId](#event-instance-id)\
[EventName](#event-name)\
[EventWideName](#event-wide-name)\
[ExclusiveCPUTicks](#exclusive-cpu-ticks)\
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/symbol-name.md b/docs/build-insights/reference/sdk/cpp-event-data-types/symbol-name.md
index 98b10ece5b..a172bccaea 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/symbol-name.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/symbol-name.md
@@ -38,7 +38,7 @@ Along with the inherited members from its [SimpleEvent](simple-event.md) base cl
### Functions
-[Key](#key)
+[Key](#key)\
[Name](#name)
## Key
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/template-instantiation.md b/docs/build-insights/reference/sdk/cpp-event-data-types/template-instantiation.md
index 3729c2bebd..b73bc7f4fb 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/template-instantiation.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/template-instantiation.md
@@ -48,8 +48,8 @@ Along with the inherited members from its [Activity](activity.md) base class, th
### Functions
-[Kind](#kind)
-[PrimaryTemplateSymbolKey](#primary-template-symbol-key)
+[Kind](#kind)\
+[PrimaryTemplateSymbolKey](#primary-template-symbol-key)\
[SpecializationSymbolKey](#specialization-symbol-key)
## Kind
diff --git a/docs/build-insights/reference/sdk/cpp-event-data-types/trace-info.md b/docs/build-insights/reference/sdk/cpp-event-data-types/trace-info.md
index 918f0ecba9..0d7d0284f4 100644
--- a/docs/build-insights/reference/sdk/cpp-event-data-types/trace-info.md
+++ b/docs/build-insights/reference/sdk/cpp-event-data-types/trace-info.md
@@ -47,10 +47,10 @@ If you don't want to convert ticks yourself, the `TraceInfo` class provides a me
### Functions
-[Duration](#duration)
-[LogicalProcessorCount](#logical-processor-count)
-[StartTimestamp](#start-timestamp)
-[StopTimestamp](#stop-timestamp)
+[Duration](#duration)\
+[LogicalProcessorCount](#logical-processor-count)\
+[StartTimestamp](#start-timestamp)\
+[StopTimestamp](#stop-timestamp)\
[TickFrequency](#tick-frequency)
## Duration
diff --git a/docs/build-insights/reference/sdk/functions/analyze-w.md b/docs/build-insights/reference/sdk/functions/analyze-w.md
index b4442cb02e..f7dc804272 100644
--- a/docs/build-insights/reference/sdk/functions/analyze-w.md
+++ b/docs/build-insights/reference/sdk/functions/analyze-w.md
@@ -1,10 +1,13 @@
---
-title: "AnalyzeW"
-description: "The C++ Build Insights SDK AnalyzeW function reference."
-ms.date: "02/12/2020"
+title: "AnalyzeW - C++ Build Insights SDK"
+description: "The C++ Build Insights SDK AnalyzeW function reference. Use the AnalyzeW function to analyze MSVC events read from an input Event Tracing for Windows trace."
+ms.date: "06/16/2022"
helpviewer_keywords: ["C++ Build Insights", "C++ Build Insights SDK", "AnalyzeW", "throughput analysis", "build time analysis", "vcperf.exe"]
+ms.topic: reference
+ms.custom: kr2b-contr-experiment
---
-# AnalyzeW
+
+# AnalyzeW function
::: moniker range="<=msvc-140"
diff --git a/docs/build-insights/reference/sdk/functions/analyze.md b/docs/build-insights/reference/sdk/functions/analyze.md
index 3d2f07c585..32e5bd369c 100644
--- a/docs/build-insights/reference/sdk/functions/analyze.md
+++ b/docs/build-insights/reference/sdk/functions/analyze.md
@@ -1,10 +1,13 @@
---
-title: "Analyze"
-description: "The C++ Build Insights SDK Analyze function reference."
-ms.date: "02/12/2020"
+title: "Analyze - C++ Build Insights SDK"
+description: "The C++ Build Insights SDK Analyze function reference. Use the Analyze function to analyze an Event Tracing for Windows trace from MSVC while tracing a build."
+ms.date: "06/16/2022"
helpviewer_keywords: ["C++ Build Insights", "C++ Build Insights SDK", "Analyze", "throughput analysis", "build time analysis", "vcperf.exe"]
+ms.topic: reference
+ms.custom: kr2b-contr-experiment
---
-# Analyze
+
+# Analyze function
::: moniker range="<=msvc-140"
diff --git a/docs/build-insights/reference/sdk/functions/make-static-analyzer-group.md b/docs/build-insights/reference/sdk/functions/make-static-analyzer-group.md
index 49afc72718..e6aac87710 100644
--- a/docs/build-insights/reference/sdk/functions/make-static-analyzer-group.md
+++ b/docs/build-insights/reference/sdk/functions/make-static-analyzer-group.md
@@ -1,7 +1,9 @@
---
-title: "MakeStaticAnalyzerGroup"
-description: "The C++ Build Insights SDK MakeStaticAnalyzerGroup function reference."
-ms.date: "02/12/2020"
+title: "C++ Build Insights SDK MakeStaticAnalyzerGroup"
+description: "The C++ Build Insights SDK MakeStaticAnalyzerGroup function reference. Use this function to create a static analyzer group for functions like Analyze or Relog."
+ms.date: "04/27/2022"
+ms.topic: language-reference
+ms.custom: kr2b-contr-experiment
helpviewer_keywords: ["C++ Build Insights", "C++ Build Insights SDK", "MakeStaticAnalyzerGroup", "throughput analysis", "build time analysis", "vcperf.exe"]
---
# MakeStaticAnalyzerGroup
@@ -13,7 +15,7 @@ The C++ Build Insights SDK is compatible with Visual Studio 2017 and later. To s
::: moniker-end
::: moniker range=">=msvc-150"
-The `MakeStaticAnalyzerGroup` function is used to create a static analyzer group that can be passed to functions such as [`Analyze`](analyze.md) or [`Relog`](relog.md). Members of an analyzer group receive events one by one from left to right, until all events in a trace get analyzed.
+The `MakeStaticAnalyzerGroup` function creates a static analyzer group that you can pass to functions such as [`Analyze`](analyze.md) or [`Relog`](relog.md). Members of an analyzer group receive events one by one from left to right, until all events in a trace are analyzed.
## Syntax
@@ -32,10 +34,12 @@ A parameter pack of [`IAnalyzer`](../other-types/ianalyzer-class.md) pointers in
### Return Value
-A static analyzer group. Use the **`auto`** keyword to capture the return value.
+A static analyzer group. Use the `auto` keyword to capture the return value.
## Remarks
-Unlike dynamic analyzer groups, the members of a static analyzer group must be known at compile time. Additionally, a static analyzer group contains [`IAnalyzer`](../other-types/ianalyzer-class.md) pointers that don't have polymorphic behavior. When using a static analyzer group to analyze an Event Tracing for Windows (ETW) trace, calls to the `IAnalyzer` interface always resolve to the object directly pointed to by the analyzer group member. This loss of flexibility comes with a possibility of faster event processing times. If the members of an analyzer group can't be known at compile time, or if you require polymorphic behavior on your `IAnalyzer` pointers, consider using a dynamic analyzer group. To use a dynamic analyzer group, call [`MakeDynamicAnalyzerGroup`](make-static-analyzer-group.md) instead.
+Unlike dynamic analyzer groups, the members of a static analyzer group must be known at compile time. Also, a static analyzer group contains [`IAnalyzer`](../other-types/ianalyzer-class.md) pointers that don't have polymorphic behavior. When a static analyzer group analyzes an Event Tracing for Windows (ETW) trace, calls to the `IAnalyzer` interface always resolve to the object directly pointed to by the analyzer group member. This loss of flexibility comes with a possibility of faster event processing.
+
+If the members of an analyzer group can't be known at compile time, or if you require polymorphic behavior on your `IAnalyzer` pointers, consider using a dynamic analyzer group. To use a dynamic analyzer group, call [`MakeDynamicAnalyzerGroup`](make-static-analyzer-group.md) instead.
::: moniker-end
diff --git a/docs/build-insights/reference/sdk/functions/relog.md b/docs/build-insights/reference/sdk/functions/relog.md
index 53fe924c8c..13259b2978 100644
--- a/docs/build-insights/reference/sdk/functions/relog.md
+++ b/docs/build-insights/reference/sdk/functions/relog.md
@@ -77,4 +77,6 @@ The input trace is passed through the analyzer group *numberOfAnalysisPasses* ti
The relogging of system events like CPU samples from within a relogger class isn't supported. Use the *systemEventsRetentionFlags* parameter to decide which system events to keep in the output trace.
+The `relog` function depends on the COM API. You must call `CoInitialize` before you call `relog`. Call `CoUninitialize` once `relog` has finished. If you call `relog` without a call to `CoInitialize` first, you'll get error code 9 (`RESULT_CODE_FAILURE_START_RELOGGER`).
+
::: moniker-end
diff --git a/docs/build-insights/reference/sdk/functions/stop-tracing-session-a.md b/docs/build-insights/reference/sdk/functions/stop-tracing-session-a.md
index 46dedc00da..39ac969bab 100644
--- a/docs/build-insights/reference/sdk/functions/stop-tracing-session-a.md
+++ b/docs/build-insights/reference/sdk/functions/stop-tracing-session-a.md
@@ -13,7 +13,7 @@ The C++ Build Insights SDK is compatible with Visual Studio 2017 and later. To s
::: moniker-end
::: moniker range=">=msvc-150"
-The `StopTracingSessionA` function stops an ongoing tracing session and produces a raw trace file. Raw trace files can be passed to the [Analyze](analyze.md), [AnalzeA](analyze-a.md), and [AnalyzeW](analyze-w.md) functions to start an analysis session. Raw trace files can also be passed to the [Relog](relog.md), [RelogA](relog-a.md), and [RelogW](relog-w.md) functions to start relogging session. Executables calling `StopTracingSessionA` must have administrator privileges.
+The `StopTracingSessionA` function stops an ongoing tracing session and produces a raw trace file. Raw trace files can be passed to the [Analyze](analyze.md), [AnalyzeA](analyze-a.md), and [AnalyzeW](analyze-w.md) functions to start an analysis session. Raw trace files can also be passed to the [Relog](relog.md), [RelogA](relog-a.md), and [RelogW](relog-w.md) functions to start relogging session. Executables calling `StopTracingSessionA` must have administrator privileges.
## Syntax
diff --git a/docs/build-insights/reference/sdk/functions/stop-tracing-session-w.md b/docs/build-insights/reference/sdk/functions/stop-tracing-session-w.md
index a050b60ed3..32e05f8ce8 100644
--- a/docs/build-insights/reference/sdk/functions/stop-tracing-session-w.md
+++ b/docs/build-insights/reference/sdk/functions/stop-tracing-session-w.md
@@ -13,7 +13,7 @@ The C++ Build Insights SDK is compatible with Visual Studio 2017 and later. To s
::: moniker-end
::: moniker range=">=msvc-150"
-The `StopTracingSessionW` function stops an ongoing tracing session and produces a raw trace file. Raw trace files can be passed to the [Analyze](analyze.md), [AnalzeA](analyze-a.md), and [AnalyzeW](analyze-w.md) functions to start an analysis session. Raw trace files can also be passed to the [Relog](relog.md), [RelogA](relog-a.md), and [RelogW](relog-w.md) functions to start relogging session. Executables calling `StopTracingSessionW` must have administrator privileges.
+The `StopTracingSessionW` function stops an ongoing tracing session and produces a raw trace file. Raw trace files can be passed to the [Analyze](analyze.md), [AnalyzeA](analyze-a.md), and [AnalyzeW](analyze-w.md) functions to start an analysis session. Raw trace files can also be passed to the [Relog](relog.md), [RelogA](relog-a.md), and [RelogW](relog-w.md) functions to start relogging session. Executables calling `StopTracingSessionW` must have administrator privileges.
## Syntax
diff --git a/docs/build-insights/reference/sdk/functions/stop-tracing-session.md b/docs/build-insights/reference/sdk/functions/stop-tracing-session.md
index 1aa039019e..9e52425ed8 100644
--- a/docs/build-insights/reference/sdk/functions/stop-tracing-session.md
+++ b/docs/build-insights/reference/sdk/functions/stop-tracing-session.md
@@ -1,7 +1,9 @@
---
-title: "StopTracingSession"
-description: "The C++ Build Insights SDK StopTracingSession function reference."
-ms.date: "02/12/2020"
+title: "C++ Build Insights SDK StopTracingSession"
+description: "The C++ Build Insights SDK StopTracingSession function reference. StopTracingSession stops an ongoing tracing session and produces a raw trace file."
+ms.date: "04/27/2022"
+ms.topic: language-reference
+ms.custom: kr2b-contr-experiment
helpviewer_keywords: ["C++ Build Insights", "C++ Build Insights SDK", "StopTracingSession", "throughput analysis", "build time analysis", "vcperf.exe"]
---
# StopTracingSession
@@ -13,7 +15,9 @@ The C++ Build Insights SDK is compatible with Visual Studio 2017 and later. To s
::: moniker-end
::: moniker range=">=msvc-150"
-The `StopTracingSession` function stops an ongoing tracing session and produces a raw trace file. Raw trace files can be passed to the [Analyze](analyze.md), [AnalzeA](analyze-a.md), and [AnalyzeW](analyze-w.md) functions to start an analysis session. Raw trace files can also be passed to the [Relog](relog.md), [RelogA](relog-a.md), and [RelogW](relog-w.md) functions to start a relogging session. Executables calling `StopTracingSession` must have administrator privileges.
+The `StopTracingSession` function stops an ongoing tracing session and produces a raw trace file. You can pass raw trace files to the [Analyze](analyze.md), [AnalyzeA](analyze-a.md), and [AnalyzeW](analyze-w.md) functions to start an analysis session. You can pass raw trace files to the [Relog](relog.md), [RelogA](relog-a.md), and [RelogW](relog-w.md) functions to start a relogging session.
+
+The caller must have administrator permissions to use `StopTracingSession`.
## Syntax
@@ -24,7 +28,7 @@ inline RESULT_CODE StopTracingSession(
TRACING_SESSION_STATISTICS* statistics);
inline RESULT_CODE StopTracingSession(
- const wchar_t* sessionName
+ const wchar_t* sessionName,
const wchar_t* outputLogFile,
TRACING_SESSION_STATISTICS* statistics);
```
@@ -32,10 +36,10 @@ inline RESULT_CODE StopTracingSession(
### Parameters
*sessionName*\
-The name of the tracing session to stop. Use the same session name as the one passed to [StartTracingSession](start-tracing-session.md), [StartTracingSessionA](start-tracing-session-a.md), or [StartTracingSessionW](start-tracing-session-w.md).
+The name of the tracing session to stop. Use the same session name as used for [StartTracingSession](start-tracing-session.md), [StartTracingSessionA](start-tracing-session-a.md), or [StartTracingSessionW](start-tracing-session-w.md).
*outputLogFile*\
-Path to the final output log file where the raw trace should be saved.
+Full path of the final output log file to save the raw trace.
*statistics*\
Pointer to a [TRACING_SESSION_STATISTICS](../other-types/tracing-session-statistics-struct.md) object. `StopTracingSession` writes trace collection statistics in this object before returning.
diff --git a/docs/build-insights/reference/vcperf-commands.md b/docs/build-insights/reference/vcperf-commands.md
index 1a7924241b..ed8342bf1b 100644
--- a/docs/build-insights/reference/vcperf-commands.md
+++ b/docs/build-insights/reference/vcperf-commands.md
@@ -18,23 +18,23 @@ This article lists and describes the commands available in *`vcperf.exe`*, and h
## Commands to start and stop traces
> [!IMPORTANT]
-> The following commands all require administrative privileges.
+> Unless you specify `/noadmin`, the following commands require administrative privileges.
| Option | Arguments and description |
|------------------|---------------------------|
-| `/start` | `[/nocpusampling]` `` |
-| | Tells *vcperf.exe* to start a trace under the given session name. There can only be one active session at a time on a given machine.
If the `/nocpusampling` option is specified, *vcperf.exe* doesn't collect CPU samples. It prevents the use of the CPU Usage (Sampled) view in Windows Performance Analyzer, but makes the collected traces smaller.
Once tracing is started, *vcperf.exe* returns immediately. Events are collected system-wide for all processes running on the machine. That means that you don't need to build your project from the same command prompt as the one you used to run *vcperf.exe*. For example, you can build your project from Visual Studio. |
-| `/stop` | `` `` |
-| | Stops the trace identified by the given session name. Runs a post-processing step on the trace to generate a file viewable in Windows Performance Analyzer (WPA). For the best viewing experience, use a version of WPA that includes the C++ Build Insights add-in. For more information, see [Get started with C++ Build Insights](../get-started-with-cpp-build-insights.md). The `` parameter specifies where to save the output file. |
-| `/stopnoanalyze` | `` `` |
-| | Stops the trace identified by the given session name and writes the raw, unprocessed data in the specified output file. The resulting file isn't meant to be viewed in WPA.
The post-processing step involved in the `/stop` command can sometimes be lengthy. You can use the `/stopnoanalyze` command to delay this post-processing step. Use the `/analyze` command when you're ready to produce a file viewable in Windows Performance Analyzer. |
+| `/start` | [`/noadmin`] [`/nocpusampling`] [`/level1` \| `/level2` \| `/level3`] `` |
+| | Starts a trace under the given session name.
The `/noadmin` option runs *vcperf.exe* without admin privileges, and it ignores the `/nocpusampling` option. When you run vcperf without admin privileges, there can be more than one active session on a given machine.
The `/nocpusampling` option specifies *vcperf.exe* doesn't collect CPU samples. It prevents the use of the CPU Usage (Sampled) view in Windows Performance Analyzer, but makes the collected traces smaller.
The `/level1`, `/level2`, or `/level3` options specify which MSVC events to collect, in increasing level of information. Level 3 includes all events. Level 2 includes all events except template instantiation events. Level 1 includes all events except template instantiation, function, and file events. If unspecified, `/level2` is selected by default.
Once *vcperf.exe* starts the trace, it returns immediately. The trace collects events system-wide for all processes running on the machine. That means that you don't need to build your project in the same command prompt window as the one you use to run *vcperf.exe*. For example, you can build your project in Visual Studio. |
+| `/stop` | (1) [`/templates`] ` `
(2) [`/templates`] ` /timetrace ` |
+| | Stops the trace identified by the given session name. Runs a post-processing step on the trace to generate a file specified by the `` parameter.
The `/templates` option includes template instantiation events in the file.
(1) Generates a file viewable in Windows Performance Analyzer (WPA). The output file requires a `.etl` extension.
(2) Generates a file viewable in the Microsoft Edge trace viewer (`edge://tracing`). The output file requires a `.json` extension. |
+| `/stopnoanalyze` | ` ` |
+| | Stops the trace identified by the given session name and writes the raw, unprocessed data in the specified output file. The resulting file isn't meant for viewing in WPA.
The post-processing step involved in the `/stop` command can sometimes be lengthy. You can use the `/stopnoanalyze` command to delay this post-processing step. Use the `/analyze` command when you're ready to produce a file viewable in Windows Performance Analyzer or the Microsoft Edge trace viewer. |
## Miscellaneous commands
| Option | Arguments and description |
|------------|---------------------------|
-| `/analyze` | ` ` |
-| | Accepts a raw trace file produced by the `/stopnoanalyze` command. Runs a post-processing step on this trace to generate a file viewable in Windows Performance Analyzer. For the best viewing experience, use a version of WPA that includes the C++ Build Insights add-in. For more information, see [Get started with C++ Build Insights](../get-started-with-cpp-build-insights.md). |
+| `/analyze` | (1) [`/templates`] ` `
(2) [`/templates`] ` /timetrace ` |
+| | Accepts a raw trace file produced by the `/stopnoanalyze` command. Runs a post-processing step on this trace to generate the file specified by the `` parameter.
The `/templates` option includes template instantiation events in the file.
(1) Generates a file viewable in Windows Performance Analyzer (WPA). The output file requires a `.etl` extension.
(2) Generates a file viewable in the Microsoft Edge trace viewer (`edge://tracing`). The output file requires a `.json` extension. |
## See also
diff --git a/docs/build-insights/toc.yml b/docs/build-insights/toc.yml
index 30f047a6e9..99cea23e5b 100644
--- a/docs/build-insights/toc.yml
+++ b/docs/build-insights/toc.yml
@@ -6,6 +6,12 @@ items:
- name: "Tutorials"
expanded: true
items:
+ - name: "Troubleshoot function inlining on build time"
+ href: ../build-insights/tutorials/build-insights-function-view.md
+ - name: "Troubleshoot header file impact on build time"
+ href: ../build-insights/tutorials/build-insights-included-files-view.md
+ - name: "Build Insights tips and tricks"
+ href: ../build-insights/tutorials/build-insights-tips.md
- name: "vcperf and Windows Performance Analyzer"
href: ../build-insights/tutorials/vcperf-and-wpa.md
- name: "Windows Performance Analyzer basics"
diff --git a/docs/build-insights/tutorials/build-insights-function-view.md b/docs/build-insights/tutorials/build-insights-function-view.md
new file mode 100644
index 0000000000..598ea77cf2
--- /dev/null
+++ b/docs/build-insights/tutorials/build-insights-function-view.md
@@ -0,0 +1,151 @@
+---
+title: "Troubleshoot function inlining on build time"
+description: "Tutorial for how to use Build Insights function view to troubleshoot the impact of function inlining on build time in your C++ projects."
+ms.date: 5/30/2024
+helpviewer_keywords: ["C++ Build Insights", "inline function analysis", "build time analysis", "__forceinline analysis", "inlines analysis"]
+---
+# Troubleshoot function inlining on build time
+
+Use Build Insights **Functions** view to troubleshoot the impact of function inlining on build time in your C++ projects.
+
+## Prerequisites
+
+- Visual Studio 2022 17.8 or greater.
+- C++ Build insights is enabled by default if you install either the Desktop development with C++ workload or the Game development with C++ workload.
+
+:::image type="complex" source="./media/installer-desktop-cpp-build-insights.png" alt-text="Screenshot of the Visual Studio Installer with the Desktop development with C++ workload selected.":::
+The list of installed components is shown. C++ Build Insights is highlighted and is selected which means it's installed.
+:::image-end:::
+
+:::image type="complex" source="./media/installer-gamedev-cpp-build-insights.png" alt-text="Screenshot of the Visual Studio Installer with the Game development with C++ workload selected.":::
+The list of installed components is shown. C++ Build Insights is highlighted and is selected which means it's installed.
+:::image-end:::
+
+## Overview
+
+Build Insights, now integrated into Visual Studio, helps you optimize your build times--especially for large projects like AAA games. Build Insights provides analytics such as **Functions** view, which helps diagnose expensive code generation during build time. It displays the time it takes to generate code for each function, and shows the impact of [`__forceinline`](../../cpp/inline-functions-cpp.md#inline-__inline-and-__forceinline).
+
+The `__forceinline` directive tells the compiler to inline a function regardless of its size or complexity. Inlining a function can improve runtime performance by reducing the overhead of calling the function. The tradeoff is that it can increase the size of the binary and impact your build times.
+
+For optimized builds, the time spent generating code contributes significantly to the total build time. In general, C++ function optimization happens quickly. In exceptional cases, some functions can become large enough and complex enough to put pressure on the optimizer and noticeably slow down your builds.
+
+In this article, learn how to use the Build Insights **Functions** view to find inlining bottlenecks in your build.
+
+## Set build options
+
+To measure the results of `__forceinline`, use a **Release** build because debug builds don't inline `__forceinline` since debug builds use the [`/Ob0`](../../build/reference/ob-inline-function-expansion.md) compiler switch, which disables that optimization. Set the build for **Release** and **x64**:
+
+1. In the **Solution Configurations** dropdown, choose **Release**.
+1. In the **Solution Platforms** dropdown, choose **x64**.
+
+:::image type="content" source="./media/build-options-release.png" alt-text="Screenshot of the Solution Configuration dropdown set to Release, and the Solution Platform dropdown set to x64.":::
+
+Set the optimization level to maximum optimizations:
+
+1. In the **Solution Explorer**, right-click the project name and select **Properties**.
+1. In the project properties, navigate to **C/C++** > **Optimization**.
+1. Set the **Optimization** dropdown to **Maximum Optimization (Favor Speed) ([`/O2`](../../build/reference/ob-inline-function-expansion.md))**.
+
+ :::image type="content" source="./media/max-optimization-setting.png" alt-text="Screenshot of the project property pages dialog. The settings are open to Configuration Properties > C/C++ > Optimization. The Optimization dropdown is set to Maximum Optimization (Favor Speed) (/O2).":::
+
+1. Click **OK** to close the dialog.
+
+## Run Build Insights
+
+On a project of your choosing, and using the **Release** build options set in the previous section, run Build Insights by choosing from the main menu **Build** > **Run Build Insights on Selection** > **Rebuild**. You can also right-click a project in the solution explorer and choose **Run Build Insights** > **Rebuild**. Choose **Rebuild** instead of **Build** to measure the build time for the entire project and not for just the few files may be dirty right now.
+
+:::image type="content" source="./media/build-insights-rebuild-project.png" alt-text="Screenshot of the main menu with Run Build Insights on Selection > Rebuild selected.":::
+
+When the build finishes, an Event Trace Log (ETL) file opens. It's saved in the folder pointed to by the Windows `TEMP` environment variable. The generated name is based on the collection time.
+
+## Function view
+
+In the window for the ETL file, choose the **Functions** tab. It shows the functions that were compiled and the time it took to generate the code for each function. If the amount of code generated for a function is negligible, it won't appear in the list to avoid degrading build event collection performance.
+
+:::image type="complex" source="./media/functions-view-before-fix.png" alt-text="Screenshot of the Build Insights Functions view file.":::
+In the Function Name column, performPhysicsCalculations() is highlighted and marked with a fire icon.
+:::image-end:::
+
+The **Time [sec, %]** column shows how long it took to compile each function in [wall clock responsibility time (WCTR)](https://devblogs.microsoft.com/cppblog/faster-cpp-builds-simplified-a-new-metric-for-time/#:~:text=Today%2C%20we%E2%80%99d%20like%20to%20teach%20you%20about%20a,your%20build%2C%20even%20in%20the%20presence%20of%20parallelism). This metric distributes the wall clock time among functions based on their use of parallel compiler threads. For example, if two different threads are compiling two different functions simultaneously within a one-second period, each function's WCTR is recorded as 0.5 seconds. This reflects each function's proportional share of the total compilation time, taking into account the resources each consumed during parallel execution. Thus, WCTR provides a better measure of the impact each function has on the overall build time in environments where multiple compilation activities occur simultaneously.
+
+The **Forceinline Size** column shows roughly how many instructions were generated for the function. Click the chevron before the function name to see the individual inlined functions that were expanded in that function how roughly how many instructions were generated for each.
+
+You can sort the list by clicking on the **Time** column to see which functions are taking the most time to compile. A 'fire' icon indicates that cost of generating that function is high and is worth investigating. Excessive use of `__forceinline` functions can significantly slow compilation.
+
+You can search for a specific function by using the **Filter Functions** box. If a function's code generation time is too small, it doesn't appear in the **Functions** View.
+
+## Improve build time by adjusting function inlining
+
+In this example, the `performPhysicsCalculations` function is taking the most time to compile.
+
+:::image type="complex" source="./media/functions-view-before-fix.png" alt-text="Screenshot of the Build Insights Functions view.":::
+In the Function Name column, performPhysicsCalculations() is highlighted and marked with a fire icon.
+:::image-end:::
+
+Investigating further, by selecting the chevron before that function, and then sorting the **Forceinline Size** column from highest to lowest, we see the biggest contributors to the problem.
+
+:::image type="complex" source="./media/functions-view-expanded.png" alt-text="Screenshot of the Build Insights Functions view with an expanded function.":::
+performPhysicsCalculations() is expanded and shows a long list of functions that were inlined inside it. There are multiple instances of functions such as complexOperation(), recursiveHelper(), and sin() shown. The Forceinline Size column shows that complexOperation() is the largest inlined function at 315 instructions. recursiveHelper() has 119 instructions. Sin() has 75 instructions, but there are many more instances of it than the other functions.
+:::image-end:::
+
+There are some larger inlined functions, such as `Vector2D::complexOperation()` and `Vector2D::recursiveHelper()` that are contributing to the problem. But there are many more instances (not all shown here) of `Vector2d::sin(float)`, `Vector2d::cos(float)`, `Vector2D::power(float,int)`, and `Vector2D::factorial(int)`. When you add those up, the total number of generated instructions quickly exceeds the few larger generated functions.
+
+Looking at those functions in the source code, we see that execution time is going to be spent inside loops. For example, here's the code for `factorial()`:
+
+```cpp
+static __forceinline T factorial(int n)
+{
+ T result = 1;
+ for (int i = 1; i <= n; ++i) {
+ for (int j = 0; j < i; ++j) {
+ result *= (i - j) / (T)(j + 1);
+ }
+ }
+ return result;
+}
+```
+
+Perhaps the overall cost of calling this function is insignificant compared to the cost of the function itself. Making a function inline is most beneficial when the time it takes to call the function (pushing arguments on the stack, jumping to the function, popping return arguments, and returning from the function) is roughly similar to the time it takes to execute the function, and when the function is called a lot. When that's not the case, there may be diminishing returns on making it inline. We can try removing the `__forceinline` directive from it to see if it helps the build time. The code for `power`, `sin()` and `cos()` is similar in that the code consists of a loop that will execute many times. We can try removing the `__forceinline` directive from those functions as well.
+
+We rerun Build Insights from the main menu by choosing **Build** > **Run Build Insights on Selection** > **Rebuild**. You can also right-click a project in the solution explorer and choose **Run Build Insights** > **Rebuild**. We choose **Rebuild** instead of **Build** to measure the build time for the entire project, as before, and not for just the few files may be dirty right now.
+
+The build time goes from 25.181 seconds to 13.376 seconds and the `performPhysicsCalculations` function doesn't show up anymore in the **Functions** view because it doesn't contribute enough to the build time to be counted.
+
+:::image type="complex" source="./media/functions-view-after-fix.png" alt-text="Screenshot of the 2D vector header file.":::
+In the Function Name column, performPhysicsCalculations() is highlighted and marked with a fire icon.
+:::image-end:::
+
+The Diagnostics Session time is the overall time it took do the build plus any overhead for gathering the Build Insights data.
+
+The next step would be to profile the application to see if the performance of the application is negatively impacted by the change. If it is, we can selectively add `__forceinline` back as needed.
+
+## Navigate to the source code
+
+Double-click, right-click, or press **Enter** while on a file in the **Functions** view to open the source code for that file.
+
+:::image type="content" source="./media/functions-view-goto-file.png" alt-text="Screenshot of a right-click on a file in the Functions view. The menu option Go To Source File is highlighted.":::
+
+## Tips
+
+- You can **File** > **Save As** the ETL file to a more permanent location to keep a record of the build time. You can then compare it to future builds to see if your changes are improving build time.
+- If you inadvertently close the Build Insights window, reopen it by finding the `.etl` file in your temporary folder. The `TEMP` Windows environment variable provides the path of your temporary files folder.
+- To dig into the Build Insights data with Windows Performance Analyzer (WPA), click the **Open in WPA** button in the bottom right of the ETL window.
+- Drag columns to change the order of the columns. For instance, you may prefer moving the **Time** column to be the first column. You can hide columns by right-clicking on the column header and deselecting the columns you don't want to see.
+- The **Functions** view provides a filter box to find a function that you're interested in. It does partial matches on the name you provide.
+- If you forget how to interpret what the **Functions** view is trying to show you, hover over the tab to see a tooltip that describes the view. If you hover over the **Functions** tab, the tooltip says: "View that shows statistics for functions where the children nodes are force-inlined functions."
+
+## Troubleshooting
+
+- If the Build Insights window doesn't appear, do a rebuild instead of a build. The Build Insights window doesn't appear if nothing actually builds; which may be the case if no files changed since the last build.
+- If the Functions view doesn't show any functions, you may not be building with the right optimization settings. Ensure that you're building Release with full optimizations, as described in [Set build options](#set-build-options). Also, if a function's code generation time is too small, it doesn't appear in the list.
+
+## See also
+
+[Build Insights tips and tricks](build-insights-tips.md)\
+[Inline functions (C++)](../../cpp/inline-functions-cpp.md)\
+[Faster C++ builds, simplified: a new metric for time](https://devblogs.microsoft.com/cppblog/faster-cpp-builds-simplified-a-new-metric-for-time)\
+[Build Insights in Visual Studio video - Pure Virtual C++ 2023](/events/pure-virtual-cpp-2023/build-insights-in-visual-studio)\
+[Troubleshoot header file impact on build time](build-insights-included-files-view.md)\
+[Functions View for Build Insights in Visual Studio 2022 17.8](https://devblogs.microsoft.com/cppblog/functions-view-for-build-insights-in-visual-studio-2022-17-8/)\
+[Tutorial: vcperf and Windows Performance Analyzer](vcperf-and-wpa.md)\
+[Improving code generation time with C++ Build Insights](https://devblogs.microsoft.com/cppblog/improving-code-generation-time-with-cpp-build-insights)
diff --git a/docs/build-insights/tutorials/build-insights-included-files-view.md b/docs/build-insights/tutorials/build-insights-included-files-view.md
new file mode 100644
index 0000000000..3563f96d71
--- /dev/null
+++ b/docs/build-insights/tutorials/build-insights-included-files-view.md
@@ -0,0 +1,188 @@
+---
+title: "Troubleshoot header file impact on build time"
+description: "Tutorial on how to use Build Insights Includes Files and Includes Tree views to troubleshoot the impact of #include files on build time."
+ms.date: 5/30/2024
+helpviewer_keywords: ["C++ Build Insights", "header file build time", "included files view", "include tree view", "#include analysis", "build time analysis"]
+---
+# Troubleshoot header file impact on build time
+
+Use Build Insights **Included Files** and **Include Tree** views to troubleshoot the impact of `#include` files on C and C++ build times.
+
+## Prerequisites
+
+- Visual Studio 2022 17.8 or greater.
+- C++ Build Insights is enabled by default if you install either the Desktop development with C++ workload using the Visual Studio installer:
+
+:::image type="complex" source="./media/installer-desktop-cpp-build-insights.png" alt-text="Screenshot of the Visual Studio Installer with the Desktop development with C++ workload selected.":::
+The list of installed components is shown. C++ Build Insights is highlighted and is selected which means it's installed.
+:::image-end:::
+
+Or the Game development with C++ workload:
+
+:::image type="complex" source="./media/installer-gamedev-cpp-build-insights.png" alt-text="Screenshot of the Visual Studio Installer with the Game development with C++ workload selected.":::
+The list of installed components is shown. C++ Build Insights is highlighted and is selected which means it's installed.
+:::image-end:::
+
+## Overview
+
+Build Insights, now integrated into Visual Studio, helps you optimize your build times--especially for large projects like triple-A games. When a large header file is parsed, and especially when it's repeatedly parsed, there's an impact on build time.
+
+Build Insights provides analytics in the **Included Files** view, which helps diagnose the impact of parsing `#include` files in your project. It displays the time it takes to parse each header file and a view of the relationships between header files.
+
+In this article, learn how to use the Build Insights **Included Files** and **Include Tree** views to identify the most expensive header files to parse and how to optimize build time by creating a precompiled header file.
+
+## Set build options
+
+Before gathering Build Insights data, set the build options for the type of build you want to measure. For example, if you're concerned about your x64 debug build time, set the build for **Debug** and **x64**:
+
+- In the **Solution Configurations** dropdown, choose **Debug**.
+- In the **Solution Platforms** dropdown, choose **x64**.
+
+ :::image type="complex" source="./media/build-options-debug.png" alt-text="Screenshot of the Solution Configuration dropdowns.":::
+ The Solution Configuration dropdown is shown. It has options for Debug, Release, and Configuration manager. The Solution Platform dropdown is set to x64.
+ :::image-end:::
+
+## Run Build Insights
+
+On a project of your choosing, and using the **Debug** build options set in the previous section, run Build Insights by choosing from the main menu **Build** > **Run Build Insights on \** > **Rebuild**. You can also right-click a project in the solution explorer and choose **Run Build Insights** > **Rebuild**. Choose **Rebuild** instead of **Build** to measure the build time for the entire project and not for just the few files may be dirty right now.
+
+:::image type="content" source="./media/build-insights-rebuild-project.png" alt-text="Screenshot of the main menu with Run Build Insights on Selection > Rebuild selected.":::
+
+When the build finishes, an Event Trace Log (ETL) file opens. It's saved in the folder pointed to by the Windows `TEMP` environment variable. The generated name is based on the collection time.
+
+## Included Files view
+
+The trace file shows the build time--which for this example was 16.404 seconds. The **Diagnostics Session** is the overall time taken to run the Build Insights session. Choose the **Included Files** tab.
+
+This view shows the time spent processing `#include` files.
+
+:::image type="complex" source="./media/included-files-before-fix.png" alt-text="Screenshot of the included files view.":::
+In the file path column, several files with a fire icon are highlighted because they take over 10% of the build time to parse. winrtHeaders.h is the biggest one at 8.581 seconds or 52.3% of the 16.404-second build time.
+:::image-end:::
+
+In the **File Path** column, some files have a fire icon next to them to indicate that they take up 10% or more of the build time.
+
+The **Time [sec, %]** column shows how long it took to compile each function in [wall clock responsibility time (WCTR)](https://devblogs.microsoft.com/cppblog/faster-cpp-builds-simplified-a-new-metric-for-time/#:~:text=Today%2C%20we%E2%80%99d%20like%20to%20teach%20you%20about%20a,your%20build%2C%20even%20in%20the%20presence%20of%20parallelism). This metric distributes the wall clock time it takes to parse files based on their use of parallel threads. For example, if two different threads are parsing two different files simultaneously within a one-second period, each file's WCTR is recorded as 0.5 seconds. This reflects each file's proportional share of the total compilation time, taking into account the resources each consumed during parallel execution. Thus, WCTR provides a better measure of the impact each file has on the overall build time in environments where multiple compilation activities occur simultaneously.
+
+The **Parse Count** column shows how many time the header file was parsed.
+
+The first header file highlighted in this list is `winrtHeaders.h` It takes 8.581 seconds of the overall 16.404-second build time, or 52.3% of the build time. The next most expensive is `Windows.UI.Xaml.Interop.h`, and then `Windows.Xaml.h`.
+
+To see which file includes `winrtHeaders.h`, click the chevron next to it. The **Parse Count** column can be helpful by pointing out how many times a header file is included by other files. Perhaps a header file is included multiple times, which could be a sign that it's a good candidate for a precompiled header file or refactoring.
+
+The **Translation Unit** column shows which file was being processed when the included file was processed. In this example, `winrtHeaders.h` was included while `Grapher.cpp` was compiled:
+
+:::image type="complex" source="./media/included-files-translation-unit.png" alt-text="Screenshot of the Included Files view.":::
+An example ETL file showing the includes files for a sample project. In the file path column, winrtHeaders.h is selected and expanded. It takes 8.219 seconds to build which is 50.1% of the build time. Its child node is Grapher.cpp, which is also listed as the translation unit."
+:::image-end:::
+
+The translation unit column can help disambiguate which file was being compiled in cases where a header file is included many times and you want to find out where that happens the most.
+
+We know that `winrtHeaders.h` is expensive to parse, but we can learn more.
+
+## Include Tree view
+
+In this view, the children nodes are the files included by the parent node. This can help you understand the relationships between header files and identify opportunities to reduce the number of times a header file is parsed.
+
+Select the **Include Tree** tab in the ETL file to see the Include Tree view:
+
+:::image type="complex" source="./media/include-tree-view.png" alt-text="Screenshot of the Include Tree view.":::
+Shows the include tree for a project. In the file path column, each file that includes other files is listed, along with how many files it includes and the time to parse it.
+:::image-end:::
+
+In this view, the **File Path** column shows each file that includes other files. The **Include Count** lists how many files this header file includes. The time to parse this file is listed, and when expanded, lists the time to parse each individual header file that this header file includes.
+
+Earlier, we saw that parsing `winrtHeaders.h` is time consuming. In the **Filter Files** text box, if we enter `winrtHeaders.h`, we can filter the view to only the entries that contain `winrtHeaders.h` in the name. Clicking the chevron next to `winrtHeaders.h` shows which files it includes:
+
+:::image type="complex" source="./media/include-tree-view-expanded.png" alt-text="Screenshot of the expanded Include Tree view.":::
+The file path column lists each file that includes other files, along with how many files it includes and the time it took to parse it. winrtHeaders.h is selected and expanded to show the files it includes. Windows.UI.Xaml.Interop.h is one of those files and is expanded to show Windows.UI.Xaml.Interop.h that is expanded to show the header files it includes.
+:::image-end:::
+
+We see that `winrtHeaders.h` includes `Windows.UI.Xaml.Interop.h`. Remember from the **Included Files** view that this was also time consuming to parse. Click the chevron next to `Windows.UI.Xaml.Interop.h` to see that it includes `Windows.UI.Xaml.h`, which includes 21 other header files, two of which are also on the hot list.
+
+Having identified some of the most expensive header files to parse, and seeing that `winrtHeaders.h` is responsible for bringing them in, suggests that we can use a precompiled header to make including `winrtHeaders.h` faster.
+
+## Improve build time with precompiled headers
+
+Because we know from the **Included Files** view that `winrtHeaders.h` is time consuming to parse, and because we know from the **Include Tree** view that `winrtHeaders.h` includes several other header files that are time consuming to parse, we build a [Precompiled header file](../../build/creating-precompiled-header-files.md) (PCH) to speed that up by only parsing them once into a PCH.
+
+We add a `pch.h` to include `winrtHeaders.h`, which would look like this:
+
+```cpp
+#ifndef CALC_PCH
+#define CALC_PCH
+
+#include
+
+#endif // CALC_PCH
+```
+
+PCH files must be compiled before they can be used, so we add a file to the project, arbitrarily named `pch.cpp`, that includes `pch.h`. It contains one line:
+
+```cpp
+#include "pch.h"
+```
+
+Then we set our project to use the PCH. That's done in project properties via **C/C++** > **Precompiled Headers** and setting **Precompiled Header** to **Use (/Yu)** and **Precompiled Header File** to **pch.h**.
+
+:::image type="complex" source="./media/precompiled-header-settings.png" alt-text="Screenshot of the project properties dialog with the Precompiled Headers settings open.":::
+Precompiled Header is set to: Use (/Yu). The Precompiled Header File is set to pch.h.
+:::image-end:::
+
+To use the PCH, we include it as the first line in the source files that use `winrtHeaders.h`. It must come before any other include files. Or, for simplicity, we could modify the project properties to include `pch.h` at the beginning of every file in the solution by setting the project property: **C/C++** > **Advanced** > **Forced Include File** to `pch.h`:
+
+:::image type="complex" source="./media/precompiled-header-settings-force-include.png" alt-text="Screenshot of the project properties dialog with the Advanced settings open.":::
+Forced Include File is set to pch.h.
+:::image-end:::
+
+Since the PCH includes `winrtHeaders.h`, we could remove `winrtHeaders.h` from all the files that currently include it. It's not strictly necessary because the compiler realizes that `winrtHeaders.h` is already included and doesn't parse it again. Some developers prefer to keep the `#include` in the source file for clarity, or in case the PCH is likely to be refactored and may not include that header file anymore.
+
+## Test the changes
+
+We first clean the project to make sure we're comparing building the same files as before. To clean just one project, right-click the project in the **Solution Explorer** and choose **Project only** > **Clean only \**.
+
+Because this project now uses a precompiled header (PCH), we don't want to measure the time spent building the PCH because that only happens once. We do this by loading the `pch.cpp` file and choosing **Ctrl+F7** to build just that file. We could also compile this file by right-clicking `pch.cpp` in the Solution Explorer and choosing `Compile`.
+
+Now we rerun Build Insights in the **Solution Explorer** by right-clicking the project and choosing **Project Only** > **Run Build Insights on Build**. You can also right-click a project in the solution explorer and choose **Run Build Insights** > **Build**. We don't want **Rebuild** this time because that will rebuild the PCH, which we don't want to measure. We cleaned the project earlier, which means that a normal build compiles all the project files we want to measure.
+
+When the ETL files appear, we see that build time went from 16.404 seconds to 6.615 seconds. Put `winrtHeaders.h` into the filter box and nothing appears. This is because the time spent parsing it is now negligible since it's being pulled in by the precompiled header.
+
+:::image type="content" source="./media/included-files-after-fix.png" alt-text="Screenshot of the Include Tree pane in the trace file. winrtHeaders is no longer listed.":::
+
+This example uses precompiled headers because they're a common solution before C++20. However, starting with C++20, there are other, faster, less brittle, ways to include header files--such as header units and modules. For more information, see [Compare header units, modules, and precompiled headers](../../build/compare-inclusion-methods.md).
+
+## Navigate between views
+
+There are some navigation features for both the **Included Files** and **Include Tree** views:
+
+- Double-click a file (or press **Enter**) in either the **Included Files** or **Include Tree** to open the source code for that file.
+- Right-click on a header file to find that file in the other view. For example, in the **Included File**s view, right-click on `winrtHeaders.h` and choose **Find in Include Tree** to see it in the **Include Tree** view.
+
+:::image type="content" source="./media/included-files-show-in-include-tree.png" alt-text="Screenshot of a right-click on a file in the Included Files view. The menu option Show in Include Tree View is highlighted.":::
+
+Or, you can right-click a file in the **Include Tree** view to jump to it in the **Included Files** view.
+
+## Tips
+
+- You can **File** > **Save As** the ETL file to a more permanent location to keep a record of the build time. You can then compare it to future builds to see if your changes are improving build time.
+- If you inadvertently close the Build Insights window, reopen it by finding the `.etl` file in your temporary folder. The `TEMP` Windows environment variable provides the path of your temporary files folder.
+- To dig into the Build Insights data with Windows Performance Analyzer (WPA), click the **Open in WPA** button in the bottom right of the ETL window.
+- Drag columns to change the order of the columns. For instance, you may prefer moving the **Time** column to be the first column. You can hide columns by right-clicking on the column header and deselecting the columns you don't want to see.
+- The **Included Files** and **Include Tree** views provide a filter box to find a header file that you're interested in. It does partial matches on the name you provide.
+- Sometimes the parse time reported for a header file is different depending on which file includes it. This can be due to the interplay of different `#define`s that affect which parts of the header are expanded, file caching, and other system factors.
+- If you forget what the **Included Files** or **Include Tree** view is trying to show you, hover over the tab to see a tooltip that describes the view. For example, if you hover over the **Include Tree** tab, the tooltip says: "View that shows include statistics for every file where the children nodes are the files included by the parent node."
+- You may see cases (like `Windows.h`) where the aggregated duration of all the times for a header file is longer than the duration of the entire build. What's happening is that headers are being parsed on multiple threads at the same time. If two threads simultaneously spend one second parsing a header file, that's 2 seconds of build time even though only one second of wall clock time has gone by. For more information, see [wall clock responsibility time (WCTR)](https://devblogs.microsoft.com/cppblog/faster-cpp-builds-simplified-a-new-metric-for-time/#:~:text=Today%2C%20we%E2%80%99d%20like%20to%20teach%20you%20about%20a,your%20build%2C%20even%20in%20the%20presence%20of%20parallelism).
+
+## Troubleshooting
+
+- If the Build Insights window doesn't appear, do a rebuild instead of a build. The Build Insights window doesn't appear if nothing actually builds; which may be the case if no files changed since the last build.
+- If a header file you're interested in doesn't appear in the **Included Files** or **Include Tree** views, it either didn't build or its build time isn't significant enough to be listed.
+
+## See also
+
+[Build Insights tips and tricks](build-insights-tips.md)\
+[Compare header units, modules, and precompiled headers](../../build/compare-inclusion-methods.md)\
+[Build Insights in Visual Studio video - Pure Virtual C++ 2023](/events/pure-virtual-cpp-2023/build-insights-in-visual-studio)\
+[Faster C++ builds, simplified: a new metric for time](https://devblogs.microsoft.com/cppblog/faster-cpp-builds-simplified-a-new-metric-for-time)\
+[Troubleshoot function inlining on build time](build-insights-function-view.md)\
+[vcperf and Windows Performance Analyzer](vcperf-and-wpa.md)
\ No newline at end of file
diff --git a/docs/build-insights/tutorials/build-insights-tips.md b/docs/build-insights/tutorials/build-insights-tips.md
new file mode 100644
index 0000000000..d071aaddda
--- /dev/null
+++ b/docs/build-insights/tutorials/build-insights-tips.md
@@ -0,0 +1,79 @@
+---
+title: "Build Insights tips and tricks"
+description: "Learn time-saving tips for using Build Insights."
+ms.date: 1/8/2025
+author: tylermsft
+ms.author: twhitney
+ms.topic: article
+helpviewer_keywords: ["C++ Build Insights tips and tricks"]
+---
+# Build Insights tips and tricks
+
+Learn time-saving tips for using Build Insights.
+
+## Run Build Insights on selected files
+
+This feature requires Visual Studio 2022 17.12 or later.
+
+If you're working on a specific file or files, and want to see how they impact your build time, you can run Build Insights on just those files. This feature is useful when you want to focus on a subset of files in your project.
+
+To try it, in **Solution Explorer** select the files in your project you want to profile, right-click, and choose **Run Build Insights on Selected Files**:
+
+ :::image type="content" source="./media/build-insights-run-on-selected-files.png" alt-text="A screenshot of files in the Solution Explorer. The context menu is open and the option to Run Build Insights on Selected Files is highlighted.":::
+
+## Filter Build Insights results
+
+This feature requires Visual Studio 2022 17.12 or later.
+
+If you have a large solution with many projects, you can filter the Build Insights results to see files only the projects you're interested in. This feature is useful when you want to focus on a subset of projects in your solution.
+
+To try it, click the filter button on the filter column header and select the projects you want to see results for:
+
+ :::image type="complex" source="./media/build-insights-filter-by-project.png" alt-text="A screenshot of the Build Insights window with the Included Files tab open.":::
+ The filter button is selected and a list of projects appears. Checkboxes next to two projects are checked.
+ :::image-end:::
+
+You can also use file wildcards to filter results. The search is case-insensitive and you should use forward slashes (`/`) as path separators:
+
+ :::image type="content" source="./media/build-insights-glob-filter.png" alt-text="A screenshot of the build insights filter dialog. There's a files to include text box and a files to exclude text box.":::
+
+This allows you to exclude files from a specific folder or only include files from a specific folder. For example, if your source is located at `C:\src\`, you could include files only from the renderer directory and its subdirectories by putting `C:/src/dev/renderer/**` into the **files to include** text box. Use forward slashes (`/`) as path separators.
+
+Here are some other examples:
+
+- All files in the renderer directory: `C:/src/dev/renderer/*`
+- All files in the `C:/src/dev/renderer/` directory *and all its subdirectories*: `C:/src/dev/renderer/**`
+- All header files in the `C:/src/dev/renderer/` directory *and all its subdirectories*: `C:/src/dev/renderer/**/*.h`
+
+For more examples, see the [online glob pattern tester](https://globster.xyz/).
+
+The filter you enter into either text box persists per solution. Filtering by wildcards isn't supported for CMAKE projects.
+
+## Save Build Insights reports to a designated folder
+
+This feature requires Visual Studio 2022 17.12 or later.
+
+Now you can designate a folder to automatically save Build Insight reports to so you can easily access them.
+
+To set the designated folder, go to **Tools** > **Options** > **C++ Build Insights** > **Trace Collection**. Set a path in the **Store Build Insights reports in this directory** textbox:
+
+ :::image type="complex" source="./media/build-insights-reports-directory.png" alt-text="A screenshot of the options window.":::
+ In the left pane, Build Insights > Trace Collection is selected. In the collection settings, the checkbox for Store Build Insights reports in this directory is selected, and the directory text box contains the path c:\users\contoso\workspace as an example.
+ :::image-end:::
+
+Reports are automatically saved to this folder when you run Build Insights. If a path isn't set, the `TEMP` folder is used.
+
+## Get help about the Build Insight window
+
+This feature requires Visual Studio 2022 17.12 or later.
+
+To see a short description for the tabs in the Build Insights window, along with a link to the documentation for a detailed explanation, click the question mark icon in the Build Insights window:
+
+ :::image type="content" source="./media/build-insights-view-explanations.png" alt-text="A screenshot of the Build Insights window with the view explanations button (a question mark in a circle) highlighted.":::
+
+## See also
+
+[Build Insights in Visual Studio video - Pure Virtual C++ 2023](/events/pure-virtual-cpp-2023/build-insights-in-visual-studio)\
+[Improving code generation time with C++ Build Insights](https://devblogs.microsoft.com/cppblog/improving-code-generation-time-with-cpp-build-insights)\
+[Troubleshoot header file impact on build time](build-insights-included-files-view.md)\
+[Tutorial: Troubleshoot function inlining on build time](build-insights-function-view.md)
diff --git a/docs/build-insights/tutorials/media/build-insights-filter-by-project.png b/docs/build-insights/tutorials/media/build-insights-filter-by-project.png
new file mode 100644
index 0000000000..4a2f902081
Binary files /dev/null and b/docs/build-insights/tutorials/media/build-insights-filter-by-project.png differ
diff --git a/docs/build-insights/tutorials/media/build-insights-glob-filter.png b/docs/build-insights/tutorials/media/build-insights-glob-filter.png
new file mode 100644
index 0000000000..98395c240f
Binary files /dev/null and b/docs/build-insights/tutorials/media/build-insights-glob-filter.png differ
diff --git a/docs/build-insights/tutorials/media/build-insights-rebuild-project.png b/docs/build-insights/tutorials/media/build-insights-rebuild-project.png
new file mode 100644
index 0000000000..63ceed7705
Binary files /dev/null and b/docs/build-insights/tutorials/media/build-insights-rebuild-project.png differ
diff --git a/docs/build-insights/tutorials/media/build-insights-reports-directory.png b/docs/build-insights/tutorials/media/build-insights-reports-directory.png
new file mode 100644
index 0000000000..e9c751814f
Binary files /dev/null and b/docs/build-insights/tutorials/media/build-insights-reports-directory.png differ
diff --git a/docs/build-insights/tutorials/media/build-insights-run-on-selected-files.png b/docs/build-insights/tutorials/media/build-insights-run-on-selected-files.png
new file mode 100644
index 0000000000..1a5c0f8556
Binary files /dev/null and b/docs/build-insights/tutorials/media/build-insights-run-on-selected-files.png differ
diff --git a/docs/build-insights/tutorials/media/build-insights-view-explanations.png b/docs/build-insights/tutorials/media/build-insights-view-explanations.png
new file mode 100644
index 0000000000..3b33e677bc
Binary files /dev/null and b/docs/build-insights/tutorials/media/build-insights-view-explanations.png differ
diff --git a/docs/build-insights/tutorials/media/build-options-debug.png b/docs/build-insights/tutorials/media/build-options-debug.png
new file mode 100644
index 0000000000..156abb7646
Binary files /dev/null and b/docs/build-insights/tutorials/media/build-options-debug.png differ
diff --git a/docs/build-insights/tutorials/media/build-options-release.png b/docs/build-insights/tutorials/media/build-options-release.png
new file mode 100644
index 0000000000..2fe4589daf
Binary files /dev/null and b/docs/build-insights/tutorials/media/build-options-release.png differ
diff --git a/docs/build-insights/tutorials/media/functions-view-after-fix.png b/docs/build-insights/tutorials/media/functions-view-after-fix.png
new file mode 100644
index 0000000000..9df70ef0b9
Binary files /dev/null and b/docs/build-insights/tutorials/media/functions-view-after-fix.png differ
diff --git a/docs/build-insights/tutorials/media/functions-view-before-fix.png b/docs/build-insights/tutorials/media/functions-view-before-fix.png
new file mode 100644
index 0000000000..109d81e391
Binary files /dev/null and b/docs/build-insights/tutorials/media/functions-view-before-fix.png differ
diff --git a/docs/build-insights/tutorials/media/functions-view-expanded.png b/docs/build-insights/tutorials/media/functions-view-expanded.png
new file mode 100644
index 0000000000..9f0483a4cf
Binary files /dev/null and b/docs/build-insights/tutorials/media/functions-view-expanded.png differ
diff --git a/docs/build-insights/tutorials/media/functions-view-goto-file.png b/docs/build-insights/tutorials/media/functions-view-goto-file.png
new file mode 100644
index 0000000000..378c335781
Binary files /dev/null and b/docs/build-insights/tutorials/media/functions-view-goto-file.png differ
diff --git a/docs/build-insights/tutorials/media/include-tree-view-expanded.png b/docs/build-insights/tutorials/media/include-tree-view-expanded.png
new file mode 100644
index 0000000000..d011bb41ee
Binary files /dev/null and b/docs/build-insights/tutorials/media/include-tree-view-expanded.png differ
diff --git a/docs/build-insights/tutorials/media/include-tree-view.png b/docs/build-insights/tutorials/media/include-tree-view.png
new file mode 100644
index 0000000000..629ad3f125
Binary files /dev/null and b/docs/build-insights/tutorials/media/include-tree-view.png differ
diff --git a/docs/build-insights/tutorials/media/included-files-after-fix.png b/docs/build-insights/tutorials/media/included-files-after-fix.png
new file mode 100644
index 0000000000..42691ef4b6
Binary files /dev/null and b/docs/build-insights/tutorials/media/included-files-after-fix.png differ
diff --git a/docs/build-insights/tutorials/media/included-files-before-fix.png b/docs/build-insights/tutorials/media/included-files-before-fix.png
new file mode 100644
index 0000000000..e4eee66cf0
Binary files /dev/null and b/docs/build-insights/tutorials/media/included-files-before-fix.png differ
diff --git a/docs/build-insights/tutorials/media/included-files-show-in-include-tree.png b/docs/build-insights/tutorials/media/included-files-show-in-include-tree.png
new file mode 100644
index 0000000000..75df957eb5
Binary files /dev/null and b/docs/build-insights/tutorials/media/included-files-show-in-include-tree.png differ
diff --git a/docs/build-insights/tutorials/media/included-files-translation-unit.png b/docs/build-insights/tutorials/media/included-files-translation-unit.png
new file mode 100644
index 0000000000..65ad65bcaa
Binary files /dev/null and b/docs/build-insights/tutorials/media/included-files-translation-unit.png differ
diff --git a/docs/build-insights/tutorials/media/installer-desktop-cpp-build-insights.png b/docs/build-insights/tutorials/media/installer-desktop-cpp-build-insights.png
new file mode 100644
index 0000000000..152ce06514
Binary files /dev/null and b/docs/build-insights/tutorials/media/installer-desktop-cpp-build-insights.png differ
diff --git a/docs/build-insights/tutorials/media/installer-gamedev-cpp-build-insights.png b/docs/build-insights/tutorials/media/installer-gamedev-cpp-build-insights.png
new file mode 100644
index 0000000000..3eaa8c2df1
Binary files /dev/null and b/docs/build-insights/tutorials/media/installer-gamedev-cpp-build-insights.png differ
diff --git a/docs/build-insights/tutorials/media/max-optimization-setting.png b/docs/build-insights/tutorials/media/max-optimization-setting.png
new file mode 100644
index 0000000000..78510f0af3
Binary files /dev/null and b/docs/build-insights/tutorials/media/max-optimization-setting.png differ
diff --git a/docs/build-insights/tutorials/media/precompiled-header-settings-force-include.png b/docs/build-insights/tutorials/media/precompiled-header-settings-force-include.png
new file mode 100644
index 0000000000..f53b2faf6a
Binary files /dev/null and b/docs/build-insights/tutorials/media/precompiled-header-settings-force-include.png differ
diff --git a/docs/build-insights/tutorials/media/precompiled-header-settings.png b/docs/build-insights/tutorials/media/precompiled-header-settings.png
new file mode 100644
index 0000000000..4198430bce
Binary files /dev/null and b/docs/build-insights/tutorials/media/precompiled-header-settings.png differ
diff --git a/docs/build/adding-references-in-visual-cpp-projects.md b/docs/build/adding-references-in-visual-cpp-projects.md
index 9d03daa364..17676d6d6b 100644
--- a/docs/build/adding-references-in-visual-cpp-projects.md
+++ b/docs/build/adding-references-in-visual-cpp-projects.md
@@ -4,7 +4,6 @@ title: "Consuming libraries and components in C++ projects"
ms.date: 12/18/2020
f1_keywords: ["VC.Project.References"]
helpviewer_keywords: ["Add References Dialog Box (C++)", ".NET Framework (C++), Add References Dialog Box"]
-ms.assetid: 12b8f571-0f21-40b3-9404-5318a57e9cb5
---
# Consuming libraries and components
@@ -12,19 +11,23 @@ C++ projects often need to call functions or access data in a binary file such a
## Consuming libraries downloaded via vcpkg
-To consume a library that you have downloaded by using the **vcpkg** package manager, you can ignore the instructions below. See [vcpkg.io](https://vcpkg.io/) for more information.
+To consume a library that you have downloaded by using the **vcpkg** package manager, you can ignore the instructions below. For more information, see:
+- [vcpkg in CMake projects](/vcpkg/users/buildsystems/cmake-integration)
+- [Install and use packages with CMake in Visual Studio](/vcpkg/get_started/get-started-vs)
+- [vcpkg in MSBuild projects](/vcpkg/users/buildsystems/msbuild-integration)
+- [Tutorial: Install and use packages with MSBuild in Visual Studio](/vcpkg/get_started/get-started-msbuild)
## Consuming static libraries
If your static library project gets built in the same solution:
-1. #include the header file(s) for the static library using quotation marks. In a typical solution, the path starts with `../`. IntelliSense will help you find it.
+1. `#include` the header file(s) for the static library using quotation marks. In a typical solution, the path starts with `../`. IntelliSense will help you find it.
2. Add a reference to the static library project. Right-click on **References** under the application project node in **Solution Explorer** and choose **Add Reference**.
If the static library isn't part of the solution:
1. Right-click on the application project node in **Solution Explorer** and then choose **Properties**.
-2. In the **VC++ Directories** property page, add the path to the directory that contains the LIB file to **Library Paths**. Then, add the path to the library header file(s) to **Include Directories**.
+2. In the **VC++ Directories** property page, add the path to the directory that contains the LIB file to **Library Directories**. Then, add the path to the library header file(s) to **Include Directories**.
3. In the **Linker > Input** property page, add the name of the LIB file to **Additional Dependencies**.
## Dynamic link libraries
@@ -33,7 +36,7 @@ If the DLL gets built as part of the same solution as the application, follow th
If the DLL isn't part of the application solution, you need: the DLL file, the header(s) with prototypes for the exported functions and classes, and a LIB file that provides the necessary linking information.
-1. Copy the DLL to the output folder of your project, or to another folder in the standard Windows search path for DLLs. See [Dynamic-Link Library Search Order](/windows/win32/dlls/dynamic-link-library-search-order).
+1. Copy the DLL to the output folder of your project, or to another folder in the standard Windows search path for DLLs. For more information, see [Dynamic-Link Library Search Order](/windows/win32/dlls/dynamic-link-library-search-order).
2. Follow steps 1-3 for static libraries to provide the paths to the headers and LIB file.
## COM objects
@@ -158,5 +161,5 @@ The following properties exist on COM and .NET assembly references, and aren't m
## See also
-[C++ project property page reference](reference/property-pages-visual-cpp.md)
+[C++ project property page reference](reference/property-pages-visual-cpp.md)\
[Set C++ compiler and build properties in Visual Studio](working-with-project-properties.md)
diff --git a/docs/build/arm-exception-handling.md b/docs/build/arm-exception-handling.md
index 65c46a9b95..f2f9b9a13e 100644
--- a/docs/build/arm-exception-handling.md
+++ b/docs/build/arm-exception-handling.md
@@ -166,7 +166,7 @@ When the packed unwind format is insufficient to describe the unwinding of a fun
|0|20|*X* is a 1-bit field that indicates the presence (1) or absence (0) of exception data.|
|0|21|*`E`* is a 1-bit field that indicates that information that describes a single epilogue is packed into the header (1) rather than requiring additional scope words later (0).|
|0|22|*F* is a 1-bit field that indicates that this record describes a function fragment (1) or a full function (0). A fragment implies that there's no prologue and that all prologue processing should be ignored.|
- |0|23-27|*Epilogue Count* is a 5-bit field that has two meanings, depending on the state of the *`E`* bit:
- If *`E`* is 0, this field is a count of the total number of exception scopes described in section 3. If more than 31 scopes exist in the function, then this field and the *Code Words* field must both be set to 0 to indicate that an extension word is required.
- If *`E`* is 1, this field specifies the index of the first unwind code that describes the only epilogue.|
+ |0|23-27|*Epilogue Count* is a 5-bit field that has two meanings, depending on the state of the *`E`* bit:
- If *`E`* is 0, this field is a count of the total number of epilogue scopes described in section 2. If more than 31 scopes exist in the function, then this field and the *Code Words* field must both be set to 0 to indicate that an extension word is required.
- If *`E`* is 1, this field specifies the index of the first unwind code that describes the only epilogue.|
|0|28-31|*Code Words* is a 4-bit field that specifies the number of 32-bit words required to contain all of the unwind codes in section 4. If more than 15 words are required for more than 63 unwind code bytes, this field and the *Epilogue Count* field must both be set to 0 to indicate that an extension word is required.|
|1|0-15|*Extended Epilogue Count* is a 16-bit field that provides more space for encoding an unusually large number of epilogues. The extension word that contains this field is only present if the *Epilogue Count* and *Code Words* fields in the first header word are both set to 0.|
|1|16-23|*Extended Code Words* is an 8-bit field that provides more space for encoding an unusually large number of unwind code words. The extension word that contains this field is only present if the *Epilogue Count* and *Code Words* fields in the first header word are both set to 0.|
diff --git a/docs/build/arm64-exception-handling.md b/docs/build/arm64-exception-handling.md
index 2f6ce157a7..9bad5d2883 100644
--- a/docs/build/arm64-exception-handling.md
+++ b/docs/build/arm64-exception-handling.md
@@ -1,55 +1,55 @@
---
title: "ARM64 exception handling"
description: Describes the exception handling conventions and data used by windows on ARM64.
-ms.date: "11/19/2018"
+ms.date: 01/13/2023
---
# ARM64 exception handling
-Windows on ARM64 uses the same structured exception handling mechanism for asynchronous hardware-generated exceptions and synchronous software-generated exceptions. Language-specific exception handlers are built on top of Windows structured exception handling by using language helper functions. This document describes exception handling in Windows on ARM64, and the language helpers used by code that's generated by the Microsoft ARM assembler and the MSVC compiler.
+Windows on ARM64 uses the same structured exception handling mechanism for asynchronous hardware-generated exceptions and synchronous software-generated exceptions. Language-specific exception handlers are built on top of Windows structured exception handling by using language helper functions. This document describes exception handling in Windows on ARM64. It illustrates the language helpers used by code that's generated by the Microsoft ARM assembler and the MSVC compiler.
## Goals and motivation
The exception unwinding data conventions, and this description, are intended to:
-1. Provide enough description to allow unwinding without code probing in all cases.
+- Provide enough description to allow unwinding without code probing in all cases.
- - Analyzing the code requires the code to be paged in. This prevents unwinding in some circumstances where it's useful (tracing, sampling, debugging).
+ - Analyzing the code requires the code to be paged in. It prevents unwinding in some circumstances where it's useful (tracing, sampling, debugging).
- - Analyzing the code is complex; the compiler must be careful to only generate instructions that the unwinder can decode.
+ - Analyzing the code is complex; the compiler must be careful to only generate instructions that the unwinder can decode.
- - If unwinding can't be fully described through the use of unwind codes, then in some cases it must fall back to instruction decoding. This increases the overall complexity, and ideally should be avoided.
+ - If unwinding can't be fully described by using unwind codes, then in some cases it must fall back to instruction decoding. Instruction decoding increases the overall complexity, and ideally should be avoided.
-1. Support unwinding in mid-prolog and mid-epilog.
+- Support unwinding in mid-prolog and mid-epilog.
- - Unwinding is used in Windows for more than exception handling. It's critical that code can unwind accurately even when in the middle of a prolog or epilog code sequence.
+ - Unwinding is used in Windows for more than exception handling. It's critical that code can unwind accurately even when in the middle of a prolog or epilog code sequence.
-1. Take up a minimal amount of space.
+- Take up a minimal amount of space.
- - The unwind codes must not aggregate to significantly increase the binary size.
+ - The unwind codes must not aggregate to significantly increase the binary size.
- - Since the unwind codes are likely to be locked in memory, a small footprint ensures a minimal overhead for each loaded binary.
+ - Since the unwind codes are likely to be locked in memory, a small footprint ensures a minimal overhead for each loaded binary.
## Assumptions
These assumptions are made in the exception handling description:
-1. Prologs and epilogs tend to mirror each other. By taking advantage of this common trait, the size of the metadata needed to describe unwinding can be greatly reduced. Within the body of the function, it doesn't matter whether the prolog's operations are undone, or the epilog's operations are done in a forward manner. Both should produce identical results.
+- Prologs and epilogs tend to mirror each other. By taking advantage of this common trait, the size of the metadata needed to describe unwinding can be greatly reduced. Within the body of the function, it doesn't matter whether the prolog's operations are undone, or the epilog's operations are done in a forward manner. Both should produce identical results.
-1. Functions tend on the whole to be relatively small. Several optimizations for space rely on this fact to achieve the most efficient packing of data.
+- Functions tend on the whole to be relatively small. Several optimizations for space rely on this fact to achieve the most efficient packing of data.
-1. There's no conditional code in epilogs.
+- There's no conditional code in epilogs.
-1. Dedicated frame pointer register: If the sp is saved in another register (x29) in the prolog, that register remains untouched throughout the function. It means the original sp may be recovered at any time.
+- Dedicated frame pointer register: If the `sp` is saved in another register (`x29`) in the prolog, that register remains untouched throughout the function. It means the original `sp` may be recovered at any time.
-1. Unless the sp is saved in another register, all manipulation of the stack pointer occurs strictly within the prolog and epilog.
+- Unless the `sp` is saved in another register, all manipulation of the stack pointer occurs strictly within the prolog and epilog.
-1. The stack frame layout is organized as described in the next section.
+- The stack frame layout is organized as described in the next section.
## ARM64 stack frame layout

-For frame chained functions, the fp and lr pair can be saved at any position in the local variable area, depending on optimization considerations. The goal is to maximize the number of locals that can be reached by a single instruction based on the frame pointer (x29) or stack pointer (sp). However, for `alloca` functions, it must be chained, and x29 must point to the bottom of stack. To allow for better register-pair-addressing-mode coverage, nonvolatile register save areas are positioned at the top of the Local area stack. Here are examples that illustrate several of the most efficient prolog sequences. For the sake of clarity and better cache locality, the order of storing callee-saved registers in all canonical prologs is in "growing up" order. `#framesz` below represents the size of entire stack (excluding alloca area). `#localsz` and `#outsz` denote local area size (including the save area for the \ pair) and outgoing parameter size, respectively.
+For frame chained functions, the `fp` and `lr` pair can be saved at any position in the local variable area, depending on optimization considerations. The goal is to maximize the number of locals that can be reached by a single instruction based on the frame pointer (`x29`) or stack pointer (`sp`). However, for `alloca` functions, it must be chained, and `x29` must point to the bottom of stack. To allow for better register-pair-addressing-mode coverage, nonvolatile register save areas are positioned at the top of the Local area stack. Here are examples that illustrate several of the most efficient prolog sequences. For the sake of clarity and better cache locality, the order of storing callee-saved registers in all canonical prologs is in "growing up" order. `#framesz` below represents the size of entire stack (excluding `alloca` area). `#localsz` and `#outsz` denote local area size (including the save area for the `` pair) and outgoing parameter size, respectively.
1. Chained, #localsz \<= 512
@@ -59,7 +59,7 @@ For frame chained functions, the fp and lr pair can be saved at any position in
stp x0,x1,[sp,#32] // home params (optional)
stp x2,x3,[sp,#48]
stp x4,x5,[sp,#64]
- stp x6,x7,[sp,#72]
+ stp x6,x7,[sp,#82]
stp x29,lr,[sp,#-localsz]! // save at bottom of local area
mov x29,sp // x29 points to bottom of local
sub sp,sp,#outsz // (optional for #outsz != 0)
@@ -73,13 +73,13 @@ For frame chained functions, the fp and lr pair can be saved at any position in
stp x0,x1,[sp,#32] // home params (optional)
stp x2,x3,[sp,#48]
stp x4,x5,[sp,#64]
- stp x6,x7,[sp,#72]
+ stp x6,x7,[sp,#82]
sub sp,sp,#(localsz+outsz) // allocate remaining frame
stp x29,lr,[sp,#outsz] // save at bottom of local area
add x29,sp,#outsz // setup x29 points to bottom of local area
```
-1. Unchained, leaf functions (lr unsaved)
+1. Unchained, leaf functions (`lr` unsaved)
```asm
stp x19,x20,[sp,#-80]! // pre-indexed, save in 1st FP/INT reg-pair
@@ -90,9 +90,9 @@ For frame chained functions, the fp and lr pair can be saved at any position in
sub sp,sp,#(framesz-80) // allocate the remaining local area
```
- All locals are accessed based on SP. \ points to the previous frame. For frame size \<= 512, the "sub sp, ..." can be optimized away if the regs saved area is moved to the bottom of stack. The downside is that it's not consistent with other layouts above, and saved regs take part of the range for pair-regs and pre- and post-indexed offset addressing mode.
+ All locals are accessed based on `sp`. `` points to the previous frame. For frame size \<= 512, the `sub sp, ...` can be optimized away if the regs saved area is moved to the bottom of stack. The downside is that it's not consistent with other layouts above. And, saved regs take part of the range for pair-regs and pre- and post-indexed offset addressing mode.
-1. Unchained, non-leaf functions (lr is saved in Int saved area)
+1. Unchained, non-leaf functions (saves `lr` in Int saved area)
```asm
stp x19,x20,[sp,#-80]! // pre-indexed, save in 1st FP/INT reg-pair
@@ -114,7 +114,7 @@ For frame chained functions, the fp and lr pair can be saved at any position in
sub sp,sp,#(framesz-80) // allocate the remaining local area
```
- Only x19 saved:
+ Only `x19` saved:
```asm
sub sp,sp,#16 // reg save area allocation*
@@ -122,9 +122,9 @@ For frame chained functions, the fp and lr pair can be saved at any position in
sub sp,sp,#(framesz-16) // allocate the remaining local area
```
- \* The reg save area allocation isn't folded into the stp because a pre-indexed reg-lr stp can't be represented with the unwind codes.
+ \* The reg save area allocation isn't folded into the `stp` because a pre-indexed reg-lr `stp` can't be represented with the unwind codes.
- All locals are accessed based on SP. \ points to the previous frame.
+ All locals are accessed based on `sp`. `` points to the previous frame.
1. Chained, #framesz \<= 512, #outsz = 0
@@ -135,9 +135,9 @@ For frame chained functions, the fp and lr pair can be saved at any position in
stp d8,d9,[sp,#(framesz-16)] // save FP pair
```
- Compared to the first prolog example above, the advantage here is that all register save instructions are ready to execute after only one stack allocation instruction. That means there's no anti-dependence on sp that prevents instruction level parallelism.
+ Compared to the first prolog example above, this example has an advantage: all register save instructions are ready to execute after only one stack allocation instruction. That means there's no anti-dependence on `sp` that prevents instruction level parallelism.
-1. Chained, frame size > 512 (optional for functions without alloca)
+1. Chained, frame size > 512 (optional for functions without `alloca`)
```asm
stp x29,lr,[sp,#-80]! // pre-indexed, save
@@ -149,7 +149,7 @@ For frame chained functions, the fp and lr pair can be saved at any position in
sub sp,sp,#(framesz-80) // allocate the remaining local area
```
- For optimization purpose, x29 can be put at any position in local area to provide a better coverage for "reg-pair" and pre-/post-indexed offset addressing mode. Locals below frame pointers can be accessed based on SP.
+ For optimization purpose, `x29` can be put at any position in local area to provide a better coverage for "reg-pair" and pre-/post-indexed offset addressing mode. Locals below frame pointers can be accessed based on `sp`.
1. Chained, frame size > 4K, with or without alloca(),
@@ -176,11 +176,11 @@ For frame chained functions, the fp and lr pair can be saved at any position in
## ARM64 exception handling information
-### .pdata records
+### `.pdata` records
-The .pdata records are an ordered array of fixed-length items that describe every stack-manipulating function in a PE binary. The phrase "stack-manipulating" is significant: leaf functions that don't require any local storage, and don't need to save/restore non-volatile registers, do not require a .pdata record. These records should be explicitly omitted to save space. An unwind from one of these functions can get the return address directly from LR to move up to the caller.
+The `.pdata` records are an ordered array of fixed-length items that describe every stack-manipulating function in a PE binary. The phrase "stack-manipulating" is significant: leaf functions that don't require any local storage, and don't need to save/restore non-volatile registers, don't require a `.pdata` record. These records should be explicitly omitted to save space. An unwind from one of these functions can get the return address directly from `lr` to move up to the caller.
-Each .pdata record for ARM64 is 8 bytes in length. The general format of each record places the 32-bit RVA of the function start in the first word, followed by a second word that contains either a pointer to a variable-length .xdata block, or a packed word describing a canonical function unwinding sequence.
+Each `.pdata` record for ARM64 is 8 bytes in length. The general format of each record places the 32-bit RVA of the function start in the first word, followed by a second word that contains either a pointer to a variable-length `.xdata` block, or a packed word describing a canonical function unwinding sequence.

@@ -188,29 +188,29 @@ The fields are as follows:
- **Function Start RVA** is the 32-bit RVA of the start of the function.
-- **Flag** is a 2-bit field that indicates how to interpret the remaining 30 bits of the second .pdata word. If **Flag** is 0, then the remaining bits form an **Exception Information RVA** (with the two lowest bits implicitly 0). If **Flag** is non-zero, then the remaining bits form a **Packed Unwind Data** structure.
+- **Flag** is a 2-bit field that indicates how to interpret the remaining 30 bits of the second `.pdata` word. If **Flag** is 0, then the remaining bits form an **Exception Information RVA** (with the two lowest bits implicitly 0). If **Flag** is non-zero, then the remaining bits form a **Packed Unwind Data** structure.
-- **Exception Information RVA** is the address of the variable-length exception information structure, stored in the .xdata section. This data must be 4-byte aligned.
+- **Exception Information RVA** is the address of the variable-length exception information structure, stored in the `.xdata` section. This data must be 4-byte aligned.
-- **Packed Unwind Data** is a compressed description of the operations needed to unwind from a function, assuming a canonical form. In this case, no .xdata record is required.
+- **Packed Unwind Data** is a compressed description of the operations needed to unwind from a function, assuming a canonical form. In this case, no `.xdata` record is required.
-### .xdata records
+### `.xdata` records
-When the packed unwind format is insufficient to describe the unwinding of a function, a variable-length .xdata record must be created. The address of this record is stored in the second word of the .pdata record. The format of the .xdata is a packed variable-length set of words:
+When the packed unwind format is insufficient to describe the unwinding of a function, a variable-length `.xdata` record must be created. The address of this record is stored in the second word of the `.pdata` record. The format of the `.xdata` is a packed variable-length set of words:

This data is broken into four sections:
-1. A 1 or 2-word header describing the overall size of the structure and providing key function data. The second word is only present if both the **Epilog Count** and **Code Words** fields are set to 0. The header has these bit fields:
+1. A 1-word or 2-word header describing the overall size of the structure and providing key function data. The second word is only present if both the **Epilog Count** and **Code Words** fields are set to 0. The header has these bit fields:
- a. **Function Length** is an 18-bit field. It indicates the total length of the function in bytes, divided by 4. If a function is larger than 1M, then multiple .pdata and .xdata records must be used to describe the function. For more information, see the [Large functions](#large-functions) section.
+ a. **Function Length** is an 18-bit field. It indicates the total length of the function in bytes, divided by 4. If a function is larger than 1M, then multiple `.pdata` and `.xdata` records must be used to describe the function. For more information, see the [Large functions](#large-functions) section.
- b. **Vers** is a 2-bit field. It describes the version of the remaining .xdata. Currently, only version 0 is defined, so values of 1-3 aren't permitted.
+ b. **Vers** is a 2-bit field. It describes the version of the remaining `.xdata`. Currently, only version 0 is defined, so values of 1-3 aren't permitted.
c. **X** is a 1-bit field. It indicates the presence (1) or absence (0) of exception data.
- d. **E** is a 1-bit field. It indicates that information describing a single epilog is packed into the header (1) rather than requiring additional scope words later (0).
+ d. **E** is a 1-bit field. It indicates that information describing a single epilog is packed into the header (1) rather than requiring more scope words later (0).
e. **Epilog Count** is a 5-bit field that has two meanings, depending on the state of **E** bit:
@@ -218,11 +218,11 @@ This data is broken into four sections:
2. If **E** is 1, then this field specifies the index of the first unwind code that describes the one and only epilog.
- f. **Code Words** is a 5-bit field that specifies the number of 32-bit words needed to contain all of the unwind codes in section 3. If more than 31 words are required (that is, if there are more than 124 unwind code bytes), then this field must be 0 to indicate that an extension word is required.
+ f. **Code Words** is a 5-bit field that specifies the number of 32-bit words needed to contain all of the unwind codes in section 3. If more than 31 words (that is, 124 unwind codes) are required, then this field must be 0 to indicate that an extension word is required.
g. **Extended Epilog Count** and **Extended Code Words** are 16-bit and 8-bit fields, respectively. They provide more space for encoding an unusually large number of epilogs, or an unusually large number of unwind code words. The extension word that contains these fields is only present if both the **Epilog Count** and **Code Words** fields in the first header word are 0.
-1. If **Epilog Count** isn't zero, a list of information about epilog scopes, packed one to a word, comes after the header and optional extended header. They're stored in order of increasing starting offset. Each scope contains the following bits:
+1. If the count of epilogs isn't zero, a list of information about epilog scopes, packed one to a word, comes after the header and optional extended header. They're stored in order of increasing starting offset. Each scope contains the following bits:
a. **Epilog Start Offset** is an 18-bit field that has the offset in bytes, divided by 4, of the epilog relative to the start of the function.
@@ -230,11 +230,11 @@ This data is broken into four sections:
c. **Epilog Start Index** is a 10-bit field (2 more bits than **Extended Code Words**). It indicates the byte index of the first unwind code that describes this epilog.
-1. After the list of epilog scopes comes an array of bytes that contain unwind codes, described in detail in a later section. This array is padded at the end to the nearest full word boundary. Unwind codes are written to this array. They start with the one closest to the body of the function, and move towards the edges of the function. The bytes for each unwind code are stored in big-endian order so they can be fetched directly, starting with the most significant byte first, which identifies the operation and the length of the rest of the code.
+1. After the list of epilog scopes comes an array of bytes that contain unwind codes, described in detail in a later section. This array is padded at the end to the nearest full word boundary. Unwind codes are written to this array. They start with the one closest to the body of the function, and move towards the edges of the function. The bytes for each unwind code are stored in big-endian order so the most significant byte gets fetched first, which identifies the operation and the length of the rest of the code.
1. Finally, after the unwind code bytes, if the **X** bit in the header was set to 1, comes the exception handler information. It consists of a single **Exception Handler RVA** that provides the address of the exception handler itself. It's followed immediately by a variable-length amount of data required by the exception handler.
-The .xdata record is designed so it's possible to fetch the first 8 bytes, and use them to compute the full size of the record, minus the length of the variable-sized exception data that follows. The following code snippet computes the record size:
+The `.xdata` record is designed so it's possible to fetch the first 8 bytes, and use them to compute the full size of the record, minus the length of the variable-sized exception data that follows. The following code snippet computes the record size:
```cpp
ULONG ComputeXdataSize(PULONG Xdata)
@@ -267,68 +267,86 @@ ULONG ComputeXdataSize(PULONG Xdata)
}
```
-Although the prolog and each epilog has its own index into the unwind codes, the table is shared between them. It's entirely possible (and not altogether uncommon) that they can all share the same codes. (For an example, see Example 2 in the [Examples](#examples) section.) Compiler writers should optimize for this case, in particular, because the largest index that can be specified is 255, which limits the total number of unwind codes for a particular function.
+Although the prolog and each epilog has its own index into the unwind codes, the table is shared between them. It's entirely possible (and not altogether uncommon) that they can all share the same codes. (For an example, see Example 2 in the [Examples](#examples) section.) Compiler writers should optimize for this case in particular. It's because the largest index that can be specified is 255, which limits the total number of unwind codes for a particular function.
### Unwind codes
-The array of unwind codes is pool of sequences that describe exactly how to undo the effects of the prolog, stored in the same order the operations need to be undone. The unwind codes can be thought of as a small instruction set, encoded as a string of bytes. When execution is complete, the return address to the calling function is in the lr register. And, all non-volatile registers are restored to their values at the time the function was called.
+The array of unwind codes is a pool of sequences that describe exactly how to undo the effects of the prolog. They're stored in the same order the operations need to be undone. The unwind codes can be thought of as a small instruction set, encoded as a string of bytes. When execution is complete, the return address to the calling function is in the `lr` register. And, all non-volatile registers are restored to their values at the time the function was called.
If exceptions were guaranteed to only ever occur within a function body, and never within a prolog or any epilog, then only a single sequence would be necessary. However, the Windows unwinding model requires that code can unwind from within a partially executed prolog or epilog. To meet this requirement, the unwind codes have been carefully designed so they unambiguously map 1:1 to each relevant opcode in the prolog and epilog. This design has several implications:
-1. By counting the number of unwind codes, it's possible to compute the length of the prolog and epilog.
-
-1. By counting the number of instructions past the start of an epilog scope, it's possible to skip the equivalent number of unwind codes. Then we can execute the rest of a sequence to complete the partially executed unwind done by the epilog.
-
-1. By counting the number of instructions before the end of the prolog, it's possible to skip the equivalent number of unwind codes. Then we can execute the rest of the sequence to undo only those parts of the prolog that have completed execution.
-
-The unwind codes are encoded according to the table below. All unwind codes are a single/double byte, except the one that allocates a huge stack. Totally there are 21 unwind code. Each unwind code maps exactly one instruction in the prolog/epilog, to allow for unwinding of partially executed prologs and epilogs.
-
-|Unwind code|Bits and interpretation|
-|-|-|
-|`alloc_s`|000xxxxx: allocate small stack with size \< 512 (2^5 * 16).|
-|`save_r19r20_x`| 001zzzzz: save \ pair at `[sp-#Z*8]!`, pre-indexed offset >= -248 |
-|`save_fplr`| 01zzzzzz: save \ pair at `[sp+#Z*8]`, offset \<= 504. |
-|`save_fplr_x`| 10zzzzzz: save \ pair at `[sp-(#Z+1)*8]!`, pre-indexed offset >= -512 |
-|`alloc_m`| 11000xxx'xxxxxxxx: allocate large stack with size \< 16k (2^11 * 16). |
-|`save_regp`| 110010xx'xxzzzzzz: save x(19+#X) pair at `[sp+#Z*8]`, offset \<= 504 |
-|`save_regp_x`| 110011xx'xxzzzzzz: save pair x(19+#X) at `[sp-(#Z+1)*8]!`, pre-indexed offset >= -512 |
-|`save_reg`| 110100xx'xxzzzzzz: save reg x(19+#X) at `[sp+#Z*8]`, offset \<= 504 |
-|`save_reg_x`| 1101010x'xxxzzzzz: save reg x(19+#X) at `[sp-(#Z+1)*8]!`, pre-indexed offset >= -256 |
-|`save_lrpair`| 1101011x'xxzzzzzz: save pair \ at `[sp+#Z*8]`, offset \<= 504 |
-|`save_fregp`| 1101100x'xxzzzzzz: save pair d(8+#X) at `[sp+#Z*8]`, offset \<= 504 |
-|`save_fregp_x`| 1101101x'xxzzzzzz: save pair d(8+#X), at `[sp-(#Z+1)*8]!`, pre-indexed offset >= -512 |
-|`save_freg`| 1101110x'xxzzzzzz: save reg d(8+#X) at `[sp+#Z*8]`, offset \<= 504 |
-|`save_freg_x`| 11011110'xxxzzzzz: save reg d(8+#X) at `[sp-(#Z+1)*8]!`, pre-indexed offset >= -256 |
-|`alloc_l`| 11100000'xxxxxxxx'xxxxxxxx'xxxxxxxx: allocate large stack with size \< 256M (2^24 *16) |
-|`set_fp`| 11100001: set up x29: with: `mov x29,sp` |
-|`add_fp`| 11100010'xxxxxxxx: set up x29 with: `add x29,sp,#x*8` |
-|`nop`| 11100011: no unwind operation is required. |
-|`end`| 11100100: end of unwind code. Implies ret in epilog. |
-|`end_c`| 11100101: end of unwind code in current chained scope. |
-|`save_next`| 11100110: save next non-volatile Int or FP register pair. |
-| | 11100111: reserved |
-| | 11101xxx: reserved for custom stack cases below only generated for asm routines |
-| | 11101000: Custom stack for MSFT_OP_TRAP_FRAME |
-| | 11101001: Custom stack for MSFT_OP_MACHINE_FRAME |
-| | 11101010: Custom stack for MSFT_OP_CONTEXT |
-| | 11101100: Custom stack for MSFT_OP_CLEAR_UNWOUND_TO_CALL |
-| | 1111xxxx: reserved |
-
-In instructions with large values covering multiple bytes, the most significant bits are stored first. This design makes it possible to find the total size in bytes of the unwind code by looking up only the first byte of the code. Since each unwind code is exactly mapped to an instruction in a prolog or epilog, you can compute the size of the prolog or epilog. You can walk from the start of the sequence to the end, and use a lookup table or similar device to determine how long the corresponding opcode is.
-
-Post-indexed offset addressing isn't allowed in a prolog. All offset ranges (#Z) match the encoding of STP/STR addressing except `save_r19r20_x`, in which 248 is sufficient for all save areas (10 Int registers + 8 FP registers + 8 input registers).
-
-`save_next` must follow a save for Int or FP volatile register pair: `save_regp`, `save_regp_x`, `save_fregp`, `save_fregp_x`, `save_r19r20_x`, or another `save_next`. It saves the next register pair at the next 16-byte slot in "growing up" order. A `save_next` refers to the first FP register pair when it follows the `save-next` that denotes the last Int register pair.
-
-Since the size of regular return and jump instructions are the same, there's no need of a separated `end` unwind code for tail-call scenarios.
-
-`end_c` is designed to handle noncontiguous function fragments for optimization purposes. An `end_c` that indicates the end of unwind codes in the current scope must be followed by another series of unwind code ended with a real `end`. The unwind codes between `end_c` and `end` represent the prolog operations in the parent region ("phantom" prolog). More details and examples are described in the section below.
+- By counting the number of unwind codes, it's possible to compute the length of the prolog and epilog.
+
+- By counting the number of instructions past the start of an epilog scope, it's possible to skip the equivalent number of unwind codes. We can execute the rest of a sequence to complete the partially executed unwind done by the epilog.
+
+- By counting the number of instructions before the end of the prolog, it's possible to skip the equivalent number of unwind codes. We can execute the rest of the sequence to undo only those parts of the prolog that have completed execution.
+
+The unwind codes are encoded according to the table below. All unwind codes are a single/double byte, except the one that allocates a huge stack (`alloc_l`). There are 22 unwind codes in total. Each unwind code maps exactly one instruction in the prolog/epilog, to allow for unwinding of partially executed prologs and epilogs.
+
+| Unwind code | Bits and interpretation |
+|--|--|
+| `alloc_s` | 000xxxxx: allocate small stack with size \< 512 (2^5 * 16). |
+| `save_r19r20_x` | 001zzzzz: save `` pair at `[sp-#Z*8]!`, pre-indexed offset >= -248 |
+| `save_fplr` | 01zzzzzz: save `` pair at `[sp+#Z*8]`, offset \<= 504. |
+| `save_fplr_x` | 10zzzzzz: save `` pair at `[sp-(#Z+1)*8]!`, pre-indexed offset >= -512 |
+| `alloc_m` | 11000xxx'xxxxxxxx: allocate large stack with size \< 32K (2^11 * 16). |
+| `save_regp` | 110010xx'xxzzzzzz: save `x(19+#X)` pair at `[sp+#Z*8]`, offset \<= 504 |
+| `save_regp_x` | 110011xx'xxzzzzzz: save pair `x(19+#X)` at `[sp-(#Z+1)*8]!`, pre-indexed offset >= -512 |
+| `save_reg` | 110100xx'xxzzzzzz: save reg `x(19+#X)` at `[sp+#Z*8]`, offset \<= 504 |
+| `save_reg_x` | 1101010x'xxxzzzzz: save reg `x(19+#X)` at `[sp-(#Z+1)*8]!`, pre-indexed offset >= -256 |
+| `save_lrpair` | 1101011x'xxzzzzzz: save pair `` at `[sp+#Z*8]`, offset \<= 504 |
+| `save_fregp` | 1101100x'xxzzzzzz: save pair `d(8+#X)` at `[sp+#Z*8]`, offset \<= 504 |
+| `save_fregp_x` | 1101101x'xxzzzzzz: save pair `d(8+#X)` at `[sp-(#Z+1)*8]!`, pre-indexed offset >= -512 |
+| `save_freg` | 1101110x'xxzzzzzz: save reg `d(8+#X)` at `[sp+#Z*8]`, offset \<= 504 |
+| `save_freg_x` | 11011110'xxxzzzzz: save reg `d(8+#X)` at `[sp-(#Z+1)*8]!`, pre-indexed offset >= -256 |
+| `alloc_z` | 11011111'zzzzzzzz: allocate stack with size `z * SVE-VL` |
+| `alloc_l` | 11100000'xxxxxxxx'xxxxxxxx'xxxxxxxx: allocate large stack with size \< 256M (2^24 * 16) |
+| `set_fp` | 11100001: set up `x29` with `mov x29,sp` |
+| `add_fp` | 11100010'xxxxxxxx: set up `x29` with `add x29,sp,#x*8` |
+| `nop` | 11100011: no unwind operation is required. |
+| `end` | 11100100: end of unwind code. Implies `ret` in epilog. |
+| `end_c` | 11100101: end of unwind code in current chained scope. |
+| `save_next` | 11100110: save next register pair. |
+| `save_any_xreg` | 11100111'0pxrrrrr'00oooooo: save register(s)- `p`: 0/1 => single `X(#r)` vs pair `X(#r)` + `X(#r+1)`
- `x`: 0/1 => positive vs negative pre-indexed stack offset
- `o`: offset = `o` * 16, if x=1 or p=1, else `o` * 8
(Windows >= 11 required) |
+| `save_any_dreg` | 11100111'0pxrrrrr'01oooooo: save register(s)- `p`: 0/1 => single `D(#r)` vs pair `D(#r)` + `D(#r+1)`
- `x`: 0/1 => positive vs negative pre-indexed stack offset
- `o`: offset = `o` * 16, if x=1 or p=1, else `o` * 8
(Windows >= 11 required) |
+| `save_any_qreg` | 11100111'0pxrrrrr'10oooooo: save register(s)- `p`: 0/1 => single `Q(#r)` vs pair `Q(#r)` + `Q(#r+1)`
- `x`: 0/1 => positive vs negative pre-indexed stack offset
- `o`: offset = `o` * 16
(Windows >= 11 required) |
+| `save_zreg` | 11100111'0oo0rrrr'11oooooo: save reg `Z(#r+8)` at `[sp + #o * VL]`, (`Z8` through `Z23`)
+| `save_preg` | 11100111'0oo1rrrr'11oooooo: save reg `P(#r)` at `[sp + #o * (VL / 8)]`, (`P4` through `P15`; `r` values `[0, 3]` are reserved)
+| | 11100111'1yyyyyyy': reserved |
+| | 11101xxx: reserved for custom stack cases below only generated for asm routines |
+| | 11101000: Custom stack for `MSFT_OP_TRAP_FRAME` |
+| | 11101001: Custom stack for `MSFT_OP_MACHINE_FRAME` |
+| | 11101010: Custom stack for `MSFT_OP_CONTEXT` |
+| | 11101011: Custom stack for `MSFT_OP_EC_CONTEXT` |
+| | 11101100: Custom stack for `MSFT_OP_CLEAR_UNWOUND_TO_CALL` |
+| | 11101101: reserved |
+| | 11101110: reserved |
+| | 11101111: reserved |
+| | 11110xxx: reserved |
+| | 11111000'yyyyyyyy : reserved |
+| | 11111001'yyyyyyyy'yyyyyyyy : reserved |
+| | 11111010'yyyyyyyy'yyyyyyyy'yyyyyyyy : reserved |
+| | 11111011'yyyyyyyy'yyyyyyyy'yyyyyyyy'yyyyyyyy : reserved |
+| `pac_sign_lr` | 11111100: sign the return address in `lr` with `pacibsp` |
+| | 11111101: reserved |
+| | 11111110: reserved |
+| | 11111111: reserved |
+
+In instructions with large values covering multiple bytes, the most significant bits are stored first. This design makes it possible to find the total size in bytes of the unwind code by looking up only the first byte of the code. Since each unwind code is exactly mapped to an instruction in a prolog or epilog, you can compute the size of the prolog or epilog. Walk from the sequence start to the end, and use a lookup table or similar device to determine the length of the corresponding opcode.
+
+Post-indexed offset addressing isn't allowed in a prolog. All offset ranges (#Z) match the encoding of `stp`/`str` addressing except `save_r19r20_x`, in which 248 is sufficient for all save areas (10 Int registers + 8 FP registers + 8 input registers).
+
+`save_next` must follow a save for a register pair: `save_regp`, `save_regp_x`, `save_fregp`, `save_fregp_x`, `save_r19r20_x`, or another `save_next`. It can also be used in conjunction with `save_any_xreg`, `save_any_dreg` or `save_any_qreg` but only when `p = 1`. It saves the next register pair in numerically increasing order to the next stack space. `save_next` must not be used beyond the last register of the same kind.
+
+Since the sizes of regular return and jump instructions are the same, there's no need for a separated `end` unwind code in tail-call scenarios.
+
+`end_c` is designed to handle noncontiguous function fragments for optimization purposes. An `end_c` that indicates the end of unwind codes in the current scope must be followed by another series of unwind codes ending with a real `end`. The unwind codes between `end_c` and `end` represent the prolog operations in the parent region (a "phantom" prolog). More details and examples are described in the section below.
### Packed unwind data
-For functions whose prologs and epilogs follow the canonical form described below, packed unwind data can be used. It eliminates the need for an .xdata record entirely, and significantly reduces the cost of providing unwind data. The canonical prologs and epilogs are designed to meet the common requirements of a simple function: One that doesn't require an exception handler, and which does its setup and teardown operations in a standard order.
+For functions whose prologs and epilogs follow the canonical form described below, packed unwind data can be used. It eliminates the need for an `.xdata` record entirely, and significantly reduces the cost of providing unwind data. The canonical prologs and epilogs are designed to meet the common requirements of a simple function: One that doesn't require an exception handler, and which does its setup and teardown operations in a standard order.
-The format of a .pdata record with packed unwind data looks like this:
+The format of a `.pdata` record with packed unwind data looks like this:

@@ -336,57 +354,60 @@ The fields are as follows:
- **Function Start RVA** is the 32-bit RVA of the start of the function.
- **Flag** is a 2-bit field as described above, with the following meanings:
- - 00 = packed unwind data not used; remaining bits point to an .xdata record
+ - 00 = packed unwind data not used; remaining bits point to an `.xdata` record
- 01 = packed unwind data used with a single prolog and epilog at the beginning and end of the scope
- 10 = packed unwind data used for code without any prolog and epilog. Useful for describing separated function segments
- 11 = reserved.
-- **Function Length** is an 11-bit field providing the length of the entire function in bytes, divided by 4. If the function is larger than 8k, a full .xdata record must be used instead.
-- **Frame Size** is a 9-bit field indicating the number of bytes of stack that is allocated for this function, divided by 16. Functions that allocate greater than (8k-16) bytes of stack must use a full .xdata record. It includes the local variable area, outgoing parameter area, callee-saved Int and FP area, and home parameter area, but excludes the dynamic allocation area.
+- **Function Length** is an 11-bit field providing the length of the entire function in bytes, divided by 4. If the function is larger than 8k, a full `.xdata` record must be used instead.
+- **Frame Size** is a 9-bit field indicating the number of bytes of stack that is allocated for this function, divided by 16. Functions that allocate greater than (8k-16) bytes of stack must use a full `.xdata` record. It includes the local variable area, outgoing parameter area, callee-saved Int and FP area, and home parameter area. It excludes the dynamic allocation area.
- **CR** is a 2-bit flag indicating whether the function includes extra instructions to set up a frame chain and return link:
- - 00 = unchained function, \ pair is not saved in stack.
- - 01 = unchained function, \ is saved in stack
- - 10 = reserved;
- - 11 = chained function, a store/load pair instruction is used in prolog/epilog \
-- **H** is a 1-bit flag indicating whether the function homes the integer parameter registers (x0-x7) by storing them at the very start of the function. (0=does not home registers, 1=homes registers).
+ - 00 = unchained function, `` pair isn't saved in stack
+ - 01 = unchained function, `` is saved in stack
+ - 10 = chained function with a `pacibsp` signed return address
+ - 11 = chained function, a store/load pair instruction is used in prolog/epilog ``
+- **H** is a 1-bit flag indicating whether the function homes the integer parameter registers (x0-x7) by storing them at the very start of the function. (0 = doesn't home registers, 1 = homes registers).
- **RegI** is a 4-bit field indicating the number of non-volatile INT registers (x19-x28) saved in the canonical stack location.
- **RegF** is a 3-bit field indicating the number of non-volatile FP registers (d8-d15) saved in the canonical stack location. (RegF=0: no FP register is saved; RegF>0: RegF+1 FP registers are saved). Packed unwind data can't be used for function that save only one FP register.
-Canonical prologs that fall into categories 1, 2 (without outgoing parameter area), 3 and 4 in section above can be represented by packed unwind format. The epilogs for canonical functions follow a similar form, except **H** has no effect, the `set_fp` instruction is omitted, and the order of steps and the instructions in each step are reversed in the epilog. The algorithm for packed .xdata follows these steps, detailed in the following table:
+Canonical prologs that fall into categories 1, 2 (without outgoing parameter area), 3 and 4 in section above can be represented by packed unwind format. The epilogs for canonical functions follow a similar form, except **H** has no effect, the `set_fp` instruction is omitted, and the order of steps and the instructions in each step are reversed in the epilog. The algorithm for packed `.xdata` follows these steps, detailed in the following table:
Step 0: Pre-compute of the size of each area.
-Step 1: Save Int callee-saved registers.
+Step 1: Sign the return address.
-Step 2: This step is specific for type 4 in early sections. lr is saved at the end of Int area.
+Step 2: Save Int callee-saved registers.
-Step 3: Save FP callee-saved registers.
+Step 3: This step is specific for type 4 in early sections. `lr` is saved at the end of Int area.
-Step 4: Save input arguments in the home parameter area.
+Step 4: Save FP callee-saved registers.
-Step 5: Allocate remaining stack, including local area, \ pair, and outgoing parameter area. 5a corresponds to canonical type 1. 5b and 5c are for canonical type 2. 5d and 5e are for both type 3 and type 4.
+Step 5: Save input arguments in the home parameter area.
-Step #|Flag values|# of instructions|Opcode|Unwind Code
--|-|-|-|-
-0|||`#intsz = RegI * 8;`
`if (CR==01) #intsz += 8; // lr`
`#fpsz = RegF * 8;`
`if(RegF) #fpsz += 8;`
`#savsz=((#intsz+#fpsz+8*8*H)+0xf)&~0xf)`
`#locsz = #famsz - #savsz`|
-1|0 < **RegI** <= 10|RegI / 2 + **RegI** % 2|`stp x19,x20,[sp,#savsz]!`
`stp x21,x22,[sp,#16]`
`...`|`save_regp_x`
`save_regp`
`...`
-2|**CR**==01*|1|`str lr,[sp,#(intsz-8)]`\*|`save_reg`
-3|0 < **RegF** <=7|(RegF + 1) / 2 +
(RegF + 1) % 2)|`stp d8,d9,[sp,#intsz]`\*\*
`stp d10,d11,[sp,#(intsz+16)]`
`...`
`str d(8+RegF),[sp,#(intsz+fpsz-8)]`|`save_fregp`
`...`
`save_freg`
-4|**H** == 1|4|`stp x0,x1,[sp,#(intsz+fpsz)]`
`stp x2,x3,[sp,#(intsz+fpsz+16)]`
`stp x4,x5,[sp,#(intsz+fpsz+32)]`
`stp x6,x7,[sp,#(intsz+fpsz+48)]`|`nop`
`nop`
`nop`
`nop`
-5a|**CR** == 11 && #locsz
<= 512|2|`stp x29,lr,[sp,#-locsz]!`
`mov x29,sp`\*\*\*|`save_fplr_x`
`set_fp`
-5b|**CR** == 11 &&
512 < #locsz <= 4080|3|`sub sp,sp,#locsz`
`stp x29,lr,[sp,0]`
`add x29,sp,0`|`alloc_m`
`save_fplr`
`set_fp`
-5c|**CR** == 11 && #locsz > 4080|4|`sub sp,sp,4080`
`sub sp,sp,#(locsz-4080)`
`stp x29,lr,[sp,0]`
`add x29,sp,0`|`alloc_m`
`alloc_s`/`alloc_m`
`save_fplr`
`set_fp`
-5d|(**CR** == 00 \|\| **CR**==01) &&
#locsz <= 4080|1|`sub sp,sp,#locsz`|`alloc_s`/`alloc_m`
-5e|(**CR** == 00 \|\| **CR**==01) &&
#locsz > 4080|2|`sub sp,sp,4080`
`sub sp,sp,#(locsz-4080)`|`alloc_m`
`alloc_s`/`alloc_m`
+Step 6: Allocate remaining stack, including local area, `` pair, and outgoing parameter area. 6a corresponds to canonical type 1. 6b and 6c are for canonical type 2. 6d and 6e are for both type 3 and type 4.
-\* If **CR** == 01 and **RegI** is an odd number, Step 2 and last save_rep in step 1 are merged into one save_regp.
+| Step # | Flag values | # of instructions | Opcode | Unwind code |
+|--|--|--|--|--|
+| 0 | | | `#intsz = RegI * 8;`
`if (CR==01) #intsz += 8; // lr`
`#fpsz = RegF * 8;`
`if(RegF) #fpsz += 8;`
`#savsz=((#intsz+#fpsz+8*8*H)+0xf)&~0xf)`
`#locsz = #famsz - #savsz` |
+| 1 | **CR** == 10 | 1 | `pacibsp` | `pac_sign_lr` |
+| 2 | 0 < **RegI** <= 10 | **RegI** / 2 +
**RegI** % 2 | `stp x19,x20,[sp,#savsz]!`
`stp x21,x22,[sp,#16]`
`...` | `save_regp_x`
`save_regp`
`...` |
+| 3 | **CR** == 01\* | 1 | `str lr,[sp,#(intsz-8)]`\* | `save_reg` |
+| 4 | 0 < **RegF** <= 7 | (**RegF** + 1) / 2 +
(**RegF** + 1) % 2) | `stp d8,d9,[sp,#intsz]`\*\*
`stp d10,d11,[sp,#(intsz+16)]`
`...`
`str d(8+RegF),[sp,#(intsz+fpsz-8)]` | `save_fregp`
`...`
`save_freg` |
+| 5 | **H** == 1 | 4 | `stp x0,x1,[sp,#(intsz+fpsz)]`
`stp x2,x3,[sp,#(intsz+fpsz+16)]`
`stp x4,x5,[sp,#(intsz+fpsz+32)]`
`stp x6,x7,[sp,#(intsz+fpsz+48)]` | `nop`
`nop`
`nop`
`nop` |
+| 6a | (**CR** == 10 \|\| **CR** == 11) &&
`#locsz` <= 512 | 2 | `stp x29,lr,[sp,#-locsz]!`
`mov x29,sp`\*\*\* | `save_fplr_x`
`set_fp` |
+| 6b | (**CR** == 10 \|\| **CR** == 11) &&
512 < `#locsz` <= 4080 | 3 | `sub sp,sp,#locsz`
`stp x29,lr,[sp,0]`
`add x29,sp,0` | `alloc_m`
`save_fplr`
`set_fp` |
+| 6c | (**CR** == 10 \|\| **CR** == 11) &&
`#locsz` > 4080 | 4 | `sub sp,sp,4080`
`sub sp,sp,#(locsz-4080)`
`stp x29,lr,[sp,0]`
`add x29,sp,0` | `alloc_m`
`alloc_s`/`alloc_m`
`save_fplr`
`set_fp` |
+| 6d | (**CR** == 00 \|\| **CR** == 01) &&
`#locsz` <= 4080 | 1 | `sub sp,sp,#locsz` | `alloc_s`/`alloc_m` |
+| 6e | (**CR** == 00 \|\| **CR** == 01) &&
`#locsz` > 4080 | 2 | `sub sp,sp,4080`
`sub sp,sp,#(locsz-4080)` | `alloc_m`
`alloc_s`/`alloc_m` |
-\*\* If **RegI** == **CR** == 0, and **RegF** != 0, the first stp for the floating-point does the predecrement.
+\* If **CR** == 01 and **RegI** is an odd number, step 3 and the last `save_reg` in step 2 are merged into one `save_regp`.
-\*\*\* No instruction corresponding to `mov x29,sp` is present in the epilog. Packed unwind data can't be used if a function requires restoration of sp from x29.
+\*\* If **RegI** == **CR** == 0, and **RegF** != 0, the first `stp` for the floating-point does the predecrement.
+
+\*\*\* No instruction corresponding to `mov x29,sp` is present in the epilog. Packed unwind data can't be used if a function requires restoration of `sp` from `x29`.
### Unwinding partial prologs and epilogs
-The most common unwinding situation is one where the exception or call occurred in the body of the function, away from the prolog and all epilogs. In this situation, unwinding is straightforward: the unwinder simply begins executing the codes in the unwind array beginning at index 0 and continuing until an end opcode is detected.
+In the most common unwinding situations, the exception or call occurs in the body of the function, away from the prolog and all epilogs. In these situations, unwinding is straightforward: the unwinder simply executes the codes in the unwind array. It begins at index 0 and continues until an `end` opcode is detected.
It's more difficult to correctly unwind in the case where an exception or interrupt occurs while executing a prolog or epilog. In these situations, the stack frame is only partially constructed. The problem is to determine exactly what's been done, to correctly undo it.
@@ -405,19 +426,19 @@ For example, take this prolog and epilog sequence:
0110: ret lr // end
```
-Next to each opcode is the appropriate unwind code describing this operation. You can see how the series of unwind codes for the prolog is an exact mirror image of the unwind codes for the epilog (not counting the final instruction of the epilog). It's a common situation, and it's why we always assume the unwind codes for the prolog are stored in reverse order from the prolog's execution order.
+Next to each opcode is the appropriate unwind code describing this operation. You can see how the series of unwind codes for the prolog is an exact mirror image of the unwind codes for the epilog (not counting the final instruction of the epilog). It's a common situation: It's why we always assume the unwind codes for the prolog are stored in reverse order from the prolog's execution order.
So, for both the prolog and epilog, we're left with a common set of unwind codes:
`set_fp`, `save_regp 0,240`, `save_fregp,0,224`, `save_fplr_x_256`, `end`
-The epilog case is straightforward, since it's in normal order. Starting at offset 0 within the epilog (which starts at offset 0x100 in the function), we'd expect to execute the full unwind sequence, as no cleanup has yet been done. If we find ourselves one instruction in (at offset 2 in the epilog), we can successfully unwind by skipping the first unwind code. We can generalize this situation, and assume a 1:1 mapping between opcodes and unwind codes. Then, to start unwinding from instruction *n* in the epilog, we should skip the first *n* unwind codes, and begin executing from there.
+The epilog case is straightforward, since it's in normal order. Starting at offset 0 within the epilog (which starts at offset 0x100 in the function), we'd expect the full unwind sequence to execute, as no cleanup has yet been done. If we find ourselves one instruction in (at offset 2 in the epilog), we can successfully unwind by skipping the first unwind code. We can generalize this situation, and assume a 1:1 mapping between opcodes and unwind codes. Then, to start unwinding from instruction *n* in the epilog, we should skip the first *n* unwind codes, and begin executing from there.
-It turns out that a similar logic works for the prolog, except in reverse. If we start unwinding from offset 0 in the prolog, we want to execute nothing. If we unwind from offset 2, which is one instruction in, then we want to start executing the unwind sequence one unwind code from the end. (Remember, the codes are stored in reverse order.) And here too, we can generalize: if we start unwinding from instruction n in the prolog, we should start executing n unwind codes from the end of the list of codes.
+It turns out that a similar logic works for the prolog, except in reverse. If we start unwinding from offset 0 in the prolog, we want to execute nothing. If we unwind from offset 2, which is one instruction in, then we want to start executing the unwind sequence one unwind code from the end. (Remember, the codes are stored in reverse order.) And here too, we can generalize: if we start unwinding from instruction *n* in the prolog, we should start executing *n* unwind codes from the end of the list of codes.
-It's not always the case that the prolog and epilog codes match exactly. That's why the unwind array may need to contain several sequences of codes. To determine the offset of where to begin processing codes, use the following logic:
+Prolog and epilog codes don't always match exactly, which is why the unwind array may need to contain several sequences of codes. To determine the offset of where to begin processing codes, use the following logic:
-1. If unwinding from within the body of the function, begin executing unwind codes at index 0 and continue until hitting an "end" opcode.
+1. If unwinding from within the body of the function, begin executing unwind codes at index 0 and continue until hitting an `end` opcode.
1. If unwinding from within an epilog, use the epilog-specific starting index provided with the epilog scope as a starting point. Compute how many bytes the PC in question is from the start of the epilog. Then advance forward through the unwind codes, skipping unwind codes until all of the already-executed instructions are accounted for. Then execute starting at that point.
@@ -427,11 +448,11 @@ These rules mean the unwind codes for the prolog must always be the first in the
### Function fragments
-For code optimization purposes and other reasons, it may be preferable to split a function into separated fragments (also called regions). When split, each resulting function fragment requires its own separate .pdata (and possibly .xdata) record.
+For code optimization purposes and other reasons, it may be preferable to split a function into separated fragments (also called *regions*). When split, each resulting function fragment requires its own separate `.pdata` (and possibly `.xdata`) record.
-For each separated secondary fragment that has its own prolog, it's expected that no stack adjustment is done in its prolog. All stack space required by a secondary region must be pre-allocated by its parent region (or called host region). This keeps stack pointer manipulation strictly in the function's original prolog.
+For each separated secondary fragment that has its own prolog, it's expected that no stack adjustment is done in its prolog. All stack space required by a secondary region must be pre-allocated by its parent region (or called host region). This preallocation keeps stack pointer manipulation strictly in the function's original prolog.
-A typical case of function fragments is "code separation" with that compiler may move a region of code out of its host function. There are three unusual cases that could be resulted by code separation.
+A typical case of function fragments is "code separation", where the compiler may move a region of code out of its host function. There are three unusual cases that could result from code separation.
#### Example
@@ -468,19 +489,19 @@ A typical case of function fragments is "code separation" with that compiler may
1. Prolog only (region 1: all epilogs are in separated regions):
- Only the prolog must be described. This can't be represented in the compact .pdata format. In the full .xdata case, it can be represented by setting Epilog Count = 0. See region 1 in the example above.
+ Only the prolog must be described. This prolog can't be represented in the compact `.pdata` format. In the full `.xdata` case, it can be represented by setting Epilog Count = 0. See region 1 in the example above.
Unwind codes: `set_fp`, `save_regp 0,240`, `save_fplr_x_256`, `end`.
1. Epilogs only (region 2: prolog is in host region)
- It's assumed that by the time control jumping into this region, all prolog codes have been executed. Partial unwind can happen in epilogs the same way as in a normal function. This type of region can't be represented by compact .pdata. In full .xdata record, it can be encoded with a "phantom" prolog, bracketed by an `end_c` and `end` unwind code pair. The leading `end_c` indicates the size of prolog is zero. Epilog start index of the single epilog points to `set_fp`.
+ It's assumed that by the time control jumps into this region, all prolog codes have been executed. Partial unwind can happen in epilogs the same way as in a normal function. This type of region can't be represented by compact `.pdata`. In a full `.xdata` record, it can be encoded with a "phantom" prolog, bracketed by an `end_c` and `end` unwind code pair. The leading `end_c` indicates the size of prolog is zero. Epilog start index of the single epilog points to `set_fp`.
Unwind code for region 2: `end_c`, `set_fp`, `save_regp 0,240`, `save_fplr_x_256`, `end`.
1. No prologs or epilogs (region 3: prologs and all epilogs are in other fragments):
- Compact .pdata format can be applied via setting Flag = 10. With full .xdata record, Epilog Count = 1. Unwind code is the same as the code for region 2 above, but Epilog Start Index also points to `end_c`. Partial unwind will never happen in this region of code.
+ Compact `.pdata` format can be applied via setting Flag = 10. With full `.xdata` record, Epilog Count = 1. Unwind code is the same as the code for region 2 above, but Epilog Start Index also points to `end_c`. Partial unwind will never happen in this region of code.
Another more complicated case of function fragments is "shrink wrapping." The compiler may choose to delay saving some callee-saved registers until outside of the function entry prolog.
@@ -515,17 +536,17 @@ Another more complicated case of function fragments is "shrink wrapping." The co
In the prolog of region 1, stack space is pre-allocated. You can see that region 2 will have the same unwind code even it's moved out of its host function.
-Region 1: `set_fp`, `save_regp 0,240`, `save_fplr_x_256`, `end` with Epilog Start Index points to `set_fp` as usual.
+Region 1: `set_fp`, `save_regp 0,240`, `save_fplr_x_256`, `end`. Epilog Start Index points to `set_fp` as usual.
Region 2: `save_regp 2, 224`, `end_c`, `set_fp`, `save_regp 0,240`, `save_fplr_x_256`, `end`. Epilog Start Index points to first unwind code `save_regp 2, 224`.
### Large functions
-Fragments can be used to describe functions larger than the 1M limit imposed by the bit fields in the .xdata header. To describe a very large function like this, it needs to be broken into fragments smaller than 1M. Each fragment should be adjusted so that it doesn't split an epilog into multiple pieces.
+Fragments can be used to describe functions larger than the 1M limit imposed by the bit fields in the `.xdata` header. To describe an unusually large function like this, it needs to be broken into fragments smaller than 1M. Each fragment should be adjusted so that it doesn't split an epilog into multiple pieces.
Only the first fragment of the function will contain a prolog; all other fragments are marked as having no prolog. Depending on the number of epilogs present, each fragment may contain zero or more epilogs. Keep in mind that each epilog scope in a fragment specifies its starting offset relative to the start of the fragment, not the start of the function.
-If a fragment has no prolog and no epilog, it still requires its own .pdata (and possibly .xdata) record, to describe how to unwind from within the body of the function.
+If a fragment has no prolog and no epilog, it still requires its own `.pdata` (and possibly `.xdata`) record, to describe how to unwind from within the body of the function.
## Examples
@@ -538,7 +559,7 @@ If a fragment has no prolog and no epilog, it still requires its own .pdata (and
sub sp,sp,#0x810 // alloc_m
stp fp,lr,[sp] // save_fplr
mov fp,sp // set_fp
- // end of prolog
+ // end of prolog
...
|$pdata$Foo|
@@ -624,5 +645,5 @@ Epilog Start Index [4] points to the middle of Prolog unwind code (partially reu
## See also
-[Overview of ARM64 ABI conventions](arm64-windows-abi-conventions.md)
-[ARM Exception Handling](arm-exception-handling.md)
+[Overview of ARM64 ABI conventions](arm64-windows-abi-conventions.md)\
+[ARM exception handling](arm-exception-handling.md)
diff --git a/docs/build/arm64-windows-abi-conventions.md b/docs/build/arm64-windows-abi-conventions.md
index e3fb94d10c..db01bfefe2 100644
--- a/docs/build/arm64-windows-abi-conventions.md
+++ b/docs/build/arm64-windows-abi-conventions.md
@@ -1,15 +1,15 @@
---
description: "Learn more about: Overview of ARM64 ABI conventions"
title: "Overview of ARM64 ABI conventions"
-ms.date: "03/27/2019"
+ms.date: 04/08/2025
---
# Overview of ARM64 ABI conventions
-The basic application binary interface (ABI) for Windows when compiled and run on ARM processors in 64-bit mode (ARMv8 or later architectures), for the most part, follows ARM's standard AArch64 EABI. This article highlights some of the key assumptions and changes from what is documented in the EABI. For information about the 32-bit ABI, see [Overview of ARM ABI conventions](overview-of-arm-abi-conventions.md). For more information about the standard ARM EABI, see [Application Binary Interface (ABI) for the ARM Architecture](https://github.com/ARM-software/abi-aa) (external link).
+The basic application binary interface (ABI) for Windows when compiled and run on ARM processors in 64-bit mode (ARMv8 or later architectures), usually follows ARM's standard AArch64 EABI. This article highlights some of the key assumptions and changes from what is documented in the EABI. For information about the 32-bit ABI, see [Overview of ARM ABI conventions](overview-of-arm-abi-conventions.md). For more information about the standard ARM EABI, see [Application Binary Interface (ABI) for the ARM Architecture](https://github.com/ARM-software/abi-aa) (external link).
## Definitions
-With the introduction of 64-bit support, ARM has defined several terms:
+With the introduction of 64-bit support, ARM defined several terms:
- **AArch32** – the legacy 32-bit instruction set architecture (ISA) defined by ARM, including Thumb mode execution.
- **AArch64** – the new 64-bit instruction set architecture (ISA) defined by ARM.
@@ -19,8 +19,9 @@ With the introduction of 64-bit support, ARM has defined several terms:
Windows also uses these terms:
- **ARM** – refers to the 32-bit ARM architecture (AArch32), sometimes referred to as WoA (Windows on ARM).
-- **ARM32** – same as ARM, above; used in this document for clarity.
+- **ARM32** – same as **ARM**. Used in this document for clarity.
- **ARM64** – refers to the 64-bit ARM architecture (AArch64). There's no such thing as WoA64.
+- **ARM64EC** - code built as ARM64EC can interoperate with x64 code running under emulation in the same process. The Arm64EC code in the process runs with native performance, while the x64 code runs using emulation.
Finally, when referring to data types, the following definitions from ARM are referenced:
@@ -30,7 +31,7 @@ Finally, when referring to data types, the following definitions from ARM are re
## Base requirements
-The ARM64 version of Windows presupposes that it's running on an ARMv8 or later architecture at all times. Both floating-point and NEON support are presumed to be present in hardware.
+The ARM64 version of Windows always presupposes that it's running on an ARMv8 or later architecture. Both floating-point and NEON support are presumed to be present in hardware.
The ARMv8 specification describes new optional crypto and CRC helper opcodes for both AArch32 and AArch64. Support for them is currently optional, but recommended. To take advantage of these opcodes, apps should first make runtime checks for their existence.
@@ -66,16 +67,15 @@ Default layout alignment for globals and statics:
The AArch64 architecture supports 32 integer registers:
-| Register | Volatile? | Role |
+| Register | Volatility | Role |
| - | - | - |
-| x0 | Volatile | Parameter/scratch register 1, result register |
-| x1-x7 | Volatile | Parameter/scratch register 2-8 |
-| x8-x15 | Volatile | Scratch registers |
+| x0-x8 | Volatile | Parameter/Result scratch registers |
+| x9-x15 | Volatile | Scratch registers |
| x16-x17 | Volatile | Intra-procedure-call scratch registers |
-| x18 | Non-volatile | Platform register: in kernel mode, points to KPCR for the current processor; in user mode, points to TEB |
+| x18 | N/A | Reserved platform register: in kernel mode, points to KPCR for the current processor; In user mode, points to TEB |
| x19-x28 | Non-volatile | Scratch registers |
| x29/fp | Non-volatile | Frame pointer |
-| x30/lr | Non-volatile | Link registers |
+| x30/lr | Both | Link Register: Callee function must preserve it for its own return, but caller's value is lost. |
Each register may be accessed as a full 64-bit value (via x0-x30) or as a 32-bit value (via w0-w30). 32-bit operations zero-extend their results up to 64 bits.
@@ -87,20 +87,19 @@ The frame pointer (x29) is required for compatibility with fast stack walking us
## Floating-point/SIMD registers
-The AArch64 architecture also supports 32 floating-point/SIMD registers, summarized below:
+The AArch64 architecture also supports these 32 floating-point/SIMD registers:
-| Register | Volatile? | Role |
+| Register | Volatility | Role |
| - | - | - |
-| v0 | Volatile | Parameter/scratch register 1, result register |
-| v1-v7 | Volatile | Parameter/scratch registers 2-8 |
-| v8-v15 | Non-volatile | Scratch registers (only the low 64 bits are non-volatile) |
+| v0-v7 | Volatile | Parameter/Result scratch registers |
+| v8-v15 | Both | Low 64 bits are Non-Volatile. High 64 bits are Volatile. |
| v16-v31 | Volatile | Scratch registers |
Each register may be accessed as a full 128-bit value (via v0-v31 or q0-q31). It may be accessed as a 64-bit value (via d0-d31), as a 32-bit value (via s0-s31), as a 16-bit value (via h0-h31), or as an 8-bit value (via b0-b31). Accesses smaller than 128 bits only access the lower bits of the full 128-bit register. They leave the remaining bits untouched unless otherwise specified. (AArch64 is different from AArch32, where the smaller registers were packed on top of the larger registers.)
The floating-point control register (FPCR) has certain requirements on the various bitfields within it:
-| Bits | Meaning | Volatile? | Role |
+| Bits | Meaning | Volatility | Role |
| - | - | - | - |
| 26 | AHP | Non-Volatile | Alternative half-precision control. |
| 25 | DN | Non-Volatile | Default NaN mode control. |
@@ -120,7 +119,11 @@ Like AArch32, the AArch64 specification provides three system-controlled "thread
## Floating-point exceptions
-Support for IEEE floating-point exceptions is optional on AArch64 systems. For processor variants that do have hardware floating-point exceptions, the Windows kernel silently catches the exceptions and implicitly disables them in the FPCR register. This trap ensures normalized behavior across processor variants. Otherwise, code developed on a platform without exception support may find itself taking unexpected exceptions when running on a platform with support.
+To determine if an ARM CPU supports exceptions, write a value that enables exceptions to the FPCR register and then read it back. If the CPU supports floating-point exceptions, the bits corresponding to supported exceptions remain set, while the CPU resets the bits for unsupported exceptions.
+
+On ARM64, Windows delivers exceptions for processors that support hardware floating-point exceptions.
+
+The [`_set_controlfp`](/cpp/c-runtime-library/reference/controlfp-s) function on ARM platforms correctly changes the FPCR register when unmasking floating-point exceptions. However, instead of raising an unmasked exception, Windows resets the FPCR register to its defaults every time an FP exception is about to be raised.
## Parameter passing
@@ -150,7 +153,7 @@ For each argument in the list, the first matching rule from the following list i
### Stage C – Assignment of arguments to registers and stack
-For each argument in the list, the following rules are applied in turn until the argument has been allocated. When an argument is assigned to a register, any unused bits in the register have unspecified value. If an argument is assigned to a stack slot, any unused padding bytes have unspecified value.
+For each argument in the list, the following rules are applied in turn until the argument is allocated. When an argument is assigned to a register, any unused bits in the register have unspecified value. If an argument is assigned to a stack slot, any unused padding bytes have unspecified value.
1. If the argument is a Half-, Single-, Double- or Quad-precision Floating-point or Short Vector Type, and the NSRN is less than 8, then the argument is allocated to the least significant bits of register v\[NSRN]. The NSRN is incremented by one. The argument has now been allocated.
@@ -160,7 +163,7 @@ For each argument in the list, the following rules are applied in turn until the
1. If the argument is an HFA, an HVA, a Quad-precision Floating-point or Short Vector Type, then the NSAA is rounded up to the larger of 8 or the Natural Alignment of the argument's type.
-1. If the argument is a Half- or Single-precision Floating Point type, then the size of the argument is set to 8 bytes. The effect is as if the argument had been copied to the least significant bits of a 64-bit register, and the remaining bits filled with unspecified values.
+1. If the argument is a Half- or Single-precision Floating Point type, then the size of the argument is set to 8 bytes. The effect is as if the argument were copied to the least significant bits of a 64-bit register, and the remaining bits filled with unspecified values.
1. If the argument is an HFA, an HVA, a Half-, Single-, Double-, or Quad-precision Floating-point or Short Vector Type, then the argument is copied to memory at the adjusted NSAA. The NSAA is incremented by the size of the argument. The argument has now been allocated.
@@ -201,10 +204,10 @@ Floating-point values are returned in s0, d0, or v0, as appropriate.
A type is considered to be an HFA or HVA if all of the following hold:
- It's non-empty,
-- It doesn't have any non-trivial default or copy constructors, destructors, or assignment operators,
+- It doesn't have any nontrivial default or copy constructors, destructors, or assignment operators,
- All of its members have the same HFA or HVA type, or are float, double, or neon types that match the other members' HFA or HVA types.
-HFA and HVA values with four or fewer elements are returned in s0-s3, d0-d3, or v0-v3, as appropriate.
+HVA values with four or fewer elements are returned in s0-s3, d0-d3, or v0-v3, as appropriate.
Types returned by value are handled differently depending on whether they have certain properties, and whether the function is a non-static member function. Types which have all of these properties,
@@ -212,11 +215,12 @@ Types returned by value are handled differently depending on whether they have c
- they have a trivial copy-assignment operator, and
- they have a trivial destructor,
-and are returned by non-member functions or static member functions, use the following return style:
+and are returned by nonmember functions or static member functions, use the following return style:
+- Types that are HFAs with four or fewer elements are returned in s0-s3, d0-d3, or v0-v3, as appropriate.
- Types less than or equal to 8 bytes are returned in x0.
- Types less than or equal to 16 bytes are returned in x0 and x1, with x0 containing the lower-order 8 bytes.
-- For types greater than 16 bytes, the caller shall reserve a block of memory of sufficient size and alignment to hold the result. The address of the memory block shall be passed as an additional argument to the function in x8. The callee may modify the result memory block at any point during the execution of the subroutine. The callee isn't required to preserve the value stored in x8.
+- For other aggregate types, the caller shall reserve a block of memory of sufficient size and alignment to hold the result. The address of the memory block shall be passed as another argument to the function in x8. The callee may modify the result memory block at any point during the execution of the subroutine. The callee isn't required to preserve the value stored in x8.
All other types use this convention:
@@ -224,9 +228,9 @@ All other types use this convention:
## Stack
-Following the ABI put forth by ARM, the stack must remain 16-byte aligned at all times. AArch64 contains a hardware feature that generates stack alignment faults whenever the SP isn't 16-byte aligned and an SP-relative load or store is done. Windows runs with this feature enabled at all times.
+Following the ABI put forth by ARM, the stack must always remain 16-byte aligned. AArch64 contains a hardware feature that generates stack alignment faults whenever the SP isn't 16-byte aligned and an SP-relative load or store is done. Windows always runs with this feature enabled.
-Functions that allocate 4k or more worth of stack must ensure that each page prior to the final page is touched in order. This action ensures no code can "leap over" the guard pages that Windows uses to expand the stack. Typically the touching is done by the `__chkstk` helper, which has a custom calling convention that passes the total stack allocation divided by 16 in x15.
+Functions that allocate 4k or more worth of stack must ensure that each page before the final page is touched in order. This action ensures no code can "leap over" the guard pages that Windows uses to expand the stack. Typically the touching is done by the `__chkstk` helper, which has a custom calling convention that passes the total stack allocation divided by 16 in x15.
## Red zone
@@ -242,7 +246,7 @@ Code within Windows is compiled with frame pointers enabled ([/Oy-](reference/oy
## Exception unwinding
-Unwinding during exception handling is assisted through the use of unwind codes. The unwind codes are a sequence of bytes stored in the .xdata section of the executable. They describe the operation of the prologue and epilogue in an abstract manner, such that the effects of a function's prologue can be undone in preparation for backing up to the caller's stack frame. For more information on the unwind codes, see [ARM64 exception handling](arm64-exception-handling.md).
+Unwinding during exception handling is assisted by using unwind codes. The unwind codes are a sequence of bytes stored in the .xdata section of the executable. They describe the operation of the prologue and epilogue in an abstract manner, such that the effects of a function's prologue can be undone in preparation for backing up to the caller's stack frame. For more information on the unwind codes, see [ARM64 exception handling](arm64-exception-handling.md).
The ARM EABI also specifies an exception unwinding model that uses unwind codes. However, the specification as presented is insufficient for unwinding in Windows, which must handle cases where the PC is in the middle of a function prologue or epilogue.
@@ -252,7 +256,7 @@ Code that is dynamically generated should be described with dynamic function tab
All ARMv8 CPUs are required to support a cycle counter register, a 64-bit register that Windows configures to be readable at any exception level, including user mode. It can be accessed via the special PMCCNTR_EL0 register, using the MSR opcode in assembly code, or the `_ReadStatusReg` intrinsic in C/C++ code.
-The cycle counter here is a true cycle counter, not a wall clock. The counting frequency will vary with the processor frequency. If you feel you must know the frequency of the cycle counter, you shouldn't be using the cycle counter. Instead, you want to measure wall clock time, for which you should use `QueryPerformanceCounter`.
+The cycle counter here is a true cycle counter, not a wall clock. The counting frequency varies with the processor frequency. If you feel you must know the frequency of the cycle counter, you shouldn't be using the cycle counter. Instead, you want to measure wall clock time, for which you should use `QueryPerformanceCounter`.
## See also
diff --git a/docs/build/arm64ec-windows-abi-conventions.md b/docs/build/arm64ec-windows-abi-conventions.md
new file mode 100644
index 0000000000..9c78bc39f5
--- /dev/null
+++ b/docs/build/arm64ec-windows-abi-conventions.md
@@ -0,0 +1,192 @@
+---
+title: "Overview of ARM64EC ABI conventions"
+description: "Learn more about: Overview of ARM64EC ABI conventions"
+ms.date: "06/03/2022"
+---
+# Overview of ARM64EC ABI conventions
+
+ARM64EC is an application binary interface (ABI) that enables ARM64 binaries to run natively and interoperably with x64 code. Specifically, the ARM64EC ABI follows x64 software conventions including calling convention, stack usage, and data alignment, making ARM64EC and x64 code interoperable. The operating system emulates the x64 portion of the binary. (The EC in ARM64EC stands for *emulation compatible*.)
+
+For more information on the x64 and ARM64 ABIs, see [Overview of x64 ABI conventions](x64-software-conventions.md) and [Overview of ARM64 ABI conventions](arm64-windows-abi-conventions.md).
+
+ARM64EC doesn't solve memory model differences between x64 and ARM based architectures. For more information, see [Common Visual C++ ARM migration issues](common-visual-cpp-arm-migration-issues.md).
+
+## Definitions
+
+- **ARM64** - The code stream for ARM64 processes that contains traditional ARM64 code.
+- **ARM64EC** - The code stream that utilizes a subset of the ARM64 register set to provide interoperability with x64 code.
+
+## Register mapping
+
+x64 processes may have threads running ARM64EC code. So it's always possible to retrieve an x64 register context, ARM64EC uses a subset of the ARM64 core registers that map 1:1 to emulated x64 registers. Importantly, ARM64EC never uses registers outside of this subset, except to read the Thread Environment Block (TEB) address from `x18`.
+
+Native ARM64 processes shouldn't regress in performance when some or many functions are recompiled as ARM64EC. To maintain performance, the ABI follows these principles:
+
+- The ARM64EC register subset includes all registers that are part of the ARM64 function calling convention.
+
+- The ARM64EC calling convention directly maps to the ARM64 calling convention.
+
+Special helper routines like `__chkstk_arm64ec` use custom calling conventions and registers. These registers are also included in the ARM64EC subset of registers.
+
+## Register mapping for integer registers
+
+| ARM64EC register | x64 register | ARM64EC calling convention | ARM64 calling convention | x64 calling convention |
+|--|--|--|--|--|
+| `x0` | `rcx` | volatile | volatile | volatile |
+| `x1` | `rdx` | volatile | volatile | volatile |
+| `x2` | `r8` | volatile | volatile | volatile |
+| `x3` | `r9` | volatile | volatile | volatile |
+| `x4` | `r10` | volatile | volatile | volatile |
+| `x5` | `r11` | volatile | volatile | volatile |
+| `x6` | `mm1` (low 64 bits of x87 `R1` register) | volatile | volatile | volatile |
+| `x7` | `mm2` (low 64 bits of x87 `R2` register) | volatile | volatile | volatile |
+| `x8` | `rax` | volatile | volatile | volatile |
+| `x9` | `mm3` (low 64 bits of x87 `R3` register) | volatile | volatile | volatile |
+| `x10` | `mm4` (low 64 bits of x87 `R4` register) | volatile | volatile | volatile |
+| `x11` | `mm5` (low 64 bits of x87 `R5` register) | volatile | volatile | volatile |
+| `x12` | `mm6` (low 64 bits of x87 `R6` register) | volatile | volatile | volatile |
+| `x13` | N/A | disallowed | volatile | N/A |
+| `x14` | N/A | disallowed | volatile | N/A |
+| `x15` | `mm7` (low 64 bits of x87 `R7` register) | volatile | volatile | volatile |
+| `x16` | High 16 bits of each of the x87 `R0`-`R3` registers | volatile(`xip0`) | volatile(`xip0`) | volatile |
+| `x17` | High 16 bits of each of the x87 `R4`-`R7` registers | volatile(`xip1`) | volatile(`xip1`) | volatile |
+| `x18` | GS.base | fixed(TEB) | fixed(TEB) | fixed(TEB) |
+| `x19` | `r12` | non-volatile | non-volatile | non-volatile |
+| `x20` | `r13` | non-volatile | non-volatile | non-volatile |
+| `x21` | `r14` | non-volatile | non-volatile | non-volatile |
+| `x22` | `r15` | non-volatile | non-volatile | non-volatile |
+| `x23` | N/A | disallowed | non-volatile | N/A |
+| `x24` | N/A | disallowed | non-volatile | N/A |
+| `x25` | `rsi` | non-volatile | non-volatile | non-volatile |
+| `x26` | `rdi` | non-volatile | non-volatile | non-volatile |
+| `x27` | `rbx` | non-volatile | non-volatile | non-volatile |
+| `x28` | N/A | disallowed | disallowed | N/A |
+| `fp` | `rbp` | non-volatile | non-volatile | non-volatile |
+| `lr` | `mm0` (low 64 bits of x87 `R0` register) | both | both | both |
+| `sp` | `rsp` | non-volatile | non-volatile | non-volatile |
+| `pc` | `rip` | instruction pointer | instruction pointer | instruction pointer |
+| `PSTATE` subset: `N`/`Z`/`C`/`V`/`SS` 1, 2 | `RFLAGS` subset: `SF`/`ZF`/`CF`/`OF`/`TF` | volatile | volatile | volatile |
+| N/A | `RFLAGS` subset: `PF`/`AF` | N/A | N/A | volatile |
+| N/A | `RFLAGS` subset: `DF` | N/A | N/A | non-volatile |
+
+1 Avoid directly reading, writing or computing mappings between `PSTATE` and `RFLAGS`. These bits may be used in the future and are subject to change.
+
+2 The ARM64EC carry flag `C` is the inverse of the x64 carry flag `CF` for subtraction operations. There's no special handling, because the flag is volatile and is therefore trashed when transitioning between (ARM64EC and x64) functions.
+
+## Register mapping for vector registers
+
+| ARM64EC register | x64 register | ARM64EC calling convention | ARM64 calling convention | x64 calling convention |
+|--|--|--|--|--|
+| `v0`-`v5` | `xmm0`-`xmm5` | volatile | volatile | volatile |
+| `v6`-`v7` | `xmm6`-`xmm7` | volatile | volatile | non-volatile |
+| `v8`-`v15` | `xmm8`-`xmm15` | volatile 1 | volatile 1 | non-volatile |
+| `v16`-`v31` | `xmm16`-`xmm31` | disallowed | volatile | disallowed (x64 emulator doesn't support AVX-512) |
+| `FPCR` 2 | `MXCSR[15:6]` | non-volatile | non-volatile | non-volatile |
+| `FPSR` 2 | `MXCSR[5:0]` | volatile | volatile | volatile |
+
+1 These ARM64 registers are special in that the lower 64 bits are non-volatile but the upper 64 bits are volatile. From the point of view of an x64 caller, they're effectively volatile because the callee would trash data.
+
+2 Avoid directly reading, writing, or computing mappings of `FPCR` and `FPSR`. These bits may be used in the future and are subject to change.
+
+## Struct packing
+
+ARM64EC follows the same struct packing rules used for x64 to ensure interoperability between ARM64EC code and x64 code. For more information and examples of x64 struct packing, see [Overview of x64 ABI conventions](x64-software-conventions.md).
+
+## Floating-point exceptions
+
+To determine if an ARM CPU supports exceptions, write a value that enables exceptions to the FPCR register and then read it back. If the CPU supports floating-point exceptions, the bits corresponding to supported exceptions remain set, while the CPU resets the bits for unsupported exceptions.
+
+On ARM64EC, Windows catches processor floating-point exceptions and disables them in the FPCR register. This ensures consistent behavior across different processor variants.
+
+## Emulation helper ABI routines
+
+ARM64EC code and [thunks](#thunks) use emulation helper routines to transition between x64 and ARM64EC functions.
+
+The following table describes each special ABI routine and the registers the ABI uses. The routines don't modify the listed preserved registers under the ABI column. No assumptions should be made about unlisted registers. On-disk, the ABI routine pointers are null. At load time, the loader updates the pointers to point to the x64 emulator routines.
+
+| Name | Description | ABI |
+|--|--|--|
+| `__os_arm64x_dispatch_call_no_redirect` | Called by an exit thunk to call an x64 target (either an x64 function or an x64 fast-forward sequence). The routine pushes the ARM64EC return address (in the `LR` register) followed by the address of the instruction that succeeds a `blr x16` instruction that invokes the x64 emulator. It then runs the `blr x16` instruction | return value in `x8` (`rax`) |
+| `__os_arm64x_dispatch_ret` | Called by an entry thunk to return to its x64 caller. It pops the x64 return address from the stack and invokes the x64 emulator to jump to it | N/A |
+| `__os_arm64x_check_call` | Called by ARM64EC code with a pointer to an exit thunk and the indirect ARM64EC target address to execute. The ARM64EC target is considered patchable, and execution always returns to the caller with either the same data it was called with, or with modified data | Arguments:
`x9`: The target address
`x10`: The exit thunk address
`x11`: The fast forward sequence address
Out:
`x9`: If the target function was detoured, it contains the address of the fast forward sequence
`x10`: The exit thunk address
`x11`: If the function was detoured, it contains the exit thunk address. Otherwise, the target address jumped to
Preserved registers: `x0`-`x8`, `x15` (`chkstk`). and `q0`-`q7` |
+| `__os_arm64x_check_icall` | Called by ARM64EC code, with a pointer to an exit thunk, to handle a jump to either a target address that is either x64 or ARM64EC. If the target is x64 and the x64 code hasn't been patched, the routine sets the target address register. It points to the ARM64EC version of the function if one exists. Otherwise, it sets the register to point to the exit thunk that transitions to the x64 target. Then, it returns to the calling ARM64EC code, which then jumps to the address in the register. This routine is a non-optimized version of `__os_arm64x_check_call`, where the target address isn't known at compile time
Used at a call-site of an indirect call | Arguments:
`x9`: The target address
`x10`: The exit thunk address
`x11`: The fast forward sequence address
Out:
`x9`: If the target function was detoured, it contains the address of the fast forward sequence
`x10`: The exit thunk address
`x11`: If the function was detoured, it contains the exit thunk address. Otherwise, the target address jumped to
Preserved registers: `x0`-`x8`, `x15` (`chkstk`), and `q0`-`q7` |
+| `__os_arm64x_check_icall_cfg` | Same as `__os_arm64x_check_icall` but also checks that the specified address is a valid Control Flow Graph indirect call target | Arguments:
`x10`: The address of the exit thunk
`x11`: The address of the target function
Out:
`x9`: If the target is x64, the address to the function. Otherwise, undefined
`x10`: The address of the exit thunk
`x11`: If the target is x64, it contains the address of the exit thunk. Otherwise, the address of the function
Preserved registers: `x0`-`x8`, `x15` (`chkstk`), and `q0`-`q7` |
+| `__os_arm64x_get_x64_information` | Gets the requested part of the live x64 register context | `_Function_class_(ARM64X_GET_X64_INFORMATION) NTSTATUS LdrpGetX64Information(_In_ ULONG Type, _Out_ PVOID Output, _In_ PVOID ExtraInfo)` |
+| `__os_arm64x_set_x64_information` | Sets the requested part of the live x64 register context | `_Function_class_(ARM64X_SET_X64_INFORMATION) NTSTATUS LdrpSetX64Information(_In_ ULONG Type,_In_ PVOID Input, _In_ PVOID ExtraInfo)` |
+| `__os_arm64x_x64_jump` | Used in signature-less adjustor and other thunks that directly forward (`jmp`) a call to another function that can have any signature, deferring the potential application of the right thunk to the real target | Arguments:
`x9`: target to jump to
All parameter registers preserved (forwarded) |
+
+## Thunks
+
+Thunks are the low-level mechanisms to support ARM64EC and x64 functions calling each other. There are two types: *entry thunks* for entering ARM64EC functions and *exit thunks* for calling x64 functions.
+
+### Entry thunk and intrinsic entry thunks: x64 to ARM64EC function call
+
+To support x64 callers when a C/C++ function is compiled as ARM64EC, the toolchain generates a single entry thunk consisting of ARM64EC machine code. Intrinsics have an entry thunk of their own. All other functions share an entry thunk with all functions that have a matching calling convention, parameters, and return type. The content of the thunk depends on the calling convention of the C/C++ function.
+
+In addition to handling parameters and the return address, the thunk bridges the differences in volatility between ARM64EC and x64 vector registers caused by [ARM64EC vector register mapping](#register-mapping-for-vector-registers):
+
+| ARM64EC register | x64 register | ARM64EC calling convention | ARM64 calling convention | x64 calling convention |
+|--|--|--|--|--|
+| `v6`-`v15` | `xmm6`-`xmm15` | volatile, but saved/restored in the entry thunk (x64 to ARM64EC) | volatile or partially volatile upper 64 bits | non-volatile |
+
+The entry thunk performs the following actions:
+
+| Parameter number | Stack usage |
+|--|--|
+| 0-4 | Stores ARM64EC `v6` and `v7` into the caller-allocated home space
Since the callee is ARM64EC, which doesn't have the notion of a home space, the stored values aren't clobbered.
Allocates an extra 128 bytes on the stack and store ARM64EC `v8` through `v15`. |
+| 5-8 | `x4` = 5th parameter from the stack
`x5` = 6th parameter from the stack
`x6` = 7th parameter from the stack
`x7` = 8th parameter from the stack
If the parameter is SIMD, the `v4`-`v7` registers are used instead |
+| 9+ | Allocates `AlignUp(NumParams - 8 , 2) * 8` bytes on the stack. \*
Copies the 9th and remaining parameters to this area |
+
+\* Aligning the value to an even number guarantees that the stack remains aligned to 16 bytes
+
+If the function accepts a 32-bit integer parameter, the thunk is permitted to only push 32 bits instead of the full 64 bits of the parent register.
+
+Next, the thunk uses an ARM64 `bl` instruction to call the ARM64EC function. After the function returns, the thunk:
+
+1. Undoes any stack allocations
+1. Calls the `__os_arm64x_dispatch_ret` emulator helper to pop the x64 return address and resume x64 emulation.
+
+### Exit thunk: ARM64EC to x64 function call
+
+For every call that an ARM64EC C/C++ function makes to potential x64 code, the MSVC toolchain generates an exit thunk. The content of the thunk depends on the parameters of the x64 callee and whether the callee is using the standard calling convention or `__vectorcall`. The compiler obtains this information from a function declaration for the callee.
+
+First, The thunk pushes the return address that's in the ARM64EC `lr` register and a dummy 8-byte value to guarantee that the stack is aligned to 16 bytes. Second, the thunk handles the parameters:
+
+| Parameter number | Stack usage |
+|--|--|
+| 0-4 | Allocates 32 bytes of home space on the stack |
+| 5-8 | Allocates `AlignUp(NumParams - 4, 2) * 8` more bytes higher up on the stack. \*
Copies the 5th and any subsequent parameters from ARM64EC's `x4`-`x7` to this extra space |
+| 9+ | Copies the 9th and remaining parameters to the extra space |
+
+\* Aligning the value to an even number guarantees that the stack remains aligned to 16 bytes.
+
+Third, the thunk calls the `__os_arm64x_dispatch_call_no_redirect` emulator helper to invoke the x64 emulator to run the x64 function. The call must be a `blr x16` instruction (conveniently, `x16` is a volatile register). A `blr x16` instruction is required because the x64 emulator parses this instruction as a hint.
+
+The x64 function usually attempts to return to the emulator helper by using an x64 `ret` instruction. At this point, the x64 emulator detects that it's in ARM64EC code. It then reads the preceding 4-byte hint that happens to be the ARM64 `blr x16` instruction. Since this hint indicates that the return address is in this helper, the emulator jumps directly to this address.
+
+The x64 function is permitted to return to the emulator helper using any branch instruction, including x64 `jmp` and `call`. The emulator handles these scenarios as well.
+
+When the helper then returns to the thunk, the thunk:
+
+1. Undoes any stack allocation
+1. Pops the ARM64EC `lr` register
+1. Executes an ARM64 `ret lr` instruction.
+
+## ARM64EC function name decoration
+
+An ARM64EC function name has a secondary decoration applied after any language-specific decoration. For functions with C linkage (whether compiled as C or by using `extern "C"`), a `#` is prepended to the name. For C++ decorated functions, a `$$h` tag is inserted into the name.
+
+```
+foo => #foo
+?foo@@YAHXZ => ?foo@@$$hYAHXZ
+```
+
+## `__vectorcall`
+
+The ARM64EC toolchain currently doesn't support `__vectorcall`. The compiler emits an error when it detects `__vectorcall` usage with ARM64EC.
+
+## See also
+
+[Understanding ARM64EC ABI and assembly code](/windows/arm/arm64ec-abi)\
+[Common Visual C++ ARM migration issues](common-visual-cpp-arm-migration-issues.md)\
+[Decorated names](./reference/decorated-names.md)
diff --git a/docs/build/building-on-the-command-line.md b/docs/build/building-on-the-command-line.md
index f44936dd0b..06332dd523 100644
--- a/docs/build/building-on-the-command-line.md
+++ b/docs/build/building-on-the-command-line.md
@@ -2,7 +2,7 @@
title: "Use the Microsoft C++ toolset from the command line"
description: "Use the Microsoft C++ (MSVC) compiler toolset from the command line outside of the Visual Studio IDE."
ms.custom: "conceptual"
-ms.date: 09/08/2021
+ms.date: 04/07/2022
helpviewer_keywords: ["command-line builds [C++]", "compiling source code [C++], command line", "builds [C++], command-line", "command line [C++], building from", "command line [C++], compilers"]
ms.assetid: 7ca9daed-a003-4162-842d-908f79058365
---
@@ -11,7 +11,7 @@ ms.assetid: 7ca9daed-a003-4162-842d-908f79058365
You can build C and C++ applications on the command line by using tools that are included in Visual Studio. The Microsoft C++ (MSVC) compiler toolset is also downloadable as a standalone package. You don't need to install the Visual Studio IDE if you don't plan to use it.
> [!NOTE]
-> This article is about how to set up an environment to use the individual compilers, linkers, librarian, and other basic tools. The native project build system, MSBuild, does not use the environment as described in this article. For more information on how to use MSBuild from the command line, see [MSBuild on the command line - C++](msbuild-visual-cpp.md).
+> This article is about how to set up an environment to use the individual compilers, linkers, librarian, and other basic tools. The native project build system in Visual Studio, based on MSBuild, doesn't use the environment as described in this article. For more information on how to use MSBuild from the command line, see [MSBuild on the command line - C++](msbuild-visual-cpp.md).
## Download and install the tools
@@ -28,19 +28,19 @@ If you've installed Visual Studio and a C++ workload, you have all the command-l
## How to use the command-line tools
-When you choose one of the C++ workloads in the Visual Studio Installer, it installs the Visual Studio *platform toolset*. A platform toolset has all the C and C++ tools for a specific Visual Studio version. The tools include the C/C++ compilers, linkers, assemblers, and other build tools, and matching libraries. You can use all of these tools at the command line. They're also used internally by the Visual Studio IDE. There are separate x86-hosted and x64-hosted compilers and tools to build code for x86, x64, ARM, and ARM64 targets. Each set of tools for a particular host and target build architecture is stored in its own directory.
+When you choose one of the C++ workloads in the Visual Studio Installer, it installs the Visual Studio *platform toolset*. A platform toolset has all the C and C++ tools for a specific Visual Studio version. The tools include the C/C++ compilers, linkers, assemblers, and other build tools, and matching libraries and header files. You can use all of these tools at the command line. They're also used internally by the Visual Studio IDE. There are separate x86-hosted and x64-hosted compilers and tools to build code for x86, x64, ARM, and ARM64 targets. Each set of tools for a particular host and target build architecture is stored in its own directory.
-To work correctly, the tools require several specific environment variables to be set. These variables are used to add the tools to the path, and to set include file, library file, and SDK locations. To make it easy to set these environment variables, the installer creates customized *command files*, or batch files, during installation. You can run one of these command files to set a specific host and target build architecture, Windows SDK version, and platform toolset. For convenience, the installer also creates shortcuts in your Start menu. The shortcuts start developer command prompt windows by using these command files for specific combinations of host and target. These shortcuts ensure all the required environment variables are set and ready to use.
+To work correctly, the tools require several specific environment variables to be set. These variables are used to add the tools to the path, and to set the locations of include files, library files, and SDKs. To make it easy to set these environment variables, the installer creates customized *command files*, or batch files, during installation. You can run one of these command files to set a specific host and target build architecture, Windows SDK version, and platform toolset. For convenience, the installer also creates shortcuts in your Start menu. The shortcuts open developer command prompt windows by using these command files for specific combinations of host and target. These shortcuts ensure all the required environment variables are set and ready to use.
-The required environment variables are specific to your installation and to the build architecture you choose. They also might be changed by product updates or upgrades. That's why we recommend you use an installed command prompt shortcut or command file, instead of setting the environment variables yourself.
+The required environment variables are specific to your installation and to the build architecture you choose. They also might be changed by product updates or upgrades. This variability is one reason why we recommend you use an installed command prompt shortcut or command file, instead of setting the environment variables yourself.
The toolsets, command files, and shortcuts installed depend on your computer processor and the options you selected during installation. The x86-hosted tools and cross tools that build x86 and x64 code are always installed. If you have 64-bit Windows, the x64-hosted tools and cross tools that build x86 and x64 code are also installed. If you choose the optional C++ Universal Windows Platform tools, then the x86 and x64 tools that build ARM and ARM64 code also get installed. Other workloads may install these and other tools.
## Path and environment variables for command-line builds
-The MSVC command-line tools use the `PATH`, `TMP`, `INCLUDE`, `LIB`, and `LIBPATH` environment variables, and also use other environment variables specific to your installed tools, platforms, and SDKs. Even a simple Visual Studio installation may set twenty or more environment variables. The values of these environment variables are specific to your installation and your choice of build configuration, and can be changed by product updates or upgrades. That's why we strongly recommend that you use a [developer command prompt shortcut](#developer_command_prompt_shortcuts) or one of the [customized command files](#developer_command_file_locations) to set them. We don't recommend you set them in the Windows environment yourself.
+The MSVC command-line tools use the `PATH`, `TMP`, `INCLUDE`, `LIB`, and `LIBPATH` environment variables, and also use other environment variables specific to your installed tools, platforms, and SDKs. Even a simple Visual Studio installation may set twenty or more environment variables. This complexity is why we strongly recommend that you use a [developer command prompt shortcut](#developer_command_prompt_shortcuts) or one of the [customized command files](#developer_command_file_locations). We don't recommend you set these variables in the Windows environment yourself.
-To see which environment variables are set by a developer command prompt shortcut, you can use the `SET` command. Open a plain command prompt window and capture the output of the `SET` command for a baseline. Open a developer command prompt window and capture the output of the `SET` command for comparison. A diff tool such as the one built into the Visual Studio IDE can be useful to compare the environment variables and see what's set by the developer command prompt. For information about the specific environment variables used by the compiler and linker, see [CL Environment Variables](reference/cl-environment-variables.md).
+To see which environment variables are set by a developer command prompt shortcut, you can use the `SET` command. Open a plain command prompt window and capture the output of the `SET` command for a baseline. Open a developer command prompt window and capture the output of the `SET` command for comparison. Use a diff tool such as the one built into Visual Studio to highlight the environment variables set by the developer command prompt. For more information about the compiler and linker environment variables, see [CL environment variables](reference/cl-environment-variables.md).
## Developer command prompt shortcuts
@@ -54,7 +54,7 @@ The command prompt shortcuts are installed in a version-specific Visual Studio f
::: moniker range=">= msvc-160"
-The Start menu folder and shortcut names vary depending on the installed version of Visual Studio. If you set one, they also depend on the installation **Nickname**. For example, suppose you installed Visual Studio 2019, and you gave it a nickname of *Latest*. The developer command prompt shortcut is named **Developer Command Prompt for VS 2019 (Latest)**, in a folder named **Visual Studio 2019**.
+The Start menu folder and shortcut names vary depending on the installed version of Visual Studio. If you set one, they also depend on the installation **Nickname**. For example, suppose you installed Visual Studio 2022, and you gave it a nickname of *Latest*. The developer command prompt shortcut is named **Developer Command Prompt for VS 2022 (Latest)**, in a folder named **Visual Studio 2022**.
::: moniker-end
::: moniker range="msvc-150"
@@ -73,33 +73,41 @@ The Start menu folder and shortcut names vary depending on the installed version
### To open a developer command prompt window
-1. On the desktop, open the Windows **Start** menu, and then scroll to find and open the folder for your version of Visual Studio, for example, **Visual Studio 2019**.
+1. On the desktop, open the Windows **Start** menu. In Windows 11, choose the **All apps** button to open the list of installed apps. In Windows 10, the list is open to the left. Scroll down the list to find and open the folder (not the app) for your version of Visual Studio, for example, **Visual Studio 2022**.
1. In the folder, choose the **Developer Command Prompt** for your version of Visual Studio. This shortcut starts a developer command prompt window that uses the default build architecture of 32-bit, x86-native tools to build 32-bit, x86-native code. If you prefer a non-default build architecture, choose one of the native or cross tools command prompts to specify the host and target architecture.
For an even faster way to open a developer command prompt, enter *developer command prompt* in the desktop search box. Then choose the result you want.
+> [!NOTE]
+> By default, the current working directory in a developer command prompt is the root of your Visual Studio installation in the Program Files directory. This isn't an appropriate location for your code and projects. Change the current working directory to another location before you create a project. The IDE creates projects in your user directory, typically in *%USERPROFILE%\\source\\repos*.
+
## Developer command file locations
If you prefer to set the build environment in an existing command prompt window, you can use one of the command files created by the installer. We recommend you set the environment in a new command prompt window. We don't recommend you later switch environments in the same command window.
-::: moniker range=">= msvc-160"
+::: moniker range=">= msvc-170"
+
+The command file location depends on the version of Visual Studio you installed, and on choices you made during installation. For Visual Studio 2019, the typical installation location on a 64-bit system is in *`\Program Files\Microsoft Visual Studio\2022\`*. The *``* may be Community, Professional, Enterprise, BuildTools, or another nickname you supplied.
+
+::: moniker-end
+::: moniker range="= msvc-160"
-The command file location depends on the version of Visual Studio you installed, and on choices you made during installation. For Visual Studio 2019, the typical installation location on a 64-bit system is in \\Program Files (x86)\\Microsoft Visual Studio\\2019\\*edition*. *Edition* may be Community, Professional, Enterprise, BuildTools, or another nickname you supplied.
+The command file location depends on the version of Visual Studio you installed, and on choices you made during installation. For Visual Studio 2019, the typical installation location on a 64-bit system is in *`\Program Files (x86)\Microsoft Visual Studio\2019\`*. The *``* may be Community, Professional, Enterprise, BuildTools, or another nickname you supplied.
::: moniker-end
::: moniker range="= msvc-150"
-The command file location depends on the version of Visual Studio you installed, and on choices you made during installation. For Visual Studio 2017, the typical installation location on a 64-bit system is in \\Program Files (x86)\\Microsoft Visual Studio\\2017\\*edition*. *Edition* may be Community, Professional, Enterprise, BuildTools, or another nickname you supplied.
+The command file location depends on the version of Visual Studio you installed, and on choices you made during installation. For Visual Studio 2017, the typical installation location on a 64-bit system is in *`\Program Files (x86)\Microsoft Visual Studio\2017\`*. The *``* may be Community, Professional, Enterprise, BuildTools, or another nickname you supplied.
::: moniker-end
::: moniker range="< msvc-150"
-The command file location depends on the Visual Studio version, and the installation directory. For Visual Studio 2015, the typical installation location is in \\Program Files (x86)\\Microsoft Visual Studio 14.0.
+The command file location depends on the Visual Studio version, and the installation directory. For Visual Studio 2015, the typical installation location on a 64-bit system is in *`\Program Files (x86)\Microsoft Visual Studio 14.0`*.
::: moniker-end
-The primary developer command prompt command file, *`VsDevCmd.bat`*, is located in the Common7\\Tools subdirectory. When no parameters are specified, it sets the environment to use the x86-native tools to build 32-bit x86 code.
+The primary developer command prompt command file, *`VsDevCmd.bat`*, is located in the *`Common7\Tools`* subdirectory. When no parameters are specified, it sets the environment to use the x86-native tools to build 32-bit x86 code.
::: moniker range=">= msvc-150"
@@ -139,7 +147,7 @@ When used with no arguments, *`vcvarsall.bat`* configures the environment variab
### `vcvarsall` syntax
-> **`vcvarsall.bat`** [*`architecture`*] [*`platform_type`*] [*`winsdk_version`*] [**`-vcvars_ver=`**_`vcversion`_] [*`spectre_mode`*]
+> **`vcvarsall.bat`** [*`architecture`*] [*`platform_type`*] [*`winsdk_version`*] [**`-vcvars_ver=`***`vcversion`*] [*`spectre_mode`*]
*`architecture`*
This optional argument specifies the host and target architecture to use. If *architecture* isn't specified, the default build environment is used. These arguments are supported:
@@ -246,7 +254,7 @@ Use the compiler (cl.exe) to compile and link source code files into apps, libra
[`Link`](reference/linking.md)
Use the linker (link.exe) to link compiled object files and libraries into apps and DLLs.
-When you build on the command line, the F1 command isn't available for instant help. Instead, you can use a search engine to get information about warnings, errors, and messages. You can also download and use the offline help files. To use the search in docs.microsoft.com, enter your query in the search box at the top of any article.
+When you build on the command line, the F1 command isn't available for instant help. Instead, you can use a search engine to get information about warnings, errors, and messages. You can also download and use the offline help files. To use the search in Microsoft Learn, enter your query in the search box at the top of any article.
## Command-line project management tools
diff --git a/docs/build/clang-support-cmake.md b/docs/build/clang-support-cmake.md
index 6ae9039afb..157c3259d9 100644
--- a/docs/build/clang-support-cmake.md
+++ b/docs/build/clang-support-cmake.md
@@ -21,21 +21,23 @@ You can use Visual Studio with Clang to edit and debug C++ CMake projects that t
**Linux**: For Linux CMake projects, no special Visual Studio support is required. You can install Clang using your distro's package manager, and add the appropriate commands in the CMakeLists.txt file.
## Install
-
::: moniker-end
::: moniker range="msvc-160"
-For the best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have those, you can install them by opening the Visual Studio Installer and choosing **C++ Clang compiler for Windows** under **Desktop development with C++** optional components. When using a custom Clang installation, check the **C++ Clang-cl for v142 build tools** component.
+For the best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have those, you can install them by opening the Visual Studio Installer and choosing **C++ Clang compiler for Windows** under **Desktop development with C++** optional components. You may prefer to use an existing Clang installation on your machine; if so, choose the **C++ Clang-cl for v142 build tools** or **C++ Clang-cl for v143 build tools** component.
+
+
::: moniker-end
::: moniker range="msvc-170"
-For the best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have those, you can install them by opening the Visual Studio Installer and choosing **C++ Clang compiler for Windows** under **Desktop development with C++** optional components. When using a custom Clang installation, check the **C++ Clang-cl for v143 build tools** component.
+For the best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have those, you can install them by opening the Visual Studio Installer and choosing **C++ Clang compiler for Windows** under **Desktop development with C++** optional components. You may prefer to use an existing Clang installation on your machine; if so, choose the **MSBuild support for LLVM (clang-cl) toolset** component.
+
+
::: moniker-end
::: moniker range=">=msvc-160"
-
## Create a new configuration
@@ -82,9 +84,9 @@ You can modify these values in **CMake Settings** under **CMake variables and ca
## Edit, build, and debug
-After you have set up a Clang configuration, you can build and debug the project. Visual Studio detects that you are using the Clang compiler and provides IntelliSense, highlighting, navigation, and other editing features. Errors and warnings are displayed in the **Output Window**.
+After you have set up a Clang configuration, you can build and debug the project. Visual Studio detects that you're using the Clang compiler and provides IntelliSense, highlighting, navigation, and other editing features. Errors and warnings are displayed in the **Output Window**.
-When debugging, you can use breakpoints, memory and data visualization, and most other debugging features. Some compiler-dependent features such as Edit and Continue are not available for Clang configurations.
+When debugging, you can use breakpoints, memory and data visualization, and most other debugging features. Some compiler-dependent features such as Edit and Continue aren't available for Clang configurations.

diff --git a/docs/build/clang-support-msbuild.md b/docs/build/clang-support-msbuild.md
index d53368d521..6e44fbb42a 100644
--- a/docs/build/clang-support-msbuild.md
+++ b/docs/build/clang-support-msbuild.md
@@ -1,7 +1,7 @@
---
-description: "Learn more about: Clang/LLVM support in Visual Studio projects"
title: "Clang/LLVM support in Visual Studio projects"
-ms.date: 11/11/2021
+description: "Learn more about: Clang/LLVM support in Visual Studio projects"
+ms.date: 03/13/2024
ms.description: "Configure a Visual Studio MSBuild project to use the Clang/LLVM toolchain."
helpviewer_keywords: ["Clang support for C++ MSBuild projects"]
---
@@ -9,33 +9,57 @@ helpviewer_keywords: ["Clang support for C++ MSBuild projects"]
::: moniker range="<=msvc-150"
-Clang support for both CMake and MSBuild projects is available in Visual Studio 2019.
+Clang/LLVM support for both CMake and MSBuild projects is available in Visual Studio 2019 and Visual Studio 2022.
::: moniker-end
-
::: moniker range=">=msvc-160"
-You can use Visual Studio 2019 version 16.2 and later with Clang to edit, build, and debug C++ Visual Studio projects (MSBuild) that target Windows or Linux.
+You can use Visual Studio 2019 version 16.2 and later with Clang/LLVM to edit, build, and debug C++ Visual Studio projects (MSBuild) that target Windows or Linux.
+
+::: moniker-end
+::: moniker range="=msvc-160"
## Install
-For best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have the tools, you can install them by opening the Visual Studio Installer and choosing **C++ Clang tools for Windows** under **Desktop development with C++** optional components. You may prefer to use an existing Clang installation on your machine; if so, choose **C++ Clang-cl for v142 build tools**.
+For the best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have the tools, you can install them by opening the Visual Studio Installer and choosing **C++ Clang tools for Windows** under **Desktop development with C++** optional components. You may prefer to use an existing Clang installation on your machine; if so, choose **C++ Clang-cl for v142 build tools** or **C++ Clang-cl for v143 build tools**.
+::: moniker-end
+::: moniker range=">=msvc-170"
+## Install
+
+For the best IDE support in Visual Studio, we recommend using the latest Clang compiler tools for Windows. If you don't already have the tools, you can install them by opening the Visual Studio Installer and choosing **C++ Clang tools for Windows** under **Desktop development with C++** optional components. You may prefer to use an existing Clang installation on your machine; if so, choose **MSBuild support for LLVM (clang-cl) toolset**.
+::: moniker-end
+::: moniker range=">=msvc-160"
The Microsoft C++ Standard Library requires at least Clang 8.0.0.
+::: moniker-end
+
+::: moniker range="=msvc-160"
+:::image type="complex" source="media/clang-install-vs2019.png" alt-text="Screenshot of the Visual Studio 2019 installer":::
+The Individual components tab is selected in the installer. C++ Clang Compiler for Windows is selected. C++ Clang-cl for v142 build tools (x64/x86) is also selected.
+:::image-end:::
+
+::: moniker-end
+::: moniker range=">=msvc-170"
+:::image type="complex" source="media/clang-install-vs2022.png" alt-text="Screenshot of the Visual Studio 2022 installer."
+The Individual components tab is selected in the installer. C++ Clang Compiler for Windows is selected. MSBuild support for LLVM (clang-cl) toolset is also selected.
+::: image-end :::
-
+::: moniker-end
-Later versions of Visual Studio provide newer versions of the Clang toolset. The bundled version of Clang gets updated automatically to stay current with updates in the Microsoft implementation of the Standard Library. For example, Visual Studio 2019 version 16.9 includes Clang v11.
+::: moniker range=">=msvc-160"
+Later versions of Visual Studio provide newer versions of the Clang toolset. The bundled version of Clang gets updated automatically to stay current with updates in the Microsoft implementation of the Standard Library. For example, Visual Studio 2019 version 16.11 includes Clang v12.
## Configure a Windows project to use Clang tools
To configure a Visual Studio project to use Clang, right-click on the project node in **Solution Explorer** and choose **Properties**. Typically, you should first choose **All configurations** at the top of the dialog. Then, under **General** > **Platform Toolset**, choose **LLVM (clang-cl)** and then **OK**.
-
+:::image type="complex" source="media/llvm-msbuild-prop-page.png" alt-text="Screenshot of the Visual Studio project Property Pages dialog box.":::
+The project properties page is open to the Configuration Properties > General page. The Platform Toolset dropdown is selected, on which LLVM (clang-cl) is selected.
+:::image-end:::
-If you're using the Clang tools that are bundled with Visual Studio, no extra steps are required. For Windows projects, Visual Studio by default invokes Clang in [clang-cl](https://llvm.org/devmtg/2014-04/PDFs/Talks/clang-cl.pdf) mode. It links with the Microsoft implementation of the Standard Library. By default, **clang-cl.exe** is located in *%VCINSTALLDIR%\\Tools\\Llvm\\bin\\* and *%VCINSTALLDIR%\\Tools\\Llvm\\x64\\bin\\*.
+If you're using the Clang tools that are bundled with Visual Studio, no extra steps are required. For Windows projects, Visual Studio by default invokes Clang in [clang-cl](https://llvm.org/devmtg/2014-04/PDFs/Talks/clang-cl.pdf) mode. It links with the Microsoft implementation of the Standard Library. By default, **clang-cl.exe** is located in *`%VCINSTALLDIR%\Tools\Llvm\bin\`* and *`%VCINSTALLDIR%\Tools\Llvm\x64\bin\`*.
-If you're using a custom Clang installation, you can either modify **Project** > **Properties** > **VC++ Directories** > **Configuration Properties** > **Executable Directories** by adding the custom Clang installation root as the first directory there, or change the value of the `LLVMInstallDir` property. For more information, see [Set a custom LLVM location](#custom_llvm_location).
+If you're using a custom Clang installation, you can change the value of the `LLVMInstallDir` property. For more information, see [Set a custom LLVM location](#custom_llvm_location).
## Configure a Linux project to use Clang tools
@@ -48,33 +72,34 @@ To configure a Visual Studio Linux project to use Clang:
1. Under **General** > **Platform Toolset**, choose **Clang for Windows Subsystem for Linux** if you're using Windows Subsystem for Linux (WSL). Choose **Clang for Remote Linux** if you're using a remote machine or VM.
1. Press **OK**.
-
+:::image type="complex" source="media/clang-msbuild-prop-page.png" alt-text="Screenshot of the Visual Studio 2019 project Property Pages dialog box":::
+The project properties page is open to the Configuration Properties > General page. Platform Toolset is selected and from the list of options, LLVM (clang- c l) is selected."
+:::image-end:::
On Linux, Visual Studio by default uses the first Clang location that it finds in the PATH environment property. If you're using a custom Clang installation, then either change the value of the `LLVMInstallDir` property or else enter the path under **Project** > **Properties** > **Configuration Properties** > **VC++ DIrectories** > **Executable Directories**. For more information, see [Set a custom LLVM location](#custom_llvm_location).
-## Set a custom LLVM location
+## Set a custom LLVM location and toolset
-You can set a custom path to LLVM for one or more projects by creating a *Directory.build.props* file. Then, add that file to the root folder of any project. You can add it to the root solution folder to apply it to all projects in the solution. The file should look like this (but use your actual LLVM path):
+To set a custom path to LLVM and set a custom LLVM toolset version for one or more projects, create a *Directory.build.props* file. Then, add that file to the root folder of any project. You can add it to the root solution folder to apply it to all projects in the solution. The file should look like this example (but use your actual LLVM path and version number):
```xml
C:\MyLLVMRootDir
+ 15.0.0
```
-You can combine this property with a custom LLVM toolset version. For more information, see [Set a custom LLVM toolset version](#custom_llvm_toolset).
-
-## Set a custom LLVM toolset version
+## Set a custom LLVM toolset version in the IDE
-Starting in Visual Studio 2019 version 16.9, you can set a custom toolset version for LLVM. To set this property in a project in Visual Studio:
+Starting in Visual Studio 2019 version 16.9, you can set a custom toolset version for LLVM in Visual Studio. To set this property in a project:
-1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](./working-with-project-properties.md).
+1. Open the project's **Property Pages** dialog box. For more information, see [Set C++ compiler and build properties](./working-with-project-properties.md).
1. Select the **Configuration Properties** > **General** property page.
-1. Modify the **Platform Toolset** property to *LLVM (clang-cl)*, if it isn't already set.
+1. Modify the **Platform Toolset** property to *LLVM (clang-cl)*, if it isn't already set. Choose **Apply** to save your changes.
1. Select the **Configuration Properties** > **Advanced** property page.
@@ -82,35 +107,16 @@ Starting in Visual Studio 2019 version 16.9, you can set a custom toolset versio
The **LLVM Toolset Version** property only appears when the LLVM platform toolset is selected.
-You can set the toolset version for one or more projects by creating a *Directory.build.props* file. Then, add that file to the root folder of any project. Add it to the root solution folder to apply it to all projects in the solution. The file should look like this (but use your actual LLVM path):
-
-```xml
-
-
- 11.0.0
-
-
-```
-
-You can also combine this property with a custom LLVM location. For example, your *Directory.build.props* file could look like:
-
-```xml
-
-
- C:\MyLLVMRootDir
- 11.0.0
-
-
-```
-
-When you add a *Directory.build.props* file, the settings appear as the default in the project Property Pages dialog. However, changes to these properties in Visual Studio override the settings in the *Directory.build.props* file.
+When you add a `Directory.build.props` file to a project or solution, the settings appear as the default in the project Property Pages dialog. However, changes to these properties in Visual Studio override the settings in the `Directory.build.props` file.
-## Set additional properties, edit, build, and debug
+## Set properties, edit, build, and debug
After you have set up a Clang configuration, right-click again on the project node and choose **Reload project**. You can now build and debug the project using the Clang tools. Visual Studio detects that you're using the Clang compiler and provides IntelliSense, highlighting, navigation, and other editing features. Errors and warnings are displayed in the **Output Window**. The project property pages for a Clang configuration are similar to the ones for MSVC. However, some compiler-dependent features such as Edit and Continue aren't available for Clang configurations. You can set a Clang compiler or linker option that isn't available in the property pages. Add it manually in the property pages under **Configuration Properties** > **C/C++ (or Linker)** > **Command Line** > **Additional Options**.
When debugging, you can use breakpoints, memory and data visualization, and most other debugging features.
-
+:::image type="complex" source="media/clang-debug-msbuild.png" alt-text="Screenshot of Visual Studio debugging a sample app":::
+The portion of the app that is visible creates a string vector and adds some strings to it. Execution has stopped on a breakpoint for the code: v.push_back("Clang/LLVM");.
+:::image-end:::
::: moniker-end
diff --git a/docs/build/cmake-presets-json-reference.md b/docs/build/cmake-presets-json-reference.md
index 51259d2de8..07b08b79e8 100644
--- a/docs/build/cmake-presets-json-reference.md
+++ b/docs/build/cmake-presets-json-reference.md
@@ -1,7 +1,7 @@
---
description: "Schema reference for `CMakePresets.json` and `CMakeUserPresets.json` Microsoft vendor maps"
title: "CMakeUserPresets.json"
-ms.date: 08/03/2021
+ms.date: 02/07/2022
helpviewer_keywords: ["CMake in Visual C++"]
---
# `CMakePresets.json` and `CMakeUserPresets.json` Microsoft vendor maps
@@ -30,13 +30,13 @@ The options in the Visual Studio Settings vendor map don't affect the constructi
|--|--|
| `hostOS` | An array of supported operating systems (OS). Accepted values are `Windows`, `Linux`, and `macOS`.
The value of `hostOS` is used by Visual Studio and Visual Studio Code to hide Configure Presets that don't apply to the OS of the target system and provide a better user experience.
If `hostOS` is unspecified, then Visual Studio and Visual Studio Code will always show all Configure Presets for selection. This field can also be a string, which is equivalent to an array containing one string
This option is supported by both Visual Studio and Visual Studio Code. |
| `intelliSenseMode` | Specifies the mode used for computing IntelliSense information in Visual Studio with the format `--`.
Accepted values:
`android-clang-arm`
`android-clang-arm64`
`android-clang-x6`
`android-clang-x86`
`ios-clang-ar`
`ios-clang-arm64`
`ios-clang-x6`
`ios-clang-x86`
`linux-gcc-arm`
`linux-gcc-x64`
`linux-gcc-x86`
`windows-clang-arm`
`windows-clang-arm64`
`windows-clang-x64`
`windows-clang-x86`
`windows-msvc-arm`
`windows-msvc-arm64`
`windows-msvc-x64`
`windows-msvc-x86`
If `intelliSenseMode` is unspecified, then Visual Studio uses the IntelliSense mode that matches your specified compilers and target architecture. `intelliSenseMode` is often used to provide improved IntelliSense for cross-compilation.
In Visual Studio 2019, you must explicitly specify a clang IntelliSense mode when building with clang or clang-cl. |
-| `intelliSenseOptions` | A map of extra IntelliSense configuration options.
`useCompilerDefaults`: A `bool` that specifies whether to use the compilers’ default defines and include paths for IntelliSense. Should only be `false` if the compilers in use don't support gcc-style arguments. Defaults to `true`.
`additionalCompilerArgs`: An array of extra options to control IntelliSense in Visual Studio. This option supports macro expansion. |
+| `intelliSenseOptions` | A map of extra IntelliSense configuration options.
`useCompilerDefaults`: A `bool` that specifies whether to use the compiler default defines and include paths for IntelliSense. Should only be `false` if the compilers in use don't support gcc-style arguments. Defaults to `true`.
`additionalCompilerArgs`: An array of extra options to control IntelliSense in Visual Studio. This option supports macro expansion. |
| `enableMicrosoftCodeAnalysis` | A `bool` that enables Microsoft code analysis in Visual Studio when building with `cl` or `clang-cl`. Defaults to `false`. |
| `codeAnalysisRuleset` | Specifies the ruleset to use when running Microsoft code analysis in Visual Studio. You can use a path to a ruleset file, or the name of a ruleset file installed with Visual Studio. This option supports macro expansion. |
| `disableExternalAnalysis` | A `bool` that specifies whether code analysis should run on external headers in Visual Studio. |
| `codeAnalysisExternalRuleset` | Specifies the ruleset to use when running Microsoft code analysis on external header in Visual Studio. You can use a path to a ruleset file, or the name of a ruleset file installed with Visual Studio. This option supports macro expansion. |
| `enableClangTidyCodeAnalysis` | A bool that enables clang-tidy code analysis in Visual Studio when building with `clang-cl`. Defaults to `false`. |
-| `clangTidyChecks` | A comma-separated list of warnings passed to clang-tidy when running clang-tidy code analysis in Visual Studio. Wildcards are allowed, and the `–` prefix will remove checks. |
+| `clangTidyChecks` | A comma-separated list of warnings passed to clang-tidy when running clang-tidy code analysis in Visual Studio. Wildcards are allowed, and the `-` prefix will remove checks. |
| `cacheRoot` | Specifies the path to a CMake cache. This directory should contain an existing *`CMakeCache.txt`* file. This key is only supported by the Open Existing Cache scenario in Visual Studio. This option supports macro expansion. |
| `cmakeGenerateCommand` | A command-line tool (specified as a command-line program and arguments, for example, **`gencache.bat debug`**) to generate the CMake cache. This command runs in the shell using the specified environment of the preset when CMake configure is invoked. This key is only supported by the [Open Existing Cache](https://devblogs.microsoft.com/cppblog/open-existing-cmake-caches-in-visual-studio/) scenario in Visual Studio. This option supports macro expansion. |
diff --git a/docs/build/cmake-presets-vs.md b/docs/build/cmake-presets-vs.md
index a7457a5a29..8aface6d9b 100644
--- a/docs/build/cmake-presets-vs.md
+++ b/docs/build/cmake-presets-vs.md
@@ -1,7 +1,7 @@
---
title: Configure and build with CMake Presets
description: "Reference for using CMake Presets to configure and build CMake projects."
-ms.date: 12/15/2021
+ms.date: 06/09/2023
ms.topic: reference
---
@@ -21,22 +21,31 @@ We recommend *`CMakePresets.json`* as an alternative to *`CMakeSettings.json`*.
## Supported CMake and *`CMakePresets.json`* versions
-Visual Studio supports version 2 or later for the *`CMakePresets.json`* and *`CMakeUserPresets.json`* files. You can update your file version by incrementing the version field in the root object. For an example and more information, see [`CMakePresets.json` format](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#format).
+The supported *`CMakePresets.json`* and *`CMakeUserPresets.json`* schema versions depend on your version of Visual Studio:
+- Visual Studio 2019 version 16.10 and later support schema versions 2 and 3.
+- Visual Studio 2022 version 17.4 preview 1 adds support for schema version 4.
+- Visual Studio 2022 version 17.5 preview 1 adds support for schema version 5.
-CMake version 3.20 or later is required when you're invoking CMake with *`CMakePresets.json`* (version 2 or later) from the command line. However, Visual Studio reads and evaluates *`CMakePresets.json`* and *`CMakeUserPresets.json`* itself and doesn't invoke CMake directly with the `--preset` option. So, CMake version 3.20 or later isn't strictly required when you're building with *`CMakePresets.json`* inside Visual Studio. We recommend using CMake version 3.14 or later.
+You can update the version by changing the `"version"` field in the root object. For an example and more information, see [`CMakePresets.json` format](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#format).
-## Enable *`CMakePresets.json`* integration in Visual Studio
+CMake version 3.20 or later is required when you're invoking CMake with *`CMakePresets.json`* from the command line. However, Visual Studio reads and evaluates *`CMakePresets.json`* and *`CMakeUserPresets.json`* itself and doesn't invoke CMake directly with the `--preset` option. So, CMake version 3.20 or later isn't strictly required when you're building with *`CMakePresets.json`* inside Visual Studio.
+
+We recommend using at least CMake version 3.14 or later.
+
+## Enable *`CMakePresets.json`* integration in Visual Studio
*`CMakePresets.json`* integration isn't enabled by default in Visual Studio. You can enable it in **Tools** > **Options** > **CMake** > **General**:
-
+:::image type="complex" source="./media/enable-cmakepresets-new.png" alt-text="Screenshot showing 'Always use CMakePresets.json' selected.":::
+This screen is reached from the Visual Studio 2022 menu: Tools > Options > CMake > General. The option is under the CMake configure file section.
+:::image-end:::
-> [!Important]
+> [!IMPORTANT]
> Close and reopen the folder in Visual Studio to activate the integration.
-In Visual Studio 2022 and Visual Studio 2019 version 16.10 and later, **Tools** > **Options** > **CMake** > **General** has a single option to enable *`CMakePresets.json`* integration.
+In some older versions of Visual Studio, **Tools** > **Options** > **CMake** > **General** only has a single option to enable *`CMakePresets.json`* integration:
-
+:::image type="content" source="./media/enable-cmakepresets.png" alt-text="Screenshot of an older version of Visual Studio. There is a checkbox labeled 'Use C Make Presets .json to drive CMake configure, build, and test.'":::
The following table indicates when *`CMakePresets.json`* is used instead of *`CMakeSettings.json`* to drive CMake configuration and build in Visual Studio 2022 and Visual Studio 2019 version 16.10 and later. If no configuration file is present, default Configure Presets are used.
@@ -110,15 +119,17 @@ If you try to open or modify a *`CMakePresets.json`* file that doesn't exist, Vi
## Configure and build
-Visual Studio provides dropdown lists for the Target Systems, Configure Presets, and Build Presets when *`CMakePresets.json`* integration is enabled:
+On the Visual Studio toolbar, there are dropdowns for the Target Systems, Configure Presets, and Build Presets when *`CMakePresets.json`* integration is enabled:
-
+:::image type="content" source="./media/target-system-dropdown.png" alt-text="Screenshot showing the dropdowns for target system set to Local Machine, configuration set to windows-arm64, and build preset set to default.":::
### Select a Target System
The dropdown list on the left indicates the active *Target System*. It's the system on which CMake is invoked to configure and build the project. This dropdown list includes your local machine, all SSH connections in Connection Manager by host name, and all Windows Subsystem for Linux (WSL) installations that Visual Studio can find:
-
+:::image type="complex" source="./media/target-system-selections.png" alt-text="Screenshot of the Target System dropdown list":::
+The dropdown list contains several entries including Local Machine, an ip address 192.168.0.5, WSL: ubuntu2004, WSL: debian, and Manage Connections.
+:::image-end:::
In the preceding example:
@@ -177,7 +188,7 @@ Use a forward slash (`/`) for paths in *`CMakePresets.json`* and *`CMakeUserPres
To add a new Configure Preset to *`CMakePresets.json`*, from **Solution Explorer**, right-click *`CMakePresets.json`* from **Folder View** and select **Add Configuration** from the shortcut menu. The dialog to select a Configure Preset template appears:
-
+:::image type="content" source="./media/add-configure-preset-to-cmakepresets.png" alt-text="Screenshot of the Add Configure Preset to the JSON file dialog. It contains entries such as Linux Debug, macOS Debug, x64 Debug, and so on.":::
Select the **Windows x64 Debug** template to configure on Windows systems. Select the **Linux Debug** template to configure on WSL and remote Linux systems. For more information about editing *`CMakePresets.json`*, see [Edit presets](#edit-presets).
@@ -283,7 +294,7 @@ You can set the host architecture (x64 or x86) and toolset by using `toolset.val
The `architecture.strategy` and `toolset.strategy` values tell CMake how to handle the architecture and toolset fields. `set` means CMake sets the respective value, and `external` means CMake won't set the respective value.
-We recommend you use `set` with IDE generators like the Visual Studio Generator. Use `external` with command-line generators like Ninja. These values allow vendors like Visual Studio to supply the required environment before CMake is invoked. For more information about the architecture and toolset fields, see the [list of Configure Presets](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#configure-preset).
+We recommend using `set` with IDE generators like the Visual Studio Generator. Use `external` with command-line generators like Ninja. These values allow vendors like Visual Studio to supply the required environment before CMake is invoked. For more information about the architecture and toolset fields, see the [list of Configure Presets](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#configure-preset).
If you don't want to source an environment, you can set `architecture.strategy` to `external` and `architecture.value` to `unspecified`. You might find it useful not to source an environment for any one of these reasons:
@@ -376,9 +387,9 @@ Instead, set the path to `vcpkg.cmake` by using the `VCPKG_ROOT` environment var
},
```
-`VCPKG_ROOT` should be set to the root of your vcpkg installation. For more information, see [vcpkg environment variables](https://github.com/microsoft/vcpkg/blob/master/docs/users/config-environment.md).
+`VCPKG_ROOT` should be set to the root of your vcpkg installation. For more information, see [vcpkg environment variables](/vcpkg/users/config-environment).
-If you're already using a CMake toolchain file and want to enable vcpkg integration, see [Using multiple toolchain files](https://github.com/microsoft/vcpkg/blob/master/docs/users/integration.md#using-multiple-toolchain-files). Follow those instructions to use an external toolchain file with a project by using vcpkg.
+If you're already using a CMake toolchain file and want to enable vcpkg integration, see [Using multiple toolchain files](/vcpkg/users/buildsystems/cmake-integration#using-multiple-toolchain-files). Follow those instructions to use an external toolchain file with a project by using vcpkg.
## Variable substitution in *`launch.vs.json`* and *`tasks.vs.json`*
@@ -467,15 +478,15 @@ cmake --build --preset
## Example *`CMakePresets.json`* file
-The *`CMakePresets.json`* file in [box2d-lite](https://github.com/esweet431/box2d-lite/blob/vs-launch/CMakePresets.json) contains examples of Configure Presets, Build Presets, and Test Presets.
+The *`CMakePresets.json`* file in [box2d-lite](https://github.com/esweet431/box2d-lite/blob/vs-launch/CMakePresets.json) contains examples of Configure Presets, Build Presets, and Test Presets. For more information about this example, see the presentation [An Introduction to CMakePresets.json](/events/cpp-pure-virtual-cpp-2021/an-introduction-to-cmakepresetsjson). You can see another example in the [DirectXTK](https://github.com/microsoft/DirectXTK/blob/main/CMakePresets.json) project, which shows many build targets in its `configurePresets` section.
## Next steps
Learn more about configuring and debugging CMake projects in Visual Studio:
> [!div class="nextstepaction"]
-> [CMake Projects in Visual Studio](cmake-projects-in-visual-studio.md)
-> [Customize CMake build settings](customize-cmake-settings.md)
-> [Configure CMake debugging sessions](configure-cmake-debugging-sessions.md)
+> [CMake Projects in Visual Studio](cmake-projects-in-visual-studio.md)\
+> [Customize CMake build settings](customize-cmake-settings.md)\
+> [Configure CMake debugging sessions](configure-cmake-debugging-sessions.md)\
> [CMake predefined configuration reference](cmake-predefined-configuration-reference.md)
>
diff --git a/docs/build/cmake-projects-in-visual-studio.md b/docs/build/cmake-projects-in-visual-studio.md
index e1c5afff62..a164d943fe 100644
--- a/docs/build/cmake-projects-in-visual-studio.md
+++ b/docs/build/cmake-projects-in-visual-studio.md
@@ -1,26 +1,28 @@
---
title: "CMake projects in Visual Studio"
-description: "How to create and build C++ projects using CMake in Visual Studio."
-ms.date: 12/15/2021
-helpviewer_keywords: ["CMake in Visual C++"]
-ms.assetid: 444d50df-215e-4d31-933a-b41841f186f8
+description: "Learn how to create and build C++ projects using CMake in Visual Studio."
+ms.date: 03/18/2025
+ms.topic: concept-article
+f1_keywords: ["VS.ToolsOptionsPages.CMake.General", "VS.ToolsOptionsPages.CMake.LanguageServices"]
---
# CMake projects in Visual Studio
[CMake](https://cmake.org) is a cross-platform, open-source tool for defining build processes that run on multiple platforms. This article assumes you're familiar with CMake. For more information about CMake, see the [CMake documentation](https://cmake.org/cmake/help/latest/index.html#). The [CMake tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/index.html#guide:CMake%20Tutorial) is a good starting point to learn more.
> [!NOTE]
-> CMake has become more and more integrated with Visual Studio over the past few releases. To see the documentation for your preferred version of Visual Studio, use the **Version** selector control. It's found at the top of the table of contents on this page.
+> CMake has become more and more integrated with Visual Studio over the past few releases. To see the documentation for your preferred version of Visual Studio, use the **Version** selector located at the top of the table of contents on this page.
::: moniker range=">=msvc-160"
-Visual Studio's native support for CMake enables you to edit, build, and debug CMake projects on Windows, the Windows Subsystem for Linux (WSL), and remote systems from the same instance of Visual Studio. CMake project files (such as *`CMakeLists.txt`*) are consumed directly by Visual Studio for the purposes of IntelliSense and browsing. `cmake.exe` is invoked directly by Visual Studio for CMake configuration and build.
+Visual Studio's native support for CMake allows you to edit, build, and debug CMake projects on Windows, the Windows Subsystem for Linux (WSL), and remote systems from the same instance of Visual Studio. CMake project files (such as *`CMakeLists.txt`*) are consumed directly by Visual Studio for the purposes of IntelliSense and browsing. Visual Studio invokes `cmake.exe` directly for CMake configuration and build.
## Installation
**C++ CMake tools for Windows** is installed as part of the **Desktop development with C++** and **Linux Development with C++** workloads. Both **C++ CMake tools for Windows** and **Linux Development with C++** are required for cross-platform CMake development.
-
+:::image type="complex" source="media/cmake-install-2022.png" alt-text="Screenshot of the Visual Studio installer.":::
+In the installer, the Desktop development with C plus plus dropdown is selected and C plus plus C Make tools for Windows is selected."
+:::image-end:::
For more information, see [Install the C++ Linux workload in Visual Studio](../linux/download-install-and-setup-the-linux-development-workload.md).
@@ -28,7 +30,9 @@ For more information, see [Install the C++ Linux workload in Visual Studio](../l
When you **open a folder** containing a *`CMakeLists.txt`* file, the following things happen.
-
+:::image type="complex" source="media/start-window.png" alt-text="Screenshot of the first dialog that opens when Visual Studio is started.":::
+The dialog offers these options: clone a repository, open a project or solution, open a local folder, or create a new project. Open a local folder is called out in the screenshot.
+:::image-end:::
- Visual Studio adds **CMake** items to the **Project** menu, with commands for viewing and editing CMake scripts.
@@ -39,11 +43,11 @@ When you **open a folder** containing a *`CMakeLists.txt`* file, the following t
- In the background, Visual Studio starts to index the source files to enable IntelliSense, browsing information, refactoring, and so on. As you work, Visual Studio monitors changes in the editor and also on disk to keep its index in sync with the sources.
> [!NOTE]
-> Starting in Visual Studio 2022 version 17.1 Preview 2, if your folder doesn't contain a root `CMakeLists.txt` you'll be prompted whether you'd like to enable CMake integration or not. For more information, see [CMake partial activation](#cmake-partial-activation).
+> Starting in Visual Studio 2022 version 17.1 Preview 2, if your top-level *`CMakeLists.txt`* exists in a subfolder and not at the root of the workspace, you're prompted whether you'd like to enable CMake integration or not. For more information, see [CMake partial activation](#cmake-partial-activation).
-Once CMake cache generation has succeeded, you can also view your projects organized logically by targets. Choose **Targets view** from the dropdown in the **Solution Explorer** toolbar:
+Once CMake cache generation has succeeded, you can also view your projects organized logically by targets. Choose the **Select View** button on the **Solution Explorer** toolbar. From the list in **Solution Explorer - Views**, select **CMake Targets View** and press **Enter** to open the targets view:
-
+:::image type="content" source="media/cmake-targets-view2.png" alt-text="Screenshot of the Solution Explorer Views window. The folder view is open. The C Make Targets View option is highlighted.":::
Choose the **Show All Files** button at the top of **Solution Explorer** to see all the CMake-generated output in the *`out/build/`* folders.
@@ -56,25 +60,24 @@ To pass arguments to an executable at debug time, you can use another file calle
Most Visual Studio and C++ language features are supported by CMake projects in Visual Studio. Examples include:
- [Edit and Continue for CMake projects](#edit-and-continue-for-cmake-projects)
-
- [Incredibuild integration for CMake projects](https://devblogs.microsoft.com/cppblog/seamlessly-accelerate-cmake-projects-in-visual-studio-with-incredibuild/)
-
- [AddressSanitizer support for CMake projects](cmake-presets-vs.md#enable-addresssanitizer-for-windows-and-linux)
-
- [Clang/LLVM support](https://devblogs.microsoft.com/cppblog/clang-llvm-support-in-visual-studio/)
> [!NOTE]
-> For other kinds of Open Folder projects, an additional JSON file *`CppProperties.json`* is used. This file is not relevant for CMake projects.
+> For other kinds of Open Folder projects, an additional JSON file *`CppProperties.json`* is used. This file isn't relevant for CMake projects.
## Configuring CMake projects
-The CMake configure step generates the project build system. It's equivalent to invoking `cmake.exe` from the command line. For more information on the CMake configure step, see the [CMake documentation](https://cmake.org/cmake/help/latest/manual/cmake.1.html#generate-a-project-buildsystem).
+The CMake configure step generates the project build system. It's equivalent to invoking *`cmake.exe`* from the command line. For more information on the CMake configure step, see the [CMake documentation](https://cmake.org/cmake/help/latest/manual/cmake.1.html#generate-a-project-buildsystem).
-Visual Studio uses a CMake configuration file to drive CMake generation and build. *`CMakePresets.json`* is supported by Visual Studio 2019 version 16.10 or later and is the recommended CMake configuration file. *`CMakePresets.json`* is supported directly by CMake and can be used to drive CMake generation and build from Visual Studio, from VS Code, in a Continuous Integration pipeline, and from the command line on Windows, Linux, and Mac. For more information on *`CMakePresets.json`*, see [Configure and build with CMake Presets](cmake-presets-vs.md). *`CMakeSettings.json`* is available for customers using an earlier version of Visual Studio. For more information on *`CMakeSettings.json`*, see [Customize CMake build settings](customize-cmake-settings.md).
+Visual Studio uses a CMake configuration file to drive CMake generation and build. *`CMakePresets.json`* is supported by Visual Studio 2019 version 16.10 or later and is the recommended CMake configuration file. *`CMakePresets.json`* is supported directly by CMake and can be used to drive CMake generation and build from Visual Studio, from VS Code, in a continuous integration pipeline, and from the command line on Windows, Linux, and Mac. For more information on *`CMakePresets.json`*, see [Configure and build with CMake Presets](cmake-presets-vs.md). *`CMakeSettings.json`* is available for customers using an earlier version of Visual Studio. For more information on *`CMakeSettings.json`*, see [Customize CMake build settings](customize-cmake-settings.md).
-When you make significant changes to your CMake configuration file or a *`CMakeLists.txt`* file, Visual Studio will automatically run the CMake configure step. You can invoke the configure step manually: Select **Project > Configure Cache** from the toolbar. You can also change your configuration preferences in **Tools** > **Options** > **CMake** > **General**.
+When you make significant changes to your CMake configuration file or a *`CMakeLists.txt`* file, Visual Studio automatically runs the CMake configure step. You can invoke the configure step manually: Select **Project > Configure Cache** from the toolbar. You can also change your configuration preferences in **Tools** > **Options** > **CMake** > **General**.
-
+:::image type="complex" source="media/cmake-configure-options.png" alt-text="Screenshot of the C Make configuration options in the Visual Studio settings window.":::
+The C Make configure settings are called out. Show C Make cache notifications is selected. Under 'When cache is out of date', the option 'Never run configure step automatically' is selected.
+:::image-end:::
If the configure step finishes without errors, then the information that's available drives C++ IntelliSense and language services. It's also used in build and debug operations.
@@ -86,11 +89,17 @@ By default, most configuration messages are suppressed unless there's an error.
You can also disable all CMake cache notifications (gold bars) by deselecting **Show CMake cache notification**.
+### Customize Targets View source groups
+
+By default, the CMake Targets View ignores the following source groups: *Source Files*, *Header Files*, *Resources*, *Object Files*. These groups are included by default in most CMake projects and would unnecessarily increase the number of clicks required to navigate the Targets View.
+
+You can enable the use of these source groups by selecting **Tools** > **Options** > **CMake** > **Enable the use of ignored source groups in CMake Targets View**.
+
### Troubleshooting CMake cache errors
If you need more information about the state of the CMake cache to diagnose a problem, open the **Project** main menu or the *`CMakeLists.txt`* context menu in **Solution Explorer** to run one of these commands:
-- **View CMakeCache.txt** opens the *`CMakeCache.txt`* file from the build directory in the editor. Any edits you make here to *`CMakeCache.txt`* are wiped out if you clean the cache. To make changes that persist after you clean the cache, see [Customize CMake settings](customize-cmake-settings.md) or [Configure and Build with CMake Presets](cmake-presets-vs.md).
+- **View CMakeCache.txt** opens the *`CMakeCache.txt`* file from the build directory in the editor. Any edits you make here to *`CMakeCache.txt`* are wiped out if you clean the cache. To make changes that persist after you clean the cache, see [Customize CMake settings](customize-cmake-settings.md) or [Configure and build with CMake Presets](cmake-presets-vs.md).
- **Delete Cache and Reconfigure** deletes the build directory and reconfigures from a clean cache.
@@ -110,7 +119,9 @@ To build a CMake project, you have these choices:
As you would expect, build results are shown in the **Output Window** and **Error List**.
-
+:::image type="complex" source="media/cmake-build-errors.png" alt-text="Screenshot of the Visual Studio Error List window":::
+C Make build warnings about conversions that might result in data loss such as converting from a float to an integer, are visible.
+:::image-end:::
### Edit build settings
@@ -118,17 +129,19 @@ Visual Studio uses a CMake configuration file to drive CMake builds. CMake confi
## Debugging CMake projects
-All executable CMake targets are shown in the **Startup Item** dropdown in the toolbar. To start debugging, select one and press the **Debug > Start Debugging** button in the toolbar. In a CMake project, the "Current document" option is only valid for .cpp files.
+All executable CMake targets are shown in the **Startup Item** dropdown in the toolbar. To start debugging, select one and press the **Debug > Start Debugging** button in the toolbar. In a CMake project, the **Current document** option is only valid for .cpp files.
-
+:::image type="complex" source="media/debug-target.png" alt-text="Screenshot of the Visual Studio debug dropdown.":::
+The dropdown has these options: Show / Hide debug targets, current document, samples (which is highlighted), box2d_tests, and samples-noGUI.
+:::image-end:::
The **Debug** or **F5** commands first build the project if changes have been made since the previous build. Changes to the CMake configuration file (*`CMakePresets.json`* or *`CMakeSettings.json`*) or a *`CMakeLists.txt`* causes the CMake cache to be regenerated.
-You can customize a CMake debugging session by setting properties in the *`launch.vs.json`* file. To customize debug settings for a specific target, select the target in the **Startup Item** dropdown and press **Debug > Debug and Launch Settings for \**. For more information on CMake debugging sessions, see [Configure CMake debugging sessions](configure-cmake-debugging-sessions.md).
+You can customize a CMake debugging session by setting properties in the *`launch.vs.json`* file. To customize debug settings for a specific target, select the target in the **Startup Item** dropdown and choose **Debug > Debug and Launch Settings for \**. For more information on CMake debugging sessions, see [Configure CMake debugging sessions](configure-cmake-debugging-sessions.md).
### Just My Code for CMake projects
-When you build for Windows using the MSVC compiler, CMake projects have support for Just My Code debugging. To change the Just My Code setting, go to **Tools** > **Options** > **Debugging** > **General**.
+When you build for Windows using the MSVC compiler, CMake projects have support for Just My Code debugging. To change the Just My Code setting, go to **Tools** > **Options** > **Debugging** > **General**. For more information on Just My Code debugging, see [Debug only user code with Just My Code](/visualstudio/debugger/just-my-code).
### Edit and Continue for CMake projects
@@ -141,24 +154,28 @@ if(MSVC)
endif()
```
+For more information on Edit and Continue, see [Configure Edit and Continue (C#, VB, C++)](/visualstudio/debugger/how-to-enable-and-disable-edit-and-continue).
+
### Attach to a CMake project running on Linux
Visual Studio allows you to debug a process running on a remote Linux system or WSL and debug it with the GDB debugger. To get started, select **Debug** > **Attach to Process...**, set the **Connection type** to **SSH**, and select your **Connection target** from the list of connections in the Connection Manager. Select a process from the list of available processes and press **Attach**. GDB must be installed on your Linux machine. For more information on SSH connections, see the [Connection Manager](../linux/connect-to-your-remote-linux-computer.md)
-
+:::image type="complex" source="media/attach-to-process.png" alt-text="Screenshot of the Attach to Process menu in Visual Studio.":::
+The following options are available on the dialog: Connection type (set to SSH), the connection target (set to demo@ 172. 20. 60. 6), and a list of available processes you can attach to."
+:::image-end:::
## CMake partial activation
-Starting in Visual Studio 2022 version 17.1 Preview 2, CMake functionality won't be enabled automatically if your root folder doesn't contain a `CMakeLists.txt` file. Instead, a dialog will prompt you on whether you'd like to enable CMake functionality for your project. If you decline, CMake cache generation won't start and CMake configurations (from `CMakeSettings.json` or `CMakePresets.json`) won't appear in the configuration dropdown. If you accept, you'll be taken to a workspace-level configuration file, `CMakeWorkspaceSettings.json` (stored in the `.vs` directory), to specify the folders you'd like to enable CMake for. (These folders contain your root `CMakeLists.txt` files).
+In Visual Studio 2022 version 17.1 and later, CMake functionality isn't enabled automatically if your root folder doesn't contain a *`CMakeLists.txt`* file. Instead, a dialog prompts you on whether you'd like to enable CMake functionality for your project. If you decline, CMake cache generation doesn't start and CMake configurations (from *`CMakeSettings.json`* or *`CMakePresets.json`*) doesn't appear in the configuration dropdown. If you accept, you're taken to a workspace-level configuration file, *`CMakeWorkspaceSettings.json`* (stored in the *`.vs`* directory), to specify the folders you'd like to enable CMake for. (These folders contain your root *`CMakeLists.txt`* files).
The accepted properties are:
| Property | Description |
|--|--|
| `enableCMake` | Enable Visual Studio's integration for this workspace. |
-| `sourceDirectory` | A string or array of strings specifying the directory or directories with `CMakeLists.txt`. Macros (such as `${workspaceRoot}`) are allowed. Relative paths are based on the workspace root. Directories outside of the current workspace will be ignored. |
+| `sourceDirectory` | A string or array of strings specifying the directory or directories with *`CMakeLists.txt`*. Macros (such as `${workspaceRoot}`) are allowed. Relative paths are based on the workspace root. Directories outside of the current workspace are ignored. |
-You can reach `CMakeWorkspaceSettings.json` through the **Project** > **CMake Workspace Settings** menu command at any time, even if CMake functionality is currently disabled.
+You can reach *`CMakeWorkspaceSettings.json`* through the **Project** > **CMake Workspace Settings** menu command at any time, even if CMake functionality is currently disabled.
## Open an existing cache
@@ -177,7 +194,7 @@ You can add an existing CMake cache to an open project. It's done the same way y
Visual Studio uses the CMake [file-based API](https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html) (in versions 3.14 and later) to populate the editor with information specific to your project structure. For more information, see the C++ team blog post on [multi-root workspaces and file-based API](https://devblogs.microsoft.com/cppblog/visual-studio-code-cmake-tools-extension-multi-root-workspaces-and-file-based-api/).
-Before generating the CMake cache, your custom or preferred tools may need to create a query file named *`.cmake/api/v1/query/client-MicrosoftVS/query.json`* in your build output folder (the folder that contains *`CMakeCache.txt`*). The query file should contain this content:
+Before generating the CMake cache, your custom or preferred tools might need to create a query file named *`.cmake/api/v1/query/client-MicrosoftVS/query.json`* in your build output folder (the folder that contains *`CMakeCache.txt`*). The query file should contain this content:
```json
{"requests":[{"kind":"cache","version":2},{"kind":"cmakeFiles","version":1},{"kind":"codemodel","version":2}]}
@@ -189,23 +206,31 @@ When your custom or preferred tools generate your cache, CMake places files unde
To edit a *`CMakeLists.txt`* file, right-click on the file in **Solution Explorer** and choose **Open**. If you make changes to the file, a yellow status bar appears and informs you that IntelliSense will update. It gives you a chance to cancel the update operation. For information about *`CMakeLists.txt`*, see the [CMake documentation](https://cmake.org/documentation/).
-
+:::image type="complex" source="media/cmake-cmakelists.png" alt-text="Screenshot of a C Make Lists TXT file being edited in Visual Studio."
+It contains the lines project (hello-cmake), add_subdirectory (tests), add_executable (hello hello.cpp), and install (TARGETS hello DESTINATION hello/bin). A message at the top of the window says that c plus plus IntelliSense info will refresh after C Make finishes generating the cache.
+:::image-end:::
As soon as you save the file, the configuration step automatically runs again and displays information in the **Output** window. Errors and warnings are shown in the **Error List** or **Output** window. Double-click on an error in the **Error List** to navigate to the offending line in *`CMakeLists.txt`*.
-
+:::image type="complex" source="media/cmake-cmakelists-error.png" alt-text="Screenshot of a C Make error in the Visual Studio error list.":::
+A C Make error message on line 3 of CMakeLists.txt is highlighted. The details are that C Make couldn't find a package configuration file provided by sqlite3. C Make looked for it in CMAKE_MODULE_PATH but couldn't find it. The suggestion is to add the installation prefix 'sqlite3' to CMAKE_PREFIX_PATH or set sqlite3_DIR to a directory containing sqlite3Config.cmake and/or sqlitet3-config.cmake.
+:::image-end:::
### Language services for CMake
-Language services for CMake are available in Visual Studio 2019 version 16.5 or later. Code navigation features like Go To Definition, Peek Definition, and Find All References are supported for CMake variables, functions, and targets in CMake script files. For more information, see [Code Navigation for CMake Scripts](https://devblogs.microsoft.com/cppblog/code-navigation-for-cmake-scripts/).
+Language services for CMake are available in Visual Studio 2019 version 16.5 or later. Language services support code navigation features like *Go To Definition*, *Peek Definition*, and *Find All References* for CMake variables, functions, and targets in CMake script files. For more information, see [Code Navigation for CMake Scripts](https://devblogs.microsoft.com/cppblog/code-navigation-for-cmake-scripts/).
-
+:::image type="complex" source="media/cmake-find-all-refs.png" alt-text="Screenshot of the Visual Studio Find All References window.":::
+Results of where SUPERTUX_SOURCES_CXX are found are shown. For example, in list(SORT SSUPERTUX_SOURCES_CXX), file(GLOB SUPERTUX_SOURCES_CXX) and so on.
+:::image-end:::
### CMake project manipulation
-CMake project manipulation is available in Visual Studio 2019 version 16.5 or later. Project manipulation enables you to add, remove, and rename source files and targets in your CMake project without manually editing your CMake scripts. When you add or remove files from the Solution Explorer, Visual Studio automatically edits your CMake project. There could be more than one place where it makes sense to add or remove a reference to a CMake script. If so, Visual Studio asks you where you want to make the change and displays a preview of the proposed changes. For step-by-step instructions, see [Add, Remove, and Rename Files and Targets in CMake Projects](https://devblogs.microsoft.com/cppblog/easily-add-remove-and-rename-files-and-targets-in-cmake-projects/).
+CMake project manipulation is available in Visual Studio 2019 version 16.5 or later. Project manipulation lets you add, remove, and rename source files and targets in your CMake project without manually editing your CMake scripts. When you add or remove files from the Solution Explorer, Visual Studio automatically edits your CMake project. There could be more than one place where it makes sense to add or remove a reference to a CMake script. If so, Visual Studio asks you where you want to make the change and displays a preview of the proposed changes. For step-by-step instructions, see [Add, Remove, and Rename Files and Targets in CMake Projects](https://devblogs.microsoft.com/cppblog/easily-add-remove-and-rename-files-and-targets-in-cmake-projects/).
-
+:::image type="complex" source="media/cmake-project-manipulation.png" alt-text="Screenshot of the Visual Studio Preview Changes dialog box.":::
+A tree view shows CMakeLists.txt, under which are two items: add_executable and set. Set is checked. The preview window shows where changes will be made. The line set PROJECT_SRC "CmakeProject4.cpp" "CMakeProject4.h" shows "Demo.cpp" highlighted before the closing parenthesis. The apply button accepts the change, or you can press cancel.
+:::image-end:::
## IntelliSense for CMake projects
@@ -221,19 +246,22 @@ In Visual Studio 2019 version 16.9 and later, Visual Studio automatically config
## Vcpkg integration
-CMake projects opened in Visual Studio integrate with vcpkg, a cross-platform C/C++ dependency manager. Before using vcpkg with Visual Studio, you must run `vcpkg integrate install`. For instructions and more information on vcpkg, see the [vcpkg documentation](https://vcpkg.io/).
+CMake projects opened in Visual Studio integrate with vcpkg, a cross-platform C/C++ dependency manager. Before using vcpkg with Visual Studio, you must run `vcpkg integrate install`. For instructions and more information about vcpkg, see:
+
+- [Install and use packages with CMake in Visual Studio](/vcpkg/get_started/get-started-vs)
+- [vcpkg in CMake projects](/vcpkg/users/buildsystems/cmake-integration)
If *`CMakeSettings.json`* is your active configuration file, Visual Studio automatically passes the vcpkg toolchain file (`vcpkg.cmake`) to CMake. This behavior is disabled automatically when you specify any other toolchain in your CMake Settings configuration.
-If *`CMakePresets.json`* is your active configuration file, you'll need to set the path to `vcpkg.cmake` in *`CMakePresets.json`*. We recommend using the `VCPKG_ROOT` environment variable instead of an absolute path to keep the file shareable. For more information, see [Enable vcpkg integration with CMake Presets](cmake-presets-vs.md#enable-vcpkg-integration). *`CMakePresets.json`* is available in Visual Studio 2019 version 16.10 or later and is the recommended CMake configuration file.
+If *`CMakePresets.json`* is your active configuration file, you need to set the path to `vcpkg.cmake` in *`CMakePresets.json`*. We recommend using the `VCPKG_ROOT` environment variable instead of an absolute path to keep the file shareable. For more information, see [Enable vcpkg integration with CMake Presets](cmake-presets-vs.md#enable-vcpkg-integration). *`CMakePresets.json`* is available in Visual Studio 2019 version 16.10 or later and is the recommended CMake configuration file.
## Run CMake from the command line
If *`CMakePresets.json`* is your active CMake configuration file, then you can easily reproduce your local builds outside of Visual Studio. For more information, see [Run CMake from the command line or a CI pipeline](cmake-presets-vs.md#run-cmake-from-the-command-line-or-a-ci-pipeline). *`CMakePresets.json`* is supported in Visual Studio 2019 version 16.10 or later and is the recommended CMake configuration file.
-If *`CMakeSettings.json`* is your active CMake configuration file, then you'll need to manually pass the arguments that are encoded in your *`CMakeSettings.json`* file to CMake. If you have installed CMake from the Visual Studio Installer, you can run it from the command line by following these steps:
+If *`CMakeSettings.json`* is your active CMake configuration file, then you need to manually pass the arguments that are encoded in your *`CMakeSettings.json`* file to CMake. If you installed CMake from the Visual Studio Installer, you can run it from the command line by following these steps:
-1. Run the appropriate *`vsdevcmd.bat`* file (x86/x64). For more information, see [Building on the command line](building-on-the-command-line.md) .
+1. Run the appropriate *`vsdevcmd.bat`* file (x86/x64). For more information, see [Use the Microsoft C++ toolset from the command line](building-on-the-command-line.md) .
1. Switch to your output folder.
@@ -249,13 +277,13 @@ Visual Studio 2017 has rich support for CMake, including [cross-platform CMake p
**Visual C++ Tools for CMake** is installed as part of the **Desktop development with C++** and **Linux Development with C++** workloads.
-
+:::image type="content" source="media/cmake-install.png" alt-text="Screenshot of the Visual Studio Installer. The Individual components tab is selected on which Visual C plus plus tools for C Make is selected.":::
For more information, see [Install the C++ Linux workload in Visual Studio](../linux/download-install-and-setup-the-linux-development-workload.md).
## IDE integration
-When you choose **File > Open > Folder** to open a folder containing a *`CMakeLists.txt`* file, the following things happen:
+When you choose **File > Open > Folder** to open a folder containing a *`CMakeLists.txt`* file, the following happens:
- Visual Studio adds a **CMake** menu item to the main menu, with commands for viewing and editing CMake scripts.
@@ -265,15 +293,17 @@ When you choose **File > Open > Folder** to open a folder containing a *`CMakeLi
- In the background, Visual Studio starts to index the source files to enable IntelliSense, browsing information, refactoring, and so on. As you work, Visual Studio monitors changes in the editor and also on disk to keep its index in sync with the sources.
-You can open folders containing any number of CMake projects. Visual Studio detects and configures all the "root" *`CMakeLists.txt`* files in your workspace. CMake operations (configure, build, debug), C++ IntelliSense, and browsing are available to all CMake projects in your workspace.
+You can open folders containing any number of CMake projects. Visual Studio detects and configures all the top-level *`CMakeLists.txt`* files in your workspace. CMake operations (configure, build, debug), C++ IntelliSense, and browsing are available to all CMake projects in your workspace.
-
+:::image type="complex" source="media/cmake-multiple-roots.png" alt-text="Screenshot of the Visual Studio Solution Explorer.":::
+The files and folders of a C Make project are visible. There's a tests subdirectory, CMakeLists.txt, and hello.cpp. There's a hello-cmake-vcpkg folder that contains CMakeLists.txt, CMakeSettings.json, and hello.cpp.
+:::image-end:::
You can also view your projects organized logically by targets. Choose **Targets view** from the dropdown in the **Solution Explorer** toolbar:
-
+:::image type="content" source="media/cmake-targets-view.png" alt-text="Screenshot of the dropdown button in the Visual Studio Solution Explorer that offers the CMake targets view option. Which is selected.":::
-Visual Studio uses a file called *`CMakeSettings.json`* to store environment variables or command-line options for CMake. *`CMakeSettings.json`* also enables you to define and store multiple CMake build configurations. You can conveniently switch between them in the IDE.
+Visual Studio uses a file called *`CMakeSettings.json`* to store environment variables or command-line options for CMake. *`CMakeSettings.json`* also lets you define and store multiple CMake build configurations. You can conveniently switch between them in the IDE.
Otherwise, use the *`CMakeLists.txt`* just as you would in any CMake project to specify source files, find libraries, set compiler and linker options, and specify other build system-related information.
@@ -284,49 +314,53 @@ If you need to pass arguments to an executable at debug time, you can use anothe
## Import an existing cache
-When you import an existing *`CMakeCache.txt`* file, Visual Studio automatically extracts customized variables and creates a pre-populated *`CMakeSettings.json`* file based on them. The original cache isn't modified in any way. It can still be used from the command line, or with whatever tool or IDE used to generate it. The new *`CMakeSettings.json`* file is placed alongside the project's root *`CMakeLists.txt`*. Visual Studio generates a new cache based the settings file. You can override automatic cache generation in the **Tools > Options > CMake > General** dialog.
+When you import an existing *`CMakeCache.txt`* file, Visual Studio automatically extracts customized variables and creates a prepopulated *`CMakeSettings.json`* file based on them. The original cache isn't modified in any way. It can still be used from the command line, or with whatever tool or IDE used to generate it. The new *`CMakeSettings.json`* file is placed alongside the project's root *`CMakeLists.txt`*. Visual Studio generates a new cache based the settings file. You can override automatic cache generation in the **Tools > Options > CMake > General** dialog.
-Not everything in the cache is imported. Properties such as the generator and the location of the compilers are replaced with defaults that are known to work well with the IDE.
+Not everything in the cache is imported. Properties such as the generator and the location of the compilers are replaced with defaults that are known to work well with the IDE.
### To import an existing cache
1. From the main menu, choose **File > Open > CMake**:
- 
+ :::image type="content" source="media/cmake-file-open.png" alt-text="Screenshot of the Visual Studio main menu with C Make selected.":::
This command brings up the **Import CMake from Cache** wizard.
2. Navigate to the *`CMakeCache.txt`* file that you want to import, and then choose **OK**. The **Import CMake Project from Cache** wizard appears:
- 
+ :::image type="content" source="media/cmake-import-wizard.png" alt-text="Screenshot of the Import C Make Project from Cache wizard. The directory path of the C Make project to import goes in the folder textbox.":::
- When the wizard completes, you can see the new *`CMakeCache.txt`* file in **Solution Explorer** next to the root *`CMakeLists.txt`* file in your project.
+ When the wizard completes, you can see the new *`CMakeCache.txt`* file in **Solution Explorer** next to the root *`CMakeLists.txt*` file in your project.
## Building CMake projects
To build a CMake project, you have these choices:
-1. In the General toolbar, find the **Configurations** dropdown. It's probably showing "Linux-Debug" or "x64-Debug" by default. Select the preferred configuration and press **F5**, or choose the **Run** (green triangle) button on the toolbar. The project automatically builds first, just like a Visual Studio solution.
+1. In the General toolbar, find the **Configurations** dropdown. It's probably showing **Linux-Debug** or **x64-Debug** by default. Select the preferred configuration and press **F5**, or choose the **Run** (green triangle) button on the toolbar. The project automatically builds first, just like a Visual Studio solution.
1. Right-click on *`CMakeLists.txt`* in **Solution Explorer** and select **Build** from the context menu. If you have multiple targets in your folder structure, you can choose to build all or only one specific target.
1. From the main menu, select **Build > Build Solution** (**F7** or **Ctrl+Shift+B**). Make sure that a CMake target is already selected in the **Startup Item** dropdown in the **General** toolbar.
-
+:::image type="complex" source="media/cmake-build-menu.png" alt-text="Screenshot of the Visual Studio Solution Explorer after right-clicking C Make Lists dot t x t.":::
+The menu has options such as Add, Open, Configure tasks, Build, Clean all, and so on.
+:::image-end:::
-You can customize build configurations, environment variables, command-line arguments, and other settings in the *`CMakeSettings.json`* file. It lets you make changes without modifying the *`CMakeLists.txt`* file. For more information, see [Customize CMake settings](customize-cmake-settings.md).
+You can customize build configurations, environment variables, command-line arguments, and other settings in the *`CMakeSettings.json`* file. It lets you make changes without modifying the *`CMakeLists.txt`* file. For more information, see [Customize CMake build settings](customize-cmake-settings.md).
As you would expect, build results are shown in the **Output Window** and **Error List**.
-
+:::image type="complex" source="media/cmake-build-errors.png" alt-text="Screenshot of the Visual Studio Error List window.":::
+C Make build warnings about conversions that might result in data loss such as converting from a float to an integer are visible.
+:::image-end:::
In a folder with multiple build targets, you can specify which CMake target to build: Choose the **Build** item on the **CMake** menu or the *`CMakeLists.txt`* context menu to specify the target. If you enter **Ctrl+Shift+B** in a CMake project, it builds the current active document.
## Debugging CMake projects
-To debug a CMake project, choose the preferred configuration and press **F5**. Or, press the **Run** button in the toolbar. If the **Run** button says "Select Startup Item", select the dropdown arrow and choose the target that you want to run. (In a CMake project, the "Current document" option is only valid for .cpp files.)
+To debug a CMake project, choose the preferred configuration and press **F5**. Or, press the **Run** button in the toolbar. If the **Run** button says **Select Startup Item**, select the dropdown arrow and choose the target that you want to run. (In a CMake project, the **Current document** option is only valid for .cpp files.)
-
+:::image type="content" source="media/cmake-run-button.png" alt-text="Screenshot of the Select Startup Item dropdown for a C Make project. You can select current document or hello-cmake.":::
The **Run** or **F5** commands first build the project if changes have been made since the previous build.
@@ -336,19 +370,25 @@ You can customize a CMake debugging session by setting properties in the *`launc
To edit a *`CMakeLists.txt`* file, right-click on the file in **Solution Explorer** and choose **Open**. If you make changes to the file, a yellow status bar appears and informs you that IntelliSense will update. It gives you a chance to cancel the update operation. For information about *`CMakeLists.txt`*, see the [CMake documentation](https://cmake.org/documentation/).
- 
+ :::image type="complex" source="media/cmake-cmakelists.png" alt-text="Screenshot of a C Make Lists file being edited in Visual Studio.":::
+ The file contains project (hello-cmake), add_subdirectory (tests), add_executable (hello hello.cpp), and install (TARGETS hello DESTINATION hello/bin). A message at the top of the window says that c plus plus IntelliSense info will refresh after C Make finishes generating the cache.
+ :::image-end:::
As soon as you save the file, the configuration step automatically runs again and displays information in the **Output** window. Errors and warnings are shown in the **Error List** or **Output** window. Double-click on an error in the **Error List** to navigate to the offending line in *`CMakeLists.txt`*.
- 
+ :::image type="complex" source="media/cmake-cmakelists-error.png" alt-text="Screenshot of a C Make error in the Visual Studio error list.":::
+ A C Make error message on line 3 of CMakeLists.txt is highlighted. The details are that C Make can't find a package configuration file provided by sqlite3. C Make looked for it in CMAKE_MODULE_PATH but couldn't find it. The suggestion is to add the installation prefix 'sqlite3' to CMAKE_PREFIX_PATH or set sqlite3_DIR to a directory containing sqlite3Config.cmake and/or sqlitet3-config.cmake.
+ :::image-end:::
## CMake configure step
-When significant changes are made to the *`CMakeSettings.json`* or to *`CMakeLists.txt`* files, Visual Studio automatically reruns the CMake configure step. If the configure step finishes without errors, the information that's collected is available in C++ IntelliSense and language services. It's also used in build and debug operations.
+When significant changes are made to the *`CMakeSettings.json`* or to *`CMakeLists.txt`* files, Visual Studio automatically reruns the CMake configure step. If the configure step finishes without errors, the information that's collected is available in C++ IntelliSense and language services. It's also used in build and debug operations.
-Multiple CMake projects may use the same CMake configuration name (for example, x86-Debug). All of them are configured and built (in their own build root folder) when that configuration is selected. You can debug the targets from all of the CMake projects that participate in that CMake configuration.
+Multiple CMake projects might use the same CMake configuration name (for example, *x86-Debug*). All of them are configured and built (in their own build root folder) when that configuration is selected. You can debug the targets from all of the CMake projects that participate in that CMake configuration.
- 
+ :::image type="complex" source="media/cmake-build-only.png" alt-text="Screenshot of Visual Studio's main menu, open to C Make Build Only.":::
+ The context menu shows what can be built. In this case hello-cmake-a \ hello-cmake.exe (Project hello-cmake) and hello-cmake-b\hello-cmake.exe (Project hello-cmake). The latter is highlighted.
+ :::image-end:::
You can limit builds and debug sessions to a subset of the projects in the workspace. Create a new configuration with a unique name in the *`CMakeSettings.json`* file. Then, apply the configuration to those projects only. When that configuration is selected, IntelliSense and the build and debug commands only apply to those specified projects.
@@ -356,7 +396,7 @@ You can limit builds and debug sessions to a subset of the projects in the works
If you need more information about the state of the CMake cache to diagnose a problem, open the **CMake** main menu or the *`CMakeLists.txt`* context menu in **Solution Explorer** to run one of these commands:
-- **View Cache** opens the *`CMakeCache.txt`* file from the build root folder in the editor. (Any edits you make here to *`CMakeCache.txt`* are wiped out if you clean the cache. To make changes that persist after the cache is cleaned, see [Customize CMake settings](customize-cmake-settings.md).)
+- **View Cache** opens the *`CMakeCache.txt`* file from the build root folder in the editor. Any edits you make here to *`CMakeCache.txt`* are wiped out if you clean the cache. To make changes that persist after the cache is cleaned, see [Customize CMake settings](customize-cmake-settings.md).
- **Open Cache Folder** opens an Explorer window to the build root folder.
@@ -370,11 +410,11 @@ Automatic cache generation can be disabled in the **Tools > Options > CMake > Ge
To build a single file in a CMake project, right-click on the file in **Solution Explorer**. Choose **Compile** from the pop-up menu. You can also build the currently open file in the editor by using the main **CMake** menu:
-
+:::image type="content" source="media/cmake-single-file-compile.png" alt-text="Screenshot of the C Make Compile context menu. It contains one entry, Bullet 3 Collision.":::
## Run CMake from the command line
-If you have installed CMake from the Visual Studio Installer, you can run it from the command line by following these steps:
+If you installed CMake from the Visual Studio Installer, you can run it from the command line by following these steps:
1. Run the appropriate *`vsdevcmd.bat`* file (x86/x64). For more information, see [Building on the Command Line](building-on-the-command-line.md).
@@ -390,13 +430,15 @@ In Visual Studio 2015, Visual Studio users can use a [CMake generator](https://c
::: moniker-end
-## See also
-
-[Tutorial: Create C++ cross-platform projects in Visual Studio](get-started-linux-cmake.md)\
-[Configure a Linux CMake project](../linux/cmake-linux-project.md)\
-[Connect to your remote Linux computer](../linux/connect-to-your-remote-linux-computer.md)\
-[Customize CMake build settings](customize-cmake-settings.md)\
-[`CMakeSettings.json` schema reference](cmakesettings-reference.md)\
-[Configure CMake debugging sessions](configure-cmake-debugging-sessions.md)\
-[Deploy, run, and debug your Linux project](../linux/deploy-run-and-debug-your-linux-project.md)\
-[CMake predefined configuration reference](cmake-predefined-configuration-reference.md)
+## Related content
+
+- [Tutorial: Create C++ cross-platform projects in Visual Studio](get-started-linux-cmake.md)
+- [Configure a Linux CMake project](../linux/cmake-linux-project.md)
+- [Connect to your remote Linux computer](../linux/connect-to-your-remote-linux-computer.md)
+- [Customize CMake build settings](customize-cmake-settings.md)
+- [*`CMakeSettings.json`* schema reference](cmakesettings-reference.md)
+- [Configure CMake debugging sessions](configure-cmake-debugging-sessions.md)
+- [Deploy, run, and debug your Linux project](../linux/deploy-run-and-debug-your-linux-project.md)
+- [CMake predefined configuration reference](cmake-predefined-configuration-reference.md)
+- [vcpkg in CMake projects](/vcpkg/users/buildsystems/cmake-integration)
+- [Install and use packages with CMake in Visual Studio](/vcpkg/get_started/get-started-vs)
diff --git a/docs/build/cmake-remote-debugging.md b/docs/build/cmake-remote-debugging.md
index 42ff2ab6f4..41645840b3 100644
--- a/docs/build/cmake-remote-debugging.md
+++ b/docs/build/cmake-remote-debugging.md
@@ -1,8 +1,8 @@
---
title: "Tutorial: Debug a CMake project on a remote Windows machine"
+description: "How to use Visual Studio C++ on Windows to create and build a CMake project. You'll then deploy and debug it on a remote Windows machine."
ms.date: "12/4/2020"
ms.topic: tutorial
-description: "How to use Visual Studio C++ on Windows to create and build a CMake project. You'll then deploy and debug it on a remote Windows machine."
---
# Tutorial: Debug a CMake project on a remote Windows machine
@@ -60,7 +60,7 @@ Select the Visual Studio **Configuration** dropdown and select **Manage Configur

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

@@ -71,13 +71,12 @@ The **Toolset** dropdown is set to **msvc_arm64_x64**. Your settings should now

> [!Note]
-> 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.
+> 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).
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):

-
## Add a debug configuration file
Next, add configuration information that tells Visual Studio where to find your remote machine, along with other configuration details.
@@ -116,7 +115,7 @@ For example, on the remote machine, from the Visual Studio Remote Debugger menu
Then, in Visual Studio on the host machine, update the *`launch.vs.json`* file to match. For example, if you choose **No Authentication** on the remote debugger, update the *`launch.vs.json`* file in your project by adding `"authenticationType": "none"` to the `configurations` section *`launch.vs.json`*. Otherwise, `"authenticationType"` defaults to `"windows"` and doesn't need to be explicitly stated. This example shows a *`launch.vs.json`* file configured for no authentication:
-``` XAML
+```XAML
{
"version": "0.2.1",
"defaults": {},
diff --git a/docs/build/cmakesettings-reference.md b/docs/build/cmakesettings-reference.md
index 16d3566c71..e9a6acdb8f 100644
--- a/docs/build/cmakesettings-reference.md
+++ b/docs/build/cmakesettings-reference.md
@@ -145,7 +145,7 @@ If you don't define the `"type"`, the `"STRING"` type is assumed by default.
## Environments
-An *environment* encapsulates the environment variables set in the process that Visual Studio uses to invoke CMake. For MSVC projects, it captures the variables set in a [developer command prompt](building-on-the-command-line.md) for a specific platform. For example, the `msvc_x64_x64` environment is the same as running the **Developer Command Prompt for VS 2017** or **Developer Command Prompt for VS 2019** with the **-arch=amd64 -host_arch=amd64** arguments. You can use the `env.{}` syntax in *`CMakeSettings.json`* to reference the individual environment variables, for example to construct paths to folders. The following predefined environments are provided:
+An *environment* encapsulates the environment variables set in the process that Visual Studio uses to invoke CMake. For MSVC projects, it captures the variables set in a [developer command prompt](building-on-the-command-line.md) for a specific platform. For example, the `msvc_x64_x64` environment is the same as running the **Developer Command Prompt for VS {version}** with the **-arch=amd64 -host_arch=amd64** arguments. You can use the `env.{}` syntax in *`CMakeSettings.json`* to reference the individual environment variables, for example to construct paths to folders. The following predefined environments are provided:
- `linux_arm`: Target ARM Linux remotely.
- `linux_x64`: Target x64 Linux remotely.
diff --git a/docs/build/common-visual-cpp-arm-migration-issues.md b/docs/build/common-visual-cpp-arm-migration-issues.md
index f723c06625..36035c044b 100644
--- a/docs/build/common-visual-cpp-arm-migration-issues.md
+++ b/docs/build/common-visual-cpp-arm-migration-issues.md
@@ -2,28 +2,30 @@
description: "Learn more about: Common Visual C++ ARM Migration Issues"
title: "Common Visual C++ ARM Migration Issues"
ms.date: "05/06/2019"
-ms.assetid: 0f4c434e-0679-4331-ba0a-cc15dd435a46
---
-# Common Visual C++ ARM Migration Issues
+# Common Visual C++ ARM migration issues
-When using the Microsoft C++ compiler (MSVC), the same C++ source code might produce different results on the ARM architecture than it does on x86 or x64 architectures.
+This document describes some of the common issues that you might encounter when you migrate code from x86 or x64 architectures to the ARM architecture. It also describes how to avoid these issues, and how to use the compiler to help identify them.
+
+> [!NOTE]
+> When this article refers to the ARM architecture, it applies to both ARM32 and ARM64.
## Sources of migration issues
Many issues that you might encounter when you migrate code from the x86 or x64 architectures to the ARM architecture are related to source-code constructs that might invoke undefined, implementation-defined, or unspecified behavior.
-*Undefined behavior* is behavior that the C++ standard does not define, and that's caused by an operation that has no reasonable result: for example, converting a floating-point value to an unsigned integer, or shifting a value by a number of positions that is negative or exceeds the number of bits in its promoted type.
+*Undefined behavior* is behavior that the C++ standard doesn't define, and that's caused by an operation that has no reasonable result: for example, converting a floating-point value to an unsigned integer, or shifting a value by a number of positions that is negative or exceeds the number of bits in its promoted type.
*Implementation-defined behavior* is behavior that the C++ standard requires the compiler vendor to define and document. A program can safely rely on implementation-defined behavior, even though doing so might not be portable. Examples of implementation-defined behavior include the sizes of built-in data types and their alignment requirements. An example of an operation that might be affected by implementation-defined behavior is accessing the variable arguments list.
-*Unspecified behavior* is behavior that the C++ standard leaves intentionally non-deterministic. Although the behavior is considered non-deterministic, particular invocations of unspecified behavior are determined by the compiler implementation. However, there is no requirement for a compiler vendor to predetermine the result or guarantee consistent behavior between comparable invocations, and there is no requirement for documentation. An example of unspecified behavior is the order in which sub-expressions, which include arguments to a function call, are evaluated.
+*Unspecified behavior* is behavior that the C++ standard leaves intentionally nondeterministic. Although the behavior is considered nondeterministic, particular invocations of unspecified behavior are determined by the compiler implementation. However, there's no requirement for a compiler vendor to predetermine the result or guarantee consistent behavior between comparable invocations, and there's no requirement for documentation. An example of unspecified behavior is the order in which sub-expressions, which include arguments to a function call, are evaluated.
-Other migration issues can be attributed to hardware differences between ARM and x86 or x64 architectures that interact with the C++ standard differently. For example, the strong memory model of the x86 and x64 architecture gives **`volatile`**-qualified variables some additional properties that have been used to facilitate certain kinds of inter-thread communication in the past. But the ARM architecture's weak memory model doesn't support this use, nor does the C++ standard require it.
+Other migration issues can be attributed to hardware differences between ARM and x86 or x64 architectures that interact with the C++ standard differently. For example, the strong memory model of the x86 and x64 architecture gives **`volatile`**-qualified variables some extra properties that have been used to facilitate certain kinds of inter-thread communication in the past. But the ARM architecture's weak memory model doesn't support this use, nor does the C++ standard require it.
> [!IMPORTANT]
-> Although **`volatile`** gains some properties that can be used to implement limited forms of inter-thread communication on x86 and x64, these additional properties are not sufficient to implement inter-thread communication in general. The C++ standard recommends that such communication be implemented by using appropriate synchronization primitives instead.
+> Although **`volatile`** gains some properties that can be used to implement limited forms of inter-thread communication on x86 and x64, these properties aren't sufficient to implement inter-thread communication in general. The C++ standard recommends that such communication be implemented by using appropriate synchronization primitives instead.
-Because different platforms might express these kinds of behavior differently, porting software between platforms can be difficult and bug-prone if it depends on the behavior of a specific platform. Although many of these kinds of behavior can be observed and might appear stable, relying on them is at least non-portable, and in the cases of undefined or unspecified behavior, is also an error. Even the behavior that's cited in this document should not be relied on, and could change in future compilers or CPU implementations.
+Because different platforms might express these kinds of behavior differently, porting software between platforms can be difficult and bug-prone if it depends on the behavior of a specific platform. Although many of these kinds of behavior can be observed and might appear stable, relying on them is at least non-portable, and in the cases of undefined or unspecified behavior, is also an error. Even the behavior cited in this document shouldn't be relied on, and could change in future compilers or CPU implementations.
## Example migration issues
@@ -41,15 +43,15 @@ These platforms also differ in how they handle conversion of NaN (Not-a-Number)
Floating-point conversion can only be relied on if you know that the value is within the range of the integer type that it's being converted to.
-### Shift operator (\<\< >>) behavior
+### Shift operator (`<<` `>>`) behavior
-On the ARM architecture, a value can be shifted left or right up to 255 bits before the pattern begins to repeat. On x86 and x64 architectures, the pattern is repeated at every multiple of 32 unless the source of the pattern is a 64-bit variable; in that case, the pattern repeats at every multiple of 64 on x64, and every multiple of 256 on x86, where a software implementation is employed. For example, for a 32-bit variable that has a value of 1 shifted left by 32 positions, on ARM the result is 0, on x86 the result is 1, and on x64 the result is also 1. However, if the source of the value is a 64-bit variable, then the result on all three platforms is 4294967296, and the value doesn't "wrap around" until it's shifted 64 positions on x64, or 256 positions on ARM and x86.
+On the ARM architecture, a value can be shifted left or right up to 255 bits before the pattern begins to repeat. On x86 and x64 architectures, the pattern is repeated at every multiple of 32 unless the source of the pattern is a 64-bit variable. In that case, the pattern repeats at every multiple of 64 on x64, and every multiple of 256 on x86, where a software implementation is employed. For example, for a 32-bit variable that has a value of 1 shifted left by 32 positions, on ARM the result is 0, on x86 the result is 1, and on x64 the result is also 1. However, if the source of the value is a 64-bit variable, then the result on all three platforms is 4294967296, and the value doesn't "wrap around" until it's shifted 64 positions on x64, or 256 positions on ARM and x86.
-Because the result of a shift operation that exceeds the number of bits in the source type is undefined, the compiler is not required to have consistent behavior in all situations. For example, if both operands of a shift are known at compile time, the compiler may optimize the program by using an internal routine to precompute the result of the shift and then substituting the result in place of the shift operation. If the shift amount is too large, or negative, the result of the internal routine might be different than the result of the same shift expression as executed by the CPU.
+Because the result of a shift operation that exceeds the number of bits in the source type is undefined, the compiler isn't required to have consistent behavior in all situations. For example, if both operands of a shift are known at compile time, the compiler may optimize the program by using an internal routine to precompute the result of the shift and then substituting the result in place of the shift operation. If the shift amount is too large, or negative, the result of the internal routine might be different than the result of the same shift expression as executed by the CPU.
### Variable arguments (varargs) behavior
-On the ARM architecture, parameters from the variable arguments list that are passed on the stack are subject to alignment. For example, a 64-bit parameter is aligned on a 64-bit boundary. On x86 and x64, arguments that are passed on the stack are not subject to alignment and pack tightly. This difference can cause a variadic function like `printf` to read memory addresses that were intended as padding on ARM if the expected layout of the variable arguments list is not matched exactly, even though it might work for a subset of some values on the x86 or x64 architectures. Consider this example:
+On the ARM architecture, parameters from the variable arguments list that are passed on the stack are subject to alignment. For example, a 64-bit parameter is aligned on a 64-bit boundary. On x86 and x64, arguments that are passed on the stack aren't subject to alignment and pack tightly. This difference can cause a variadic function like `printf` to read memory addresses that were intended as padding on ARM if the expected layout of the variable arguments list isn't matched exactly, even though it might work for a subset of some values on the x86 or x64 architectures. Consider this example:
```C
// notice that a 64-bit integer is passed to the function, but '%d' is used to read it.
@@ -69,7 +71,7 @@ printf("%I64d\n", 1LL);
Because ARM, x86, and x64 processors are so different, they can present different requirements to compiler implementations, and also different opportunities for optimizations. Because of this, together with other factors like calling-convention and optimization settings, a compiler might evaluate function arguments in a different order on different architectures or when the other factors are changed. This can cause the behavior of an app that relies on a specific evaluation order to change unexpectedly.
-This kind of error can occur when arguments to a function have side effects that impact other arguments to the function in the same call. Usually this kind of dependency is easy to avoid, but it can sometimes be obscured by dependencies that are difficult to discern, or by operator overloading. Consider this code example:
+This kind of error can occur when arguments to a function have side effects that impact other arguments to the function in the same call. Usually this kind of dependency is easy to avoid but can be obscured by dependencies that are difficult to discern or by operator overloading. Consider this code example:
```cpp
handle memory_handle;
@@ -83,15 +85,15 @@ This appears well-defined, but if `->` and `*` are overloaded operators, then th
Handle::acquire(operator->(memory_handle), operator*(p));
```
-And if there's a dependency between `operator->(memory_handle)` and `operator*(p)`, the code might rely on a specific evaluation order, even though the original code looks like there is no possible dependency.
+And if there's a dependency between `operator->(memory_handle)` and `operator*(p)`, the code might rely on a specific evaluation order, even though the original code looks like there's no possible dependency.
-### volatile keyword default behavior
+### `volatile` keyword default behavior
The MSVC compiler supports two different interpretations of the **`volatile`** storage qualifier that you can specify by using compiler switches. The [/volatile:ms](reference/volatile-volatile-keyword-interpretation.md) switch selects the Microsoft extended volatile semantics that guarantee strong ordering, as has been the traditional case for x86 and x64 because of the strong memory model on those architectures. The [/volatile:iso](reference/volatile-volatile-keyword-interpretation.md) switch selects the strict C++ standard volatile semantics that don't guarantee strong ordering.
-On the ARM architecture, the default is **/volatile:iso** because ARM processors have a weakly ordered memory model, and because ARM software doesn't have a legacy of relying on the extended semantics of **/volatile:ms** and doesn't usually have to interface with software that does. However, it's still sometimes convenient or even required to compile an ARM program to use the extended semantics. For example, it may be too costly to port a program to use the ISO C++ semantics, or driver software might have to adhere to the traditional semantics to function correctly. In these cases, you can use the **/volatile:ms** switch; however, to recreate the traditional volatile semantics on ARM targets, the compiler must insert memory barriers around each read or write of a **`volatile`** variable to enforce strong ordering, which can have a negative impact on performance.
+On the ARM architecture (except ARM64EC), the default is **/volatile:iso** because ARM processors have a weakly ordered memory model, and because ARM software doesn't have a legacy of relying on the extended semantics of **/volatile:ms** and doesn't usually have to interface with software that does. However, it's still sometimes convenient or even required to compile an ARM program to use the extended semantics. For example, it may be too costly to port a program to use the ISO C++ semantics, or driver software might have to adhere to the traditional semantics to function correctly. In these cases, you can use the **/volatile:ms** switch; however, to recreate the traditional volatile semantics on ARM targets, the compiler must insert memory barriers around each read or write of a **`volatile`** variable to enforce strong ordering, which can have a negative impact on performance.
-On the x86 and x64 architectures, the default is **/volatile:ms** because much of the software that has already been created for these architectures by using MSVC relies on them. When you compile x86 and x64 programs, you can specify the **/volatile:iso** switch to help avoid unnecessary reliance on the traditional volatile semantics, and to promote portability.
+On the x86, x64, and ARM64EC architectures, the default is **/volatile:ms** because much of the software that has already been created for these architectures by using MSVC relies on them. When you compile x86, x64 and ARM64EC programs, you can specify the **/volatile:iso** switch to help avoid unnecessary reliance on the traditional volatile semantics, and to promote portability.
## See also
diff --git a/docs/build/compare-inclusion-methods.md b/docs/build/compare-inclusion-methods.md
new file mode 100644
index 0000000000..8c16032aee
--- /dev/null
+++ b/docs/build/compare-inclusion-methods.md
@@ -0,0 +1,43 @@
+---
+description: "Learn about the different ways to include library headers in C++: header files vs modules vs header units vs precompiled headers."
+title: "Compare header units, modules, and precompiled headers"
+ms.date: 11/30/2022
+f1_keywords: ["#include", "header file", "header unit", "module", "named module", "PCH", "precompiled header file", "IFC"]
+helpviewer_keywords: ["headers, C++ library", "libraries, Standard C++", "C++ Standard Library, headers", "STL", "Standard template library, headers", "precompiled header files, creating", "PCH files, creating", "import", "header unit", "ifc", "modules [C++]", "named modules [C++]", "import standard library (STL) using named modules"]
+---
+# Compare header units, modules, and precompiled headers
+
+Historically, you'd include the standard library with a directive like `#include `. However, it's expensive to include header files because they're reprocessed by every source file that includes them.
+
+Precompiled headers (PCH) were introduced to speed compilation by translating them once and reusing the result. But precompiled headers can be difficult to maintain.
+
+In C++20, modules were introduced as a significant improvement on header files and precompiled headers.
+
+Header units were introduced in C++20 as a way to temporarily bridge the gap between header files and modules. They provide some of the speed and robustness benefits of modules, while you migrate your code to use modules.
+
+Then, the C++23 standard library introduced support for importing the standard library as named modules. This is the fastest and most robust way to consume the standard library.
+
+To help you sort out the different options, this article compares the traditional `#include` method against precompiled headers, header units, and importing named modules.
+
+The following table is arranged by compiler processing speed and robustness, with `#include` being the slowest and least robust, and `import` being the fastest and most robust.
+
+| Method | Summary |
+|---|---|
+| `#include` | One disadvantage is that they expose macros and internal implementation. Internal implementation is often exposed as functions and types that start with an underscore. That's a convention to indicate that something is part of the internal implementation and shouldn't be used.
Header files are fragile because the order of #includes can modify behavior or break code and are affected by macro definitions.
Header files slow compilation. Particularly when multiple files include the same file because then the header file is reprocessed multiple times. |
+| [Precompiled header](../build/creating-precompiled-header-files.md) | A precompiled header (PCH) improves compile time by creating a compiler memory snapshot of a set of header files. This is an improvement on repeatedly rebuilding header files.
PCH files have restrictions that make them difficult to maintain.
PCH files are faster than `#include` but slower than `import`.|
+| [Header units](../build/walkthrough-header-units.md) | This is a new feature in C++20 that allows you to import 'well-behaved' header files as modules.
Header units are faster than `#include`, and are easier to maintain, significantly smaller, and also faster than pre-compiled header files (PCH).
Header units are an 'in-between' step meant to help transition to named modules in cases where you rely on macros defined in header files, since named modules don't expose macros.
Header units are slower than importing a named module.
Header units aren't affected by macro defines unless they're specified on the command line when the header unit is built--making them more robust than header files.
Header units expose the macros and internal implementation defined in them just as header file do, which named modules don't.
As a rough approximation of file size, a 250-megabyte PCH file might be represented by an 80-megabyte header unit file. |
+| [Modules](../cpp/modules-cpp.md) | This is the fastest and most robust way to import functionality.
Support for importing modules was introduced in C++20. The C++23 standard library introduces the two named modules described in this topic.
When you import `std`, you get the standard names such as `std::vector`, `std::cout`, but no extensions, no internal helpers such as `_Sort_unchecked`, and no macros.
The order of imports doesn't matter because there are no macro or other side-effects.
As a rough approximation of file size, a 250-megabyte PCH file might be represented by an 80-megabyte header unit file, which might be represented by a 25-megabyte module.
Named modules are faster because when a named module is compiled into an `.ifc` file and an `.obj` file, the compiler emits a structured representation of the source code that can be loaded quickly when the module is imported. The compiler can do some work (like name resolution) before emitting the `.ifc` file because of how named modules are order-independent and macro-independent--so this work doesn't have to be done when the module is imported. In contrast, when a header file is consumed with `#include`, its contents must be preprocessed and compiled again and again in every translation unit.
Precompiled headers, which are compiler memory snapshots, can mitigate those costs, but not as well as named modules. |
+
+If you can use C++20 features and the C++23 standard library in your app, use named modules.
+
+If you can use C++20 features but want to transition over time to modules, use header units in the interim.
+
+If you can't use C++20 features, use `#include` and consider precompiled headers.
+
+## See also
+
+[Precompiled header files](creating-precompiled-header-files.md)\
+[Overview of modules in C++](../cpp/modules-cpp.md)\
+[Tutorial: Import the C++ standard library using modules](../cpp/tutorial-import-stl-named-module.md)\
+[Walkthrough: Import STL libraries as header units](walkthrough-import-stl-header-units.md#approach1)\
+[Walkthrough: Build and import header units in your Visual C++ projects](walkthrough-header-units.md)
\ No newline at end of file
diff --git a/docs/build/configure-cmake-debugging-sessions.md b/docs/build/configure-cmake-debugging-sessions.md
index 724048132e..896d5a3bf4 100644
--- a/docs/build/configure-cmake-debugging-sessions.md
+++ b/docs/build/configure-cmake-debugging-sessions.md
@@ -1,7 +1,7 @@
---
title: "Configure CMake debugging sessions in Visual Studio"
description: "Describes how to use Visual Studio to configure CMake debugger settings."
-ms.date: 12/16/2020
+ms.date: 10/26/2023
helpviewer_keywords: ["CMake debugging"]
---
# Configure CMake debugging sessions
@@ -16,14 +16,28 @@ Native CMake support is available in Visual Studio 2017 and later. To see the do
All executable CMake targets are shown in the **Startup Item** dropdown in the toolbar. Select one to start a debugging session and launch the debugger.
-
+:::image type="complex" source="media/new-dropdowns.png" alt-text="Screenshot of the CMake startup items dropdown.":::
+The dropdown provides a list of debug targets to choose from. The selected item appears as a play button followed by the name of the selected debug target to run. In this example, the selected debug target is Hello World .exe.
+:::image-end:::
You can also start a debug session from Solution Explorer. First, switch to **CMake Targets View** in the **Solution Explorer** window.
-
+:::image type="complex" source="media/switch-to-targets-view.png" alt-text="Screenshot of the CMake Targets View menu.":::
+The solution explorer is shown. A right-click on an item in the Folder View has opened a menu that shows options such as Open, Open with, Compare with, and so on. The Switch to Targets View menu item is highlighted.
+:::image-end:::
Then, right-click on an executable and select **Debug**. This command automatically starts debugging the selected target based on your active configuration.
+:::image type="complex" source="media/debug-targets-view.png" alt-text="Screenshot of the CMake Targets View debug option menu.":::
+A right-click on a target in the CMake Targets view has opened a menu with options such as Set as Startup item, Build, Clean All, and so on. The Debug menu option is highlighted.
+:::image-end:::
+
+Starting in Visual Studio 2022 Version 17.6, you can also start a debugging session on your CMakeLists.txt file. To do so, just set a breakpoint in your CMakeLists.txt file and run **Configure Project with CMake Debugger** from the **Project** dropdown.
+
+:::image type="complex" source="media/cmake-debugger-entry.png" alt-text="Screenshot of the CMake Debugger dropdown.":::
+The Project dropdown is shown. The menu option to Configure Project with CMake debugger is highlighted.
+:::image-end:::
+
## Customize debugger settings
You can customize the debugger settings for any executable CMake target in your project. They're found in a configuration file called *launch.vs.json*, located in a *`.vs`* folder in your project root. A launch configuration file is useful in most debugging scenarios, because you can configure and save your debugging setup details. There are three entry points to this file:
@@ -111,7 +125,8 @@ In Visual Studio 2019 version 16.6, we added a new debug configuration of `type:
- `remoteMachineName`: Defaults to `"${debugInfo.remoteMachineName}"`. Name of the remote system that hosts the program to debug. Only required if different than the build system. Must have an existing entry in the [Connection Manager](../linux/connect-to-your-remote-linux-computer.md). Press **Ctrl+Space** to view a list of all existing remote connections.
- `cwd`: Defaults to `"${debugInfo.defaultWorkingDirectory}"`. Full Unix path to the directory on the remote system where `program` is run. The directory must exist.
-- `gdbPath`: Defaults to `${debugInfo.vsInstalledGdb}`. Full Windows path to the `gdb` used to debug. Defaults to the `gdb` installed with the Linux development with C/C++ workload.
+- `gdbPath`: Full Windows path to the `gdb` used to debug.
+
- `gdbserverPath`: Defaults to `usr/bin/gdbserver`. Full Unix path to the `gdbserver` used to debug.
- `preDebugCommand`: A Linux command to run immediately before starting `gdbserver`. `gdbserver` doesn't start until the command completes.
diff --git a/docs/build/configuring-programs-for-arm-processors-visual-cpp.md b/docs/build/configuring-programs-for-arm-processors-visual-cpp.md
index 94614dd10f..fc99baa1b2 100644
--- a/docs/build/configuring-programs-for-arm-processors-visual-cpp.md
+++ b/docs/build/configuring-programs-for-arm-processors-visual-cpp.md
@@ -2,7 +2,6 @@
description: "Learn more about: Configure C++ projects for ARM processors"
title: "Configure C++ projects for ARM processors"
ms.date: "07/11/2018"
-ms.assetid: 3d95f221-656a-480d-9651-9ad263895747
---
# Configure C++ projects for ARM processors
@@ -17,7 +16,7 @@ Describes the application binary interface used by Windows on ARM for register u
Describes the application binary interface used by Windows on ARM64 for register usage, calling conventions and exception handling.
[Common MSVC ARM migration issues](common-visual-cpp-arm-migration-issues.md)\
-Describes C++ code elements that are commonly assumed to be portable across architectures, but which produce different results for ARM than for x86 and x64.
+Describes C++ code elements that are commonly assumed to be portable across architectures, but that produce different results for ARM than for x86 and x64.
[ARM exception handling](arm-exception-handling.md)\
Describes the encoding scheme for stack unwinding during structured exception handling in Windows on ARM.
@@ -27,8 +26,14 @@ Describes the encoding scheme for stack unwinding during structured exception ha
## Related Sections
+[Get started with Arm64EC](/windows/arm/arm64ec-build)\
+Describes how to get started building your app or project using [Arm64EC](/windows/arm/arm64ec).
+
+[How to: Configure projects to target platforms](/visualstudio/ide/how-to-configure-projects-to-target-platforms)\
+Describes how to set up your build to target different processor architectures, including Arm64.
+
[ARM intrinsics](../intrinsics/arm-intrinsics.md)\
Describes compiler intrinsics for processors that use the ARM architecture.
-[ARM64 intrinsics](../intrinsics/arm-intrinsics.md)\
+[ARM64 intrinsics](../intrinsics/arm64-intrinsics.md)\
Describes compiler intrinsics for processors that use the ARM64 architecture.
diff --git a/docs/build/configuring-programs-for-windows-xp.md b/docs/build/configuring-programs-for-windows-xp.md
index 36e80bf241..3e96c4f48e 100644
--- a/docs/build/configuring-programs-for-windows-xp.md
+++ b/docs/build/configuring-programs-for-windows-xp.md
@@ -47,7 +47,7 @@ Along with the Windows XP platform toolset, several libraries include runtime su
- Universal C Runtime Library (UCRT)
- C++ Standard Library
- Active Template Library (ATL)
-- Concurrency Runtime Library (ConCRT)
+- Concurrency Runtime Library (ConcRT)
- Parallel Patterns Library (PPL)
- Microsoft Foundation Class Library (MFC)
- C++ AMP (C++ Accelerated Massive Programming) library.
@@ -61,7 +61,7 @@ These libraries are supported by the platform toolsets installed by Visual Studi
|CRT|X|X|X|
|C++ Standard Library|X|X|X|
|ATL|X|X|X|
-|ConCRT/PPL|X|X|X|
+|ConcRT/PPL|X|X|X|
|MFC|X||X|
|C++ AMP|X|X||
diff --git a/docs/build/cppproperties-schema-reference.md b/docs/build/cppproperties-schema-reference.md
index 59e6b45f77..cafd37a1e7 100644
--- a/docs/build/cppproperties-schema-reference.md
+++ b/docs/build/cppproperties-schema-reference.md
@@ -1,28 +1,28 @@
---
description: "Learn more about: CppProperties.json reference"
title: "CppProperties.json reference"
-ms.date: "08/09/2019"
+ms.date: 09/19/2022
helpviewer_keywords: ["CppProperties.json file [C++]"]
---
-# CppProperties.json reference
+# `CppProperties.json` reference
-Open Folder projects that don't use CMake can store project configuration settings for IntelliSense in a *CppProperties.json* file. (CMake projects use a [CMakeSettings.json](customize-cmake-settings.md) file.) A configuration consists of name/value pairs and defines #include paths, compiler switches, and other parameters. See [Open Folder projects for C++](open-folder-projects-cpp.md) for more information about how to add configurations in an Open Folder project. The following sections summarize the various settings. For a complete description of the schema, navigate to *CppProperties_schema.json*, whose full path is given at the top of the code editor when *CppProperties.json* is open.
+Open Folder projects that don't use CMake can store project configuration settings for IntelliSense in a *`CppProperties.json`* file. (CMake projects use a [`CMakeSettings.json`](customize-cmake-settings.md) file.) A configuration consists of name/value pairs and defines #include paths, compiler switches, and other parameters. For more information about how to add configurations in an Open Folder project, see [Open Folder projects for C++](open-folder-projects-cpp.md). The following sections summarize the various settings. For a complete description of the schema, navigate to *CppProperties_schema.json*, whose full path is given at the top of the code editor when *`CppProperties.json`* is open.
## Configuration properties
A configuration may have any of the following properties:
-|Name|Description|
-|-|-|
-|`inheritEnvironments`| Specifies which environments apply to this configuration.|
-|`name`|The configuration name that will appear in the C++ configuration dropdown|
-|`includePath`|A comma-separated list of folders that should be specified in the include path (maps to /I for most compilers)|
-|`defines`|The list of macros that should be defined (maps to /D for most compilers)|
-|`compilerSwitches`|One or more additional switches that can influence IntelliSense behavior|
-|`forcedInclude`|Header to be automatically included in every compilation unit (maps to /FI for MSVC or -include for clang)|
-|`undefines`|The list of macros to be undefined (maps to /U for MSVC)|
-|`intelliSenseMode`|The IntelliSense engine to be used. You can specify one of the predefined architecture-specific variants for MSVC, gcc, or Clang.|
-|`environments`|User-defined sets of variables that behave like environment variables in a command prompt and are accessed with the ${env.\} macro.|
+| Name | Description |
+|--|--|
+| `inheritEnvironments` | Specifies which environments apply to this configuration. |
+| `name` | The configuration name that will appear in the C++ configuration dropdown |
+| `includePath` | A comma-separated list of folders that should be specified in the include path (maps to `/I` for most compilers) |
+| `defines` | The list of macros that should be defined (maps to `/D` for most compilers) |
+| `compilerSwitches` | One or more additional switches that can influence IntelliSense behavior |
+| `forcedInclude` | Header to be automatically included in every compilation unit (maps to `/FI` for MSVC or `-include` for clang) |
+| `undefines` | The list of macros to be undefined (maps to `/U` for MSVC) |
+| `intelliSenseMode` | The IntelliSense engine to be used. You can specify one of the predefined architecture-specific variants for MSVC, gcc, or Clang. |
+| `environments` | User-defined sets of variables that behave like environment variables in a command prompt and are accessed with the `${env.VARIABLE}` macro. |
### intelliSenseMode values
@@ -30,58 +30,58 @@ The code editor shows the available options when you start to type:

-These are the supported values:
-
-- windows-msvc-x86
-- windows-msvc-x64
-- windows-msvc-arm
-- windows-msvc-arm64
-- android-clang-x86
-- android-clang-x64
-- android-clang-arm
-- android-clang-arm64
-- ios-clang-x86
-- ios-clang-x64
-- ios-clang-arm
-- ios-clang-arm64
-- windows-clang-x86
-- windows-clang-x64
-- windows-clang-arm
-- windows-clang-arm64
-- linux-gcc-x86
-- linux-gcc-x64
-- linux-gcc-arm
+This list shows the supported values:
+
+- `windows-msvc-x86`
+- `windows-msvc-x64`
+- `windows-msvc-arm`
+- `windows-msvc-arm64`
+- `android-clang-x86`
+- `android-clang-x64`
+- `android-clang-arm`
+- `android-clang-arm64`
+- `ios-clang-x86`
+- `ios-clang-x64`
+- `ios-clang-arm`
+- `ios-clang-arm64`
+- `windows-clang-x86`
+- `windows-clang-x64`
+- `windows-clang-arm`
+- `windows-clang-arm64`
+- `linux-gcc-x86`
+- `linux-gcc-x64`
+- `linux-gcc-arm`
Note: The values `msvc-x86` and `msvc-x64` are supported for legacy reasons only. Use the `windows-msvc-*` variants instead.
## Pre-defined Environments
-Visual Studio provides the following predefined environments for Microsoft C++ which map to the corresponding Developer Command Prompt. When you inherit one of these environments, you can refer to any of the environment variables by using the global property `env` with this macro syntax: ${env.\}.
+Visual Studio provides the following predefined environments for Microsoft C++ which map to the corresponding Developer Command Prompt. When you inherit one of these environments, you can refer to any of the environment variables by using the global property `env` with this macro syntax: `${env.VARIABLE}`.
-|Variable Name|Description|
-|-----------|-----------------|
-|vsdev|The default Visual Studio environment|
-|msvc_x86|Compile for x86 using x86 tools|
-|msvc_x64|Compile for AMD64 using 64-bit tools|
-|msvc_arm|Compile for ARM using x86 tools|
-|msvc_arm64|Compile for ARM64 using x86 tools|
-|msvc_x86_x64|Compile for AMD64 using x86 tools|
-|msvc_arm_x64|Compile for ARM using 64-bit tools|
-|msvc_arm64_x64|Compile for ARM64 using 64-bit tools|
+| Variable Name | Description |
+|--|--|
+| `vsdev` | The default Visual Studio environment |
+| `msvc_x86` | Compile for x86 using x86 tools |
+| `msvc_x64` | Compile for AMD64 using 64-bit tools |
+| `msvc_arm` | Compile for ARM using x86 tools |
+| `msvc_arm64` | Compile for ARM64 using x86 tools |
+| `msvc_x86_x64` | Compile for AMD64 using x86 tools |
+| `msvc_arm_x64` | Compile for ARM using 64-bit tools |
+| `msvc_arm64_x64` | Compile for ARM64 using 64-bit tools |
When the Linux workload is installed, the following environments are available for remotely targeting Linux and WSL:
-|Variable Name|Description|
-|-----------|-----------------|
-|linux_x86|Target x86 Linux remotely|
-|linux_x64|Target x64 Linux remotely|
-|linux_arm|Target ARM Linux remotely|
+| Variable Name | Description |
+|--|--|
+| `linux_x86` | Target x86 Linux remotely |
+| `linux_x64` | Target x64 Linux remotely |
+| `linux_arm` | Target ARM Linux remotely |
## User-defined environments
-You can optionally use the `environments` property to define sets of variables in *CppProperties.json* either globally or per-configuration. These variables behave like environment variables in the context of an Open Folder project and can be accessed with the ${env.\} syntax from *tasks.vs.json* and *launch.vs.json* after they are defined here. However, they are not necessarily set as actual environment variables in any command prompt that Visual Studio uses internally.
+You can optionally use the `environments` property to define sets of variables in *`CppProperties.json`* either globally or per-configuration. These variables behave like environment variables in the context of an Open Folder project. You can access them with the `${env.VARIABLE}` syntax from *`tasks.vs.json`* and *`launch.vs.json`* after they're defined here. However, they aren't necessarily set as actual environment variables in any command prompt that Visual Studio uses internally.
-**Visual Studio 2019 version 16.4 and later:** Configuration-specific variables defined in *CppProperties.json* are automatically picked up by debug targets and tasks without the need to set `inheritEnvironments`. Debug targets are launched automatically with the environment you specify in *CppProperties.json*.
+**Visual Studio 2019 version 16.4 and later:** Configuration-specific variables defined in *`CppProperties.json`* are automatically picked up by debug targets and tasks without the need to set `inheritEnvironments`. Debug targets are launched automatically with the environment you specify in *`CppProperties.json`*.
**Visual Studio 2019 version 16.3 and earlier:** When you consume an environment, then you have to specify it in the `inheritsEnvironments` property even if the environment is defined as part of the same configuration; the `environment` property specifies the name of the environment. The following example shows a sample configuration for enabling IntelliSense for GCC in an MSYS2 installation. Note how the configuration both defines and inherits the `mingw_64` environment, and how the `includePath` property can access the `INCLUDE` variable.
@@ -113,21 +113,21 @@ You can optionally use the `environments` property to define sets of variables i
]
```
-When you define an **environments** property inside a configuration, it overrides any global variables of the same name.
+When you define an `"environments"` property inside a configuration, it overrides any global variables that have the same names.
## Built-in macros
-You have access to the following built-in macros inside *CppProperties.json*:
+You have access to the following built-in macros inside *`CppProperties.json`*:
-|Macro|Description|
-|-|-|
-|`${workspaceRoot}`| The full path to the workspace folder|
-|`${projectRoot}`| The full path to the folder where *CppProperties.json* is placed|
-|`${env.vsInstallDir}`| The full path to the folder where the running instance of Visual Studio is installed|
+| Macro | Description |
+|--|--|
+| `${workspaceRoot}` | The full path to the workspace folder |
+| `${projectRoot}` | The full path to the folder where *`CppProperties.json`* is placed |
+| `${env.vsInstallDir}` | The full path to the folder where the running instance of Visual Studio is installed |
### Example
-If your project has an include folder and also includes *windows.h* and other common headers from the Windows SDK, you may want to update your *CppProperties.json* configuration file with the following includes:
+If your project has an include folder and also includes `*windows.h`* and other common headers from the Windows SDK, you may want to update your *`CppProperties.json`* configuration file with the following includes:
```json
{
@@ -136,28 +136,28 @@ If your project has an include folder and also includes *windows.h* and other co
"name": "Windows",
"includePath": [
// local include folder
- "${workspaceRoot}\include",
+ "${workspaceRoot}\\include",
// Windows SDK and CRT headers
- "${env.WindowsSdkDir}\include\${env.WindowsSDKVersion}\ucrt",
- "${env.NETFXSDKDir}\include\um",
- "${env.WindowsSdkDir}\include\${env.WindowsSDKVersion}\um",
- "${env.WindowsSdkDir}\include\${env.WindowsSDKVersion}\shared",
- "${env.VCToolsInstallDir}\include"
+ "${env.WindowsSdkDir}\\include\\${env.WindowsSDKVersion}\\ucrt",
+ "${env.NETFXSDKDir}\\include\\um",
+ "${env.WindowsSdkDir}\\include\\${env.WindowsSDKVersion}\\um",
+ "${env.WindowsSdkDir}\\include\\${env.WindowsSDKVersion}\\shared",
+ "${env.VCToolsInstallDir}\\include"
]
}
]
}
```
-> [!Note]
-> `%WindowsSdkDir%` and `%VCToolsInstallDir%` are not set as global environment variables so make sure you start devenv.exe from a Developer Command Prompt that defines these variables. (Type "developer" in the Windows Start Menu.)
+> [!NOTE]
+> `%WindowsSdkDir%` and `%VCToolsInstallDir%` are not set as global environment variables. Make sure you start *`devenv.exe`* from a Developer Command Prompt that defines these variables. (Type "developer" in the Windows Start Menu to find a Developer Command Prompt shortcut.)
## Troubleshoot IntelliSense errors
-If you are not seeing the IntelliSense that you expect, you can troubleshoot by going to **Tools** > **Options** > **Text Editor** > **C/C++** > **Advanced** and setting **Enable Logging** to **`true`**. To start with, try setting **Logging Level** to 5, and **Logging Filters** to 8.
+If you aren't seeing the IntelliSense that you expect, you can troubleshoot by going to **Tools** > **Options** > **Text Editor** > **C/C++** > **Advanced** and setting **Enable Logging** to **`true`**. To start with, try setting **Logging Level** to 5, and **Logging Filters** to 8.

-Output is piped to the **Output Window** and is visible when you choose **Show Output From: Visual C++ Log**. The output contains, among other things, the list of actual include paths that IntelliSense is trying to use. If the paths do not match the ones in *CppProperties.json*, try closing the folder and deleting the *.vs* sub-folder which contains cached browsing data.
+Output is piped to the **Output Window** and is visible when you choose **Show Output From: Visual C++ Log**. The output contains, among other things, the list of actual include paths that IntelliSense is trying to use. If the paths don't match the ones in *`CppProperties.json`*, try closing the folder and deleting the *`.vs`* subfolder that contains cached browsing data.
-To troubleshoot IntelliSense errors caused by missing include paths, open the **Error List** and filter its output to "IntelliSense only" and error code E1696 "cannot open source file ...".
+To troubleshoot IntelliSense errors caused by missing include paths, open the **Error List** tab, and then filter its output to "IntelliSense only" and error code E1696 "cannot open source file ...".
diff --git a/docs/build/create-reusable-property-configurations.md b/docs/build/create-reusable-property-configurations.md
index f9f7157a8c..d046426504 100644
--- a/docs/build/create-reusable-property-configurations.md
+++ b/docs/build/create-reusable-property-configurations.md
@@ -1,45 +1,45 @@
---
description: "Learn more about: Share or reuse Visual Studio project settings"
title: "Share or reuse Visual Studio project settings - C++"
-ms.date: "07/17/2019"
+ms.date: 02/07/2022
helpviewer_keywords: ["project properties [C++], reusable"]
---
# Share or reuse Visual Studio project settings
-To create a custom group of settings that you can share with others or reuse in multiple projects, use **Property Manager** to create a *property sheet* (.props file) to store the settings for each kind of project that you want to be able to reuse or share with others. Using property sheets are far less error-prone than other ways of creating "global" settings.
+To create a custom group of settings that you can share with others or reuse in multiple projects, use **Property Manager** to create a *property sheet* (a *`.props`* file) to store the settings for each kind of project that you want to be able to reuse or share with others. Using property sheets are far less error-prone than other ways of creating "global" settings.
> [!IMPORTANT]
-> **.user files and why they are problematic**
+> **The problem with *`*.user`* files**
>
-> Past versions of Visual Studio used global property sheets that had a .user file name extension and were located in the \\AppData\Local\Microsoft\MSBuild\v4.0\ folder. We no longer recommend these files because they set properties for project configurations on a per-user, per-computer basis. Such "global" settings can interfere with builds, especially when you are targeting more than one platform on your build computer. For example, if you have both an MFC project and Windows Phone project, the .user properties would be invalid for one of them. Reusable property sheets are more flexible and more robust.
+> Past versions of Visual Studio used global property sheets that had a *`.user`* file name extension and were located in the *`\\AppData\Local\Microsoft\MSBuild\v4.0\`* folder. We no longer recommend these files because they set properties for project configurations on a per-user, per-computer basis. Such "global" settings can interfere with builds, especially when you are targeting more than one platform on your build computer. For example, if you have both an MFC project and Windows Phone project, the *`.user`* properties would be invalid for one of them. Reusable property sheets are more flexible and more robust.
>
-> Although .user files are still installed by Visual Studio and participate in property inheritance, they are empty by default. The best practice is to delete the reference to them in **Property Manager** to ensure that your projects operate independently of any per-user, per-computer settings This is important to ensure correct behavior in a SCC (source code control) environment.
+> Although *`.user`* files are still installed by Visual Studio and participate in property inheritance, they're empty by default. The best practice is to delete any reference to them in **Property Manager** to ensure that your projects operate independently of any per-user, per-computer settings. This practice is important to ensure correct behavior in a SCC (source code control) environment.
To display **Property Manager**, on the menu bar, choose **View** > **Property Manager** or **View** > **Other Windows** > **Property Manager**, depending on your settings.
-If you have a common, frequently used set of properties that you want to apply to multiple projects, you can use **Property Manager** to capture them in a reusable *property sheet* file, which by convention has a .props file name extension. You can apply the sheet (or sheets) to new projects so that you don't have to set its properties from scratch.
+If you want to apply a common, frequently used set of properties to multiple projects, you can use **Property Manager** to capture them in a reusable *property sheet* file, which by convention has a *`.props`* file name extension. You can apply the sheet (or sheets) to new projects so you don't have to set those properties from scratch.

-Under each configuration node, you see nodes for each property sheet that applies to that configuration. The system adds property sheets that set values based on options you choose in the app wizard when you create the project. Right-click any node and choose Properties to see the properties that apply to that node. All the property sheets are imported automatically into the project's "master" property sheet (ms.cpp.props) and are evaluated in the order they appear in Property Manager. You can move them to change the evaluation order. Property sheets that are evaluated later will override the values in previously-evaluated sheets. See [Project property inheritance](project-property-inheritance.md) for more information about the order of evaluation in the .vcxproj file, the .props and .targets files, environment variables and the command line.
+Under each configuration node, you see nodes for each property sheet that applies to that configuration. The system adds property sheets that set common values based on options you choose in the app wizard when you create the project. Right-click any node and choose Properties to see the properties that apply to that node. All the property sheets are imported automatically into the project's primary property sheet (*`ms.cpp.props`*) and are evaluated in the order they appear in Property Manager. You can move them to change the evaluation order. Property sheets that are evaluated later override the values in previously evaluated sheets. For more information about the order of evaluation in the *`.vcxproj`* file, the *`.props`* and *`.targets`* files, environment variables, and the command line, see [Project property inheritance](project-property-inheritance.md).
If you choose **Add New Project Property Sheet** and then select, for example, the MyProps.props property sheet, a property page dialog box appears. Notice that it applies to the MyProps property sheet; any changes you make are written to the sheet, not to the project file (.vcxproj).
-Properties in a property sheet are overridden if the same property is set directly in the .vcxproj file.
+Properties in a property sheet are overridden if the same property is set directly in the *`.vcxproj`* file.
You can import a property sheet as often as required. Multiple projects in a solution can inherit settings from the same property sheet, and a project can have multiple sheets. A property sheet itself can inherit settings from another property sheet.
-You can also create one property sheet for multiple configurations. To do this, create a property sheet for each configuration, open the shortcut menu for one of them, choose **Add Existing Property Sheet**, and then add the other sheets. However, if you use one common property sheet, be aware that when you set a property, it gets set for all configurations that the sheet applies to, and that the IDE doesn't show which projects or other property sheets are inheriting from a given property sheet.
+You can also create a common property sheet for multiple configurations. To create a property sheet for each configuration, open the shortcut menu for one of them, choose **Add Existing Property Sheet**, and then add the other sheets. However, if you use a common property sheet, properties you set for all configurations that the sheet applies to. The IDE doesn't show which projects or other property sheets inherit from a given property sheet.
-In large solutions that will have many projects, it can be useful to create a property sheet at the solution level. When you add a project to the solution, use **Property Manager** to add that property sheet to the project. If required at the project level, you can add a new property sheet to set project-specific values.
+In large solutions that have many projects, it can be useful to create a common property sheet for all the projects in the solution. Create the property sheet as usual. Use **Property Manager** to add that property sheet to each project in the solution. If necessary at the project level, you can add another property sheet to set project-specific values.
> [!IMPORTANT]
-> A .props file by default does not participate in source control because it isn't created as a project item. You can manually add the file as a solution item if you want to include it in source control.
+> A *`.props`* file by default does not participate in source control because it isn't created as a project item. You can manually add the file as a solution item if you want to include it in source control.
#### To create a property sheet
1. On the menu bar, choose **View** > **Property Manager** or **View** > **Other Windows** > **Property Manager**. The **Property Manager** opens.
-2. To define the scope of the property sheet, select the item to which it applies. This can be a particular configuration, or another property sheet. Open the shortcut menu for this item and then choose **Add New Project Property Sheet**. Specify a name and location.
+2. To define the scope of the property sheet, select the item to which it applies. This item can be a particular configuration, or another property sheet. Open the shortcut menu for this item and then choose **Add New Project Property Sheet**. Specify a name and location.
3. In **Property Manager**, open the new property sheet and then set the properties you want to include.
diff --git a/docs/build/creating-and-managing-visual-cpp-projects.md b/docs/build/creating-and-managing-visual-cpp-projects.md
index f6fa4c479e..2441a8b327 100644
--- a/docs/build/creating-and-managing-visual-cpp-projects.md
+++ b/docs/build/creating-and-managing-visual-cpp-projects.md
@@ -1,80 +1,92 @@
---
-description: "Learn more about: Visual Studio projects - C++"
-title: "Visual Studio Projects - C++"
-ms.date: "10/25/2019"
-helpviewer_keywords: ["ATL projects, creating", "Visual Studio C++ projects, creating", "projects [C++], creating", "Visual Studio C++ projects", "ATL projects"]
-ms.assetid: 11003cd8-9046-4630-a189-a32bf3b88047
+title: "Create and Configure Visual Studio C++ Projects"
+description: "Learn how to create a Visual Studio C++ project, and then add code and build your project."
+ms.date: 03/24/2025
+ms.topic: concept-article
+helpviewer_keywords: ["Visual Studio C++ projects, creating", "projects [C++], creating", "Visual Studio C++ projects"]
---
-# Visual Studio projects - C++
+# Visual Studio C++ projects
-A *Visual Studio project* is a project based on the MSBuild build system. MSBuild is the native build system for Visual Studio and is generally the best build system to use for Windows-specific programs. MSBuild is tightly integrated with Visual Studio, but you can also use it from the command line. For cross-platform projects, or projects that use open-source libraries, we recommend using [CMake projects in Visual Studio](cmake-projects-in-visual-studio.md) in Visual Studio 2017 and later. For information about upgrading MSBuild projects from older versions of Visual Studio, see the [Microsoft C++ Porting and Upgrading Guide](../porting/visual-cpp-porting-and-upgrading-guide.md).
+A *Visual Studio project* is a collection of code files and assets such as icons, images, and so on, that are built together using the MSBuild system. MSBuild is the native build system for Visual Studio and is generally the best build system to use for Windows-specific programs. MSBuild is tightly integrated with Visual Studio, but you can also use it from the command line.
-## Create a project
+For information about upgrading MSBuild projects from older versions of Visual Studio, see the [Microsoft C++ porting and upgrading guide](../porting/visual-cpp-porting-and-upgrading-guide.md).
+
+For cross-platform projects, or projects that use open-source libraries, we recommend using [CMake projects in Visual Studio](cmake-projects-in-visual-studio.md).
+
+## Create a Visual Studio C++ project
::: moniker range=">=msvc-160"
-You can create C++ projects by choosing **File** > **New** > **Project**, then setting the **Language** to C++. In the results list you see a list of project templates which you can filter by setting the **Platform** or **Project Type** and by typing keywords into the search box.
+1. Create a C++ project by choosing **File** > **New** > **Project**.
+
+1. In the **Create a new project** dialog, set the **Language** dropdown to **C++**. This filters the list of project templates to C++ projects. You can filter the templates by setting the **Platform**, **Project Type**, or by entering keywords in the search box.
- 
+ :::image type="content" source="../build/media/vs2019-choose-console-app.png" alt-text="Screenshot of the Create a new project wizard. The Console App project template is selected.":::
+
+1. Select a project template, then choose **Next**.
+
+1. On the **Configure your new project page**, enter project-specific settings such as the project name or location and then choose **Create** to create your project.
::: moniker-end
::: moniker range="msvc-150"
-You can create C++ projects by choosing **File** > **New** > **Project**, then choosing Visual C++ in the left pane. In the center pane you see a list of project templates:
-
- 
+1. Create a C++ project by choosing **File** > **New** > **Project**.
-::: moniker-end
+1. Choose **Visual C++** in the left pane. In the center pane, a list of project templates appears:
-For more information about all the default project templates that are included in Visual Studio, see [C++ project templates in Visual Studio](reference/visual-cpp-project-types.md). You can create your own project templates. For more information, see [How to: Create project templates](/visualstudio/ide/how-to-create-project-templates).
+ :::image type="content" source="../overview/media/vs2017-new-project.png" alt-text="Screenshot of the New Project dialog, showing available project templates for C++ such as Windows Console Application.":::
-After you create a project, it appears in the [Solution Explorer](/visualstudio/ide/solutions-and-projects-in-visual-studio) window:
+::: moniker-end
- 
+For more information about the default project templates included in Visual Studio, see [C++ project templates in Visual Studio](reference/visual-cpp-project-types.md).
-When you create a new project, a solution file (.sln) is also created. You can add additional projects to the solution by right-clicking on it in **Solution Explorer**. The solution file is used to coordinate build dependencies when you have multiple related projects but doesn't do much more than that. All the compiler options are set at the project level.
+You can create your own project templates. For more information, see [Create project templates](/visualstudio/ide/how-to-create-project-templates).
-## Add items
+After you create a project, it appears in the [Solution Explorer](/visualstudio/ide/solutions-and-projects-in-visual-studio) window:
-Add source code files, icons, or any other items to your project by right-clicking on the project in **Solution Explorer** and choosing **Add > New** or **Add > Existing**.
+:::image type="content" source="media/mathlibrary-solution-explorer-153.png" alt-text="Screenshot of the Solution Explorer window, showing source files, header files, and resource files.":::
-## Add third party libraries
+When you create a new project, a solution file (*`.sln`*) is also created. A *Visual Studio solution* is a collection of one or more projects. You can add another project to the solution by right-clicking the solution name in **Solution Explorer** > **Add** > **New project**.
-To add third-party libraries, use the [vcpkg](https://vcpkg.io/) package manager. Run the Visual Studio integration step to set up the paths to that library when you reference it from any Visual Studio project.
+The solution file coordinates build dependencies when you have multiple related projects. Compiler options are set at the project level.
-## Set compiler options and other build properties
+## Add code, icons, and other assets to a project
-To configure build settings for a project, right-click on the project in **Solution Explorer** and choose **Properties**. For more information, see [Set C++ compiler and build properties in Visual Studio](working-with-project-properties.md).
+Add source code files, icons, or any other items to your project by right-clicking on the project in **Solution Explorer** and choosing **Add > New** or **Add > Existing**.
-## Compile and run
+## Add third-party libraries to a project
-To compile and run the new project, press **F5** or click the *debug dropdown* with the green arrow on the main toolbar. The *configuration dropdown* is where you choose whether to perform a *Debug* or *Release* build (or some other custom configuration).
+Over 900 C++ open source libraries are available via the [vcpkg](/vcpkg/) package manager. Run the Visual Studio integration step to set up the paths to that library when you reference it from any Visual Studio project.
-A new project compiles without errors. When adding your own code, you may occasionally introduce an error or trigger a warning. An error prevents the build from completing; a warning does not. All errors and warnings will appear both in the Output Window and in the Error List when you build the project.
+For more information about consuming a library that you have downloaded by using the **vcpkg** package manager, see:
+- [vcpkg in CMake projects](/vcpkg/users/buildsystems/cmake-integration)
+- [Install and use packages with CMake in Visual Studio](/vcpkg/get_started/get-started-vs)
+- [vcpkg in MSBuild projects](/vcpkg/users/buildsystems/msbuild-integration)
+- [Tutorial: Install and use packages with MSBuild in Visual Studio](/vcpkg/get_started/get-started-msbuild)
- 
+There are also commercial third-party libraries that you can install. Follow their installation instructions.
-In the Error List, you can press **F1** on a highlighted error to go to its documentation topic.
+## Set compiler options and build properties
-## In This Section
+To configure build settings for a project, right-click on the project in **Solution Explorer** and choose **Properties**. For more information, see [Set compiler and build properties](working-with-project-properties.md).
-[Set C++ compiler and build properties in Visual Studio](working-with-project-properties.md)
-How to use Property Pages and Property Sheets to specify your project settings.
+## Compile and run a project
-[Reference libraries and components at build time](adding-references-in-visual-cpp-projects.md)
-How to include libs, DLLs, COM and .NET components in a project.
+To compile and run the new project, press **F5** or select the *debug dropdown* with the green arrow on the main toolbar. The *configuration dropdown* is where you choose whether to perform a *Debug* or *Release* build (or some other custom configuration).
-[Organize Project Output Files](how-to-organize-project-output-files-for-builds.md)
-How to customize the location of the executable files created in the build process.
+A new project compiles without errors. When adding your own code, you might occasionally introduce an error or trigger a warning. An error prevents the build from completing; a warning doesn't. All errors and warnings appear both in the Output Window and in the Error List when you build the project.
-[Custom Build Steps and Build Events](understanding-custom-build-steps-and-build-events.md)
-How to add any arbitrary command to the build process at specified points.
+:::image type="content" source="../overview/media/vs2017-output-error-list.png" alt-text="Screenshot of the Output window and Error list, showing a syntax error for a misplaced colon.":::
-[Create a project from existing code](how-to-create-a-cpp-project-from-existing-code.md)
-How to create a new Visual Studio project from a loose collection of source files.
+In the **Error List**, you can press **F1** on the highlighted error to go to its documentation topic.
-## See also
+## Related content
-[Projects and build systems](projects-and-build-systems-cpp.md)
-[Microsoft C++ Porting and Upgrading Guide](../porting/visual-cpp-porting-and-upgrading-guide.md)
+- [Create a project from existing code](how-to-create-a-cpp-project-from-existing-code.md)
+- [Set C++ compiler and build properties in Visual Studio](working-with-project-properties.md)
+- [Custom build steps and build events](understanding-custom-build-steps-and-build-events.md)
+- [Reference libraries and components at build time](adding-references-in-visual-cpp-projects.md)
+- [Organize project output files](how-to-organize-project-output-files-for-builds.md)
+- [Projects and build systems](projects-and-build-systems-cpp.md)
+- [Microsoft C++ porting and upgrade guide](../porting/visual-cpp-porting-and-upgrading-guide.md)
diff --git a/docs/build/creating-precompiled-header-files.md b/docs/build/creating-precompiled-header-files.md
index 447af4f6e0..2b0f1f5ebe 100644
--- a/docs/build/creating-precompiled-header-files.md
+++ b/docs/build/creating-precompiled-header-files.md
@@ -1,86 +1,85 @@
---
-description: "Learn more about: Precompiled Header Files"
title: "Precompiled Header Files"
-ms.date: "10/24/2019"
+description: "Learn more about: Precompiled header files"
+ms.date: 06/29/2022
helpviewer_keywords: ["precompiled header files, creating", "PCH files, creating", "cl.exe compiler, precompiling code", ".pch files, creating"]
-ms.assetid: e2cdb404-a517-4189-9771-c869c660cb1b
---
-# Precompiled Header Files
+# Precompiled header files
-When you create a new project in Visual Studio, a *precompiled header file* named *pch.h* is added to the project. (In Visual Studio 2017 and earlier, the file was called *stdafx.h*.) The purpose of the file is to speed up the build process. Any stable header files, for example Standard Library headers such as ``, should be included here. The precompiled header is compiled only when it, or any files it includes, are modified. If you only make changes in your project source code, the build will skip compilation for the precompiled header.
+When you create a new project in Visual Studio, a *precompiled header file* named *`pch.h`* is added to the project. (In Visual Studio 2017 and earlier, the file was called *`stdafx.h`*.) The purpose of the file is to speed up the build process. Any stable header files, for example Standard Library headers such as ``, should be included here. The precompiled header is compiled only when it, or any files it includes, are modified. If you only make changes in your project source code, the build will skip compilation for the precompiled header.
-The compiler options for precompiled headers are [/Y](reference/y-precompiled-headers.md). In the project property pages, the options are located under **Configuration Properties > C/C++ > Precompiled Headers**. You can choose to not use precompiled headers, and you can specify the header file name and the name and path of the output file.
+The compiler options for precompiled headers are [`/Y`](reference/y-precompiled-headers.md). In the project property pages, the options are located under **Configuration Properties** > **C/C++** > **Precompiled Headers**. You can choose to not use precompiled headers, and you can specify the header file name and the name and path of the output file.
## Custom precompiled code
-For large projects that take significant time to build, you may want to consider creating custom precompiled files. The Microsoft C and C++ compilers provide options for precompiling any C or C++ code, including inline code. Using this performance feature, you can compile a stable body of code, store the compiled state of the code in a file, and, during subsequent compilations, combine the precompiled code with code that is still under development. Each subsequent compilation is faster because the stable code does not need to be recompiled.
+For large projects that take significant time to build, you may want to consider creating custom precompiled files. The Microsoft C and C++ compilers provide options for precompiling any C or C++ code, including inline code. Using this performance feature, you can compile a stable body of code, store the compiled state of the code in a file, and, during subsequent compilations, combine the precompiled code with code that's still under development. Each later compilation is faster because the stable code doesn't need to be recompiled.
-## When to Precompile Source Code
+## When to precompile source code
Precompiled code is useful during the development cycle to reduce compilation time, especially if:
- You always use a large body of code that changes infrequently.
-- Your program comprises multiple modules, all of which use a standard set of include files and the same compilation options. In this case, all include files can be precompiled into one precompiled header.
+- Your program comprises multiple modules, all of which use a standard set of include files and the same compilation options. In this case, all include files can be precompiled into one precompiled header. For more information about newer ways to handle include files, see [Compare header units, modules, and precompiled headers](compare-inclusion-methods.md).
-The first compilation — the one that creates the precompiled header (PCH) file — takes a bit longer than subsequent compilations. Subsequent compilations can proceed more quickly by including the precompiled code.
+The first compilation (the one that creates the precompiled header file) takes a bit longer than subsequent compilations. Subsequent compilations can proceed more quickly by including the precompiled code.
-You can precompile both C and C++ programs. In C++ programming, it is common practice to separate class interface information into header files. These header files can later be included in programs that use the class. By precompiling these headers, you can reduce the time a program takes to compile.
+You can precompile both C and C++ programs. In C++ programming, it's common practice to separate class interface information into header files. These header files can later be included in programs that use the class. By precompiling these headers, you can reduce the time a program takes to compile.
> [!NOTE]
-> Although you can use only one precompiled header (.pch) file per source file, you can use multiple .pch files in a project.
+> Although you can use only one precompiled header (*`.pch`*) file per source file, you can use multiple *`.pch`* files in a project.
-## Two Choices for Precompiling Code
+## Two choices for precompiling code
-You can precompile any C or C++ code; you are not limited to precompiling only header files.
+You can precompile any C or C++ code; you're not limited to precompiling only header files.
-Precompiling requires planning, but it offers significantly faster compilations if you precompile source code other than simple header files.
+Precompiling requires planning, but it offers much faster compilations if you precompile source code other than simple header files.
-Precompile code when you know that your source files use common sets of header files but don't include them in the same order, or when you want to include source code in your precompilation.
+Precompile code when you know that your source files use common sets of header files, or when you want to include source code in your precompilation.
-The precompiled-header options are [/Yc (Create Precompiled Header File)](reference/yc-create-precompiled-header-file.md) and [/Yu (Use Precompiled Header File)](reference/yu-use-precompiled-header-file.md). Use **/Yc** to create a precompiled header. When used with the optional [hdrstop](../preprocessor/hdrstop.md) pragma, **/Yc** lets you precompile both header files and source code. Select **/Yu** to use an existing precompiled header in the existing compilation. You can also use **/Fp** with the **/Yc** and **/Yu** options to provide an alternative name for the precompiled header.
+The precompiled-header options are [`/Yc` (Create Precompiled Header File)](reference/yc-create-precompiled-header-file.md) and [`/Yu` (Use Precompiled Header File)](reference/yu-use-precompiled-header-file.md). Use **`/Yc`** to create a precompiled header. When used with the optional [`hdrstop`](../preprocessor/hdrstop.md) pragma, **`/Yc`** lets you precompile both header files and source code. Select **`/Yu`** to use an existing precompiled header in the existing compilation. You can also use **`/Fp`** with the **`/Yc`** and **`/Yu`** options to provide an alternative name for the precompiled header.
-The compiler option reference topics for **/Yu** and **/Yc** discuss how to access this functionality in the development environment.
+The compiler option reference articles for **`/Yu`** and **`/Yc`** discuss how to access this functionality in the development environment.
-## Precompiled Header Consistency Rules
+## Precompiled header consistency rules
-Because PCH files contain information about the machine environment as well as memory address information about the program, you should only use a PCH file on the machine where it was created.
+Because PCH files contain information about the machine environment and memory address information about the program, you should only use a PCH file on the machine where it was created.
-## Consistency Rules for Per-File Use of Precompiled Headers
+## Consistency rules for per-file use of precompiled headers
-The [/Yu](reference/yu-use-precompiled-header-file.md) compiler option lets you specify which PCH file to use.
+The [`/Yu`](reference/yu-use-precompiled-header-file.md) compiler option lets you specify which PCH file to use.
-When you use a PCH file, the compiler assumes the same compilation environment — one that uses consistent compiler options, pragmas, and so on — that was in effect when you created the PCH file, unless you specify otherwise. If the compiler detects an inconsistency, it issues a warning and identifies the inconsistency where possible. Such warnings do not necessarily indicate a problem with the PCH file; they simply warn you of possible conflicts. Consistency requirements for PCH files are described in the following sections.
+When you use a PCH file, the compiler assumes the same compilation environment that was in effect when you created the PCH file, unless you specify otherwise. The compilation environment includes the compiler options, pragmas, and so on. If the compiler detects an inconsistency, it issues a warning and identifies the inconsistency where possible. Such warnings don't necessarily indicate a problem with the PCH file; they simply warn you of possible conflicts. Consistency requirements for PCH files are described in the following sections.
-### Compiler Option Consistency
+### Compiler option consistency
The following compiler options can trigger an inconsistency warning when using a PCH file:
-- Macros created using the Preprocessor (/D) option must be the same between the compilation that created the PCH file and the current compilation. The state of defined constants is not checked, but unpredictable results can occur if these change.
+- Macros created using the Preprocessor (**`/D`**) option must be the same between the compilation that created the PCH file and the current compilation. The state of defined constants isn't checked, but unpredictable results can occur if these macros change.
-- PCH files do not work with the /E and /EP options.
+- PCH files don't work with the **`/E`** and **`/EP`** options.
-- PCH files must be created using either the Generate Browse Info (/FR) option or the Exclude Local Variables (/Fr) option before subsequent compilations that use the PCH file can use these options.
+- PCH files must be created using either the Generate Browse Info (**`/FR`**) option or the Exclude Local Variables (**`/Fr`**) option before subsequent compilations that use the PCH file can use these options.
-### C 7.0-Compatible (/Z7)
+### C 7.0-compatible (`/Z7`)
-If this option is in effect when the PCH file is created, subsequent compilations that use the PCH file can use the debugging information.
+If this option is in effect when the PCH file is created, later compilations that use the PCH file can use the debugging information.
-If the C 7.0-Compatible (/Z7) option is not in effect when the PCH file is created, subsequent compilations that use the PCH file and /Z7 trigger a warning. The debugging information is placed in the current .obj file, and local symbols defined in the PCH file are not available to the debugger.
+If the C 7.0-Compatible (**`/Z7`**) option isn't in effect when the PCH file is created, later compilations that use the PCH file and **`/Z7`** trigger a warning. The debugging information is placed in the current *`.obj`* file, and local symbols defined in the PCH file aren't available to the debugger.
-### Include Path Consistency
+### Include path consistency
-A PCH file does not contain information about the include path that was in effect when it was created. When you use a PCH file, the compiler always uses the include path specified in the current compilation.
+A PCH file doesn't contain information about the header include path that was in effect when it was created. When you use a PCH file, the compiler always uses the header include path specified in the current compilation.
-### Source File Consistency
+### Source file consistency
-When you specify the Use Precompiled Header File (/Yu) option, the compiler ignores all preprocessor directives (including pragmas) that appear in the source code that will be precompiled. The compilation specified by such preprocessor directives must be the same as the compilation used for the Create Precompiled Header File (/Yc) option.
+When you specify the Use Precompiled Header File (**`/Yu`**) option, the compiler ignores all preprocessor directives (including pragmas) that appear in the source code that will be precompiled. The compilation specified by such preprocessor directives must be the same as the compilation used for the Create Precompiled Header File (**`/Yc`**) option.
-### Pragma Consistency
+### Pragma consistency
-Pragmas processed during the creation of a PCH file usually affect the file with which the PCH file is subsequently used. The `comment` and `message` pragmas do not affect the remainder of the compilation.
+Pragmas processed during the creation of a PCH file usually affect the file with which the PCH file is later used. The `comment` and `message` pragmas don't affect the remainder of the compilation.
-These pragmas affect only the code within the PCH file; they do not affect code that subsequently uses the PCH file:
+These pragmas affect only the code within the PCH file; they don't affect code that later uses the PCH file:
:::row:::
:::column span="":::
@@ -131,57 +130,60 @@ These pragmas are retained as part of a precompiled header, and affect the remai
:::column-end:::
:::row-end:::
-## Consistency Rules for /Yc and /Yu
+## Consistency rules for /Yc and /Yu
-When you use a precompiled header created using /Yc or /Yu, the compiler compares the current compilation environment to the one that existed when you created the PCH file. Be sure to specify an environment consistent with the previous one (using consistent compiler options, pragmas, and so on) for the current compilation. If the compiler detects an inconsistency, it issues a warning and identifies the inconsistency where possible. Such warnings don't necessarily indicate a problem with the PCH file; they simply warn you of possible conflicts. The following sections explain the consistency requirements for precompiled headers.
+When you use a precompiled header created using **`/Yc`** or **`/Yu`**, the compiler compares the current compilation environment to the one that existed when you created the PCH file. Be sure to specify an environment consistent with the previous one (using consistent compiler options, pragmas, and so on) for the current compilation. If the compiler detects an inconsistency, it issues a warning and identifies the inconsistency where possible. Such warnings don't necessarily indicate a problem with the PCH file; they simply warn you of possible conflicts. The following sections explain the consistency requirements for precompiled headers.
-### Compiler Option Consistency
+### Compiler option consistency
This table lists compiler options that might trigger an inconsistency warning when using a precompiled header:
-|Option|Name|Rule|
-|------------|----------|----------|
-|/D|Define constants and macros|Must be the same between the compilation that created the precompiled header and the current compilation. The state of defined constants is not checked, but unpredictable results can occur if your files depend on the values of the changed constants.|
-|/E or /EP|Copy preprocessor output to standard output|Precompiled headers do not work with the /E or /EP option.|
-|/Fr or /FR|Generate Microsoft Source Browser information|For the /Fr and /FR options to be valid with the /Yu option, they must also have been in effect when the precompiled header was created. Subsequent compilations that use the precompiled header also generate Source Browser information. Browser information is placed in a single .sbr file and is referenced by other files in the same manner as CodeView information. You cannot override the placement of Source Browser information.|
-|/GA, /GD, /GE, /Gw, or /GW|Windows protocol options|Must be the same between the compilation that created the precompiled header and the current compilation. If these options differ, a warning message results.|
-|/Zi|Generate complete debugging information|If this option is in effect when the precompiled header is created, subsequent compilations that use the precompilation can use that debugging information. If /Zi is not in effect when the precompiled header is created, subsequent compilations that use the precompilation and the /Zi option trigger a warning. The debugging information is placed in the current object file, and local symbols defined in the precompiled header are not available to the debugger.|
+| Option | Name | Rule |
+|--|--|--|
+| **`/D`**| Define constants and macros | Must be the same between the compilation that created the precompiled header and the current compilation. The state of defined constants isn't checked. However, unpredictable results can occur if your files depend on the values of the changed constants. |
+| **`/E`** or **`/EP`** | Copy preprocessor output to standard output | Precompiled headers don't work with the **`/E`** or **`/EP`** option. |
+| **`/Fr`** or **`/FR`** | Generate Microsoft Source Browser information | For the **`/Fr`** and **`/FR`** options to be valid with the **`/Yu`** option, they must also have been in effect when the precompiled header was created. Subsequent compilations that use the precompiled header also generate Source Browser information. Browser information is placed in a single *`.sbr`* file and is referenced by other files in the same manner as CodeView information. You can't override the placement of Source Browser information. |
+| **`/GA`**, **`/GD`**, **`/GE`**, **`/Gw`**, or **`/GW`** | Windows protocol options | Must be the same between the compilation that created the precompiled header and the current compilation. The compiler emits a warning if these options differ. |
+| **`/Zi`** | Generate complete debugging information | If this option is in effect when the precompiled header is created, subsequent compilations that use the precompilation can use that debugging information. If **`/Zi`** isn't in effect when the precompiled header is created, subsequent compilations that use the precompilation and the **`/Zi`** option trigger a warning. The debugging information is placed in the current object file, and local symbols defined in the precompiled header aren't available to the debugger. |
> [!NOTE]
> The precompiled header facility is intended for use only in C and C++ source files.
-## Using Precompiled Headers in a Project
+## Using precompiled headers in a project
Previous sections present an overview of precompiled headers: /Yc and /Yu, the /Fp option, and the [hdrstop](../preprocessor/hdrstop.md) pragma. This section describes a method for using the manual precompiled-header options in a project; it ends with an example makefile and the code that it manages.
-For another approach to using the manual precompiled-header options in a project, study one of the makefiles located in the MFC\SRC directory that is created during the default setup of Visual Studio. These makefiles take a similar approach to the one presented in this section but make greater use of Microsoft Program Maintenance Utility (NMAKE) macros, and offer greater control of the build process.
+For another approach to using the manual precompiled-header options in a project, study one of the makefiles located in the *`MFC\SRC`* directory that's created during the default setup of Visual Studio. These makefiles take a similar approach to the one presented in this section. They make greater use of Microsoft Program Maintenance Utility (NMAKE) macros, and offer greater control of the build process.
-## PCH Files in the Build Process
+## PCH files in the build process
-The code base of a software project is usually contained in multiple C or C++ source files, object files, libraries, and header files. Typically, a makefile coordinates the combination of these elements into an executable file. The following figure shows the structure of a makefile that uses a precompiled header file. The NMAKE macro names and the file names in this diagram are consistent with those in the example code found in [Sample Makefile for PCH](#sample-makefile-for-pch) and [Example Code for PCH](#example-code-for-pch).
+The code base of a software project is often contained in multiple C or C++ source files, object files, libraries, and header files. Typically, a makefile coordinates the combination of these elements into an executable file. The following figure shows the structure of a makefile that uses a precompiled header file. The NMAKE macro names and the file names in this diagram are consistent with the example code found in [Sample makefile for PCH](#sample-makefile-for-pch) and [Example code for PCH](#example-code-for-pch).
The figure uses three diagrammatic devices to show the flow of the build process. Named rectangles represent each file or macro; the three macros represent one or more files. Shaded areas represent each compile or link action. Arrows show which files and macros are combined during the compilation or linking process.
-
-Structure of a Makefile That Uses a Precompiled Header File
+Structure of a makefile that uses a precompiled header file:
-Beginning at the top of the diagram, both STABLEHDRS and BOUNDRY are NMAKE macros in which you list files not likely to need recompilation. These files are compiled by the command string
+:::image type="complex" source="media/vc30ow1.gif" alt-text="Diagram showing example inputs and outputs of a makefile that uses a precompiled header file.":::
+The diagram shows `$(STABLEHDRS)` and `$(BOUNDRY)` feeding into CL /c /W3 /Yc$(BOUNDRY) applib.cpp myapp.cpp. The output of that is $(STABLE.PCH). Then, applib.cpp and $(UNSTABLEHDRS) and $(STABLE.PCH) feed into CL /c /w3 /Yu $(BOUNDRY) applib.cpp, which produces applib.obj. myapp.cpp, $(UNSTABLEHDR), and $(STABLE.PCH) feed into CL /c /w3 /Yu $(BOUNDRY) myapp.cpp, which produces myapp.obj. Finally, applib.obj and myapp.obj are combined by LINK /NOD ONERROR:NOEXE $(OBJS), myapp, NUL, $(LIBS), NUL to produce myapp.exe.
+:::image-end:::
+
+Beginning at the top of the diagram, both `STABLEHDRS` and `BOUNDRY` are NMAKE macros in which you list files not likely to need recompilation. These files are compiled by the command string
`CL /c /W3 /Yc$(BOUNDRY) applib.cpp myapp.cpp`
-only if the precompiled header file (STABLE.pch) does not exist or if you make changes to the files listed in the two macros. In either case, the precompiled header file will contain code only from the files listed in the STABLEHDRS macro. List the last file you want precompiled in the BOUNDRY macro.
+only if the precompiled header file (*`STABLE.pch`*) doesn't exist or if you make changes to the files listed in the two macros. In either case, the precompiled header file will contain code only from the files listed in the `STABLEHDRS` macro. List the last file you want precompiled in the `BOUNDRY` macro.
-The files you list in these macros can be either header files or C or C++ source files. (A single PCH file cannot be used with both C and C++ modules.) Note that you can use the **hdrstop** macro to stop precompilation at some point within the BOUNDRY file. See [hdrstop](../preprocessor/hdrstop.md) for more information.
+The files you list in these macros can be either header files or C or C++ source files. (A single PCH file can't be used with both C and C++ sources.) You can use the **`hdrstop`** macro to stop precompilation at some point within the `BOUNDRY` file. For more information, see [`hdrstop`](../preprocessor/hdrstop.md).
-Continuing down the diagram, APPLIB.obj represents the support code used in your final application. It is created from APPLIB.cpp, the files listed in the UNSTABLEHDRS macro, and precompiled code from the precompiled header.
+Next in the diagram, *`APPLIB.obj`* represents the support code used in your final application. It's created from *`APPLIB.cpp`*, the files listed in the `UNSTABLEHDRS` macro, and precompiled code from the precompiled header.
-MYAPP.obj represents your final application. It is created from MYAPP.cpp, the files listed in the UNSTABLEHDRS macro, and precompiled code from the precompiled header.
+*`MYAPP.obj`* represents your final application. It's created from *`MYAPP.cpp`*, the files listed in the `UNSTABLEHDRS` macro, and precompiled code from the precompiled header.
-Finally, the executable file (MYAPP.EXE) is created by linking the files listed in the OBJS macro (APPLIB.obj and MYAPP.obj).
+Finally, the executable file (*`MYAPP.EXE`*) is created by linking the files listed in the `OBJS` macro (*`APPLIB.obj`* and *`MYAPP.obj`*).
-## Sample Makefile for PCH
+## Sample makefile for PCH
-The following makefile uses macros and an !IF, !ELSE, !ENDIF flow-of-control command structure to simplify its adaptation to your project.
+The following makefile uses macros and an `!IF`, `!ELSE`, `!ENDIF` flow-of-control command structure to simplify its adaptation to your project.
```NMAKE
# Makefile : Illustrates the effective use of precompiled
@@ -227,26 +229,28 @@ stable.pch : $(STABLEHDRS)
$(CPP) $(CLFLAGS) /Yc$(BOUNDRY) applib.cpp myapp.cpp
```
-Aside from the STABLEHDRS, BOUNDRY, and UNSTABLEHDRS macros shown in the figure "Structure of a Makefile That Uses a Precompiled Header File" in [PCH Files in the Build Process](#pch-files-in-the-build-process), this makefile provides a CLFLAGS macro and a LINKFLAGS macro. You must use these macros to list compiler and linker options that apply whether you build a debug or final version of the application's executable file. There is also a LIBS macro where you list the libraries your project requires.
+Aside from the `STABLEHDRS`, `BOUNDRY`, and `UNSTABLEHDRS` macros shown in the figure "Structure of a Makefile That Uses a Precompiled Header File" in [PCH files in the build process](#pch-files-in-the-build-process), this makefile provides a `CLFLAGS` macro and a `LINKFLAGS` macro. You must use these macros to list compiler and linker options that apply whether you build a debug or final version of the application's executable file. There's also a `LIBS` macro where you list the libraries your project requires.
-The makefile also uses !IF, !ELSE, !ENDIF to detect whether you define a DEBUG symbol on the NMAKE command line:
+The makefile also uses `!IF`, `!ELSE`, `!ENDIF` to detect whether you define a `DEBUG` symbol on the NMAKE command line:
```NMAKE
NMAKE DEBUG=[1|0]
```
-This feature makes it possible for you to use the same makefile during development and for the final versions of your program — use DEBUG=0 for the final versions. The following command lines are equivalent:
+This feature makes it possible for you to use the same makefile during development and for the final versions of your program. Use `DEBUG=0` for the final versions. The following command lines are equivalent:
```NMAKE
NMAKE
NMAKE DEBUG=0
```
-For more information on makefiles, see [NMAKE Reference](reference/nmake-reference.md). Also see [MSVC Compiler Options](reference/compiler-options.md) and the [MSVC Linker Options](reference/linker-options.md).
+For more information on makefiles, see [NMAKE reference](reference/nmake-reference.md). Also see [MSVC compiler options](reference/compiler-options.md) and the [MSVC linker options](reference/linker-options.md).
+
+## Example code for PCH
-## Example Code for PCH
+The following source files are used in the makefile described in [PCH files in the build process](#pch-files-in-the-build-process) and [Sample makefile for PCH](#sample-makefile-for-pch). The comments contain important information.
-The following source files are used in the makefile described in [PCH Files in the Build Process](#pch-files-in-the-build-process) and [Sample Makefile for PCH](#sample-makefile-for-pch). Note that the comments contain important information.
+Source file `ANOTHER.H`:
```cpp
// ANOTHER.H : Contains the interface to code that is not
@@ -254,11 +258,13 @@ The following source files are used in the makefile described in [PCH Files in t
//
#ifndef __ANOTHER_H
#define __ANOTHER_H
-#include
+#include
void savemoretime( void );
#endif // __ANOTHER_H
```
+Source file `STABLE.H`:
+
```cpp
// STABLE.H : Contains the interface to code that is not likely
// to change. List code that is likely to change
@@ -266,11 +272,13 @@ void savemoretime( void );
//
#ifndef __STABLE_H
#define __STABLE_H
-#include
+#include
void savetime( void );
#endif // __STABLE_H
```
+Source file `UNSTABLE.H`:
+
```cpp
// UNSTABLE.H : Contains the interface to code that is
// likely to change. As the code in a header
@@ -280,19 +288,21 @@ void savetime( void );
//
#ifndef __UNSTABLE_H
#define __UNSTABLE_H
-#include
+#include
void notstable( void );
#endif // __UNSTABLE_H
```
+Source file `APPLIB.CPP`:
+
```cpp
// APPLIB.CPP : This file contains the code that implements
// the interface code declared in the header
// files STABLE.H, ANOTHER.H, and UNSTABLE.H.
//
-#include"another.h"
-#include"stable.h"
-#include"unstable.h"
+#include "another.h"
+#include "stable.h"
+#include "unstable.h"
using namespace std;
// The following code represents code that is deemed stable and
// not likely to change. The associated interface code is
@@ -310,6 +320,8 @@ void notstable( void )
}
```
+Source file `MYAPP.CPP`:
+
```cpp
// MYAPP.CPP : Sample application
// All precompiled code other than the file listed
@@ -318,9 +330,9 @@ void notstable( void )
// listed in the BOUNDRY macro. Unstable code must
// be included after the precompiled code.
//
-#include"another.h"
-#include"stable.h"
-#include"unstable.h"
+#include "another.h"
+#include "stable.h"
+#include "unstable.h"
int main( void )
{
savetime();
@@ -331,5 +343,10 @@ int main( void )
## See also
-[C/C++ Building Reference](reference/c-cpp-building-reference.md)
-[MSVC Compiler Options](reference/compiler-options.md)
+[Compare header units, modules, and precompiled headers](compare-inclusion-methods.md)\
+[C/C++ building reference](reference/c-cpp-building-reference.md)\
+[MSVC compiler options](reference/compiler-options.md)\
+[Overview of modules in C++](../cpp/modules-cpp.md)\
+[Tutorial: Import the C++ standard library using modules](../cpp/tutorial-import-stl-named-module.md)\
+[Walkthrough: Build and import header units in your Visual C++ projects](walkthrough-header-units.md)\
+[Walkthrough: Import STL libraries as header units](walkthrough-import-stl-header-units.md#approach1)
diff --git a/docs/build/customize-cmake-settings.md b/docs/build/customize-cmake-settings.md
index 222c2e4a83..3ccdd13da6 100644
--- a/docs/build/customize-cmake-settings.md
+++ b/docs/build/customize-cmake-settings.md
@@ -14,11 +14,13 @@ If you maintain projects that use a *`CMakeSettings.json`* file for CMake build
To open the CMake settings editor, select the **Configuration** drop-down in the main toolbar and choose **Manage Configurations**.
-
+
Now you see the **Settings Editor** with the installed configurations on the left.
-
+:::image type="complex" source="media/cmake-settings-editor.png" alt-text="Screenshot of the CMake settings editor.":::
+The left pane shows the installed configurations (x86-Debug). The right pane shows the settings for the selected configuration. The settings include the configuration name, configuration type (set to Debug), toolset (set to msvc_x86), CMake toolchain file (empty), build root (contains ${env:USERPROFILE}\CMakeBuilds\${workspaceHash}\build\${name}), CMake command arguments (empty), and build command arguments (-v).
+:::image-end:::
Visual Studio provides one `x64-Debug` configuration by default. You can add more configurations by choosing the green plus sign. The settings that you see in the editor might vary depending on which configuration is selected.
@@ -34,7 +36,7 @@ Corresponds to the **name** setting. This name appears in the C++ configuration
### Configuration type
-Corresponds to the **configurationType** setting. Defines the build configuration type for the selected generator. Currently supported values are "Debug", "MinSizeRel", "Release", and "RelWithDebInfo". It maps to [`CMAKE_BUILD_TYPE`](https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html).
+Corresponds to the **configurationType** setting. Defines the build configuration type for the selected generator. Currently supported values are Debug, MinSizeRel, Release, and RelWithDebInfo. It maps to [`CMAKE_BUILD_TYPE`](https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html).
### Toolset
@@ -42,7 +44,7 @@ Corresponds to the **inheritedEnvironments** setting. Defines the compiler envir
### CMake toolchain file
-Path to the [CMake toolchain file](https://cmake.org/cmake/help/latest/variable/CMAKE_TOOLCHAIN_FILE.html). This path is passed to CMake as "-DCMAKE_TOOLCHAIN_FILE = \". Toolchain files specify locations of compilers and toolchain utilities, and other target platform and compiler-related information. By default, Visual Studio uses the [vcpkg toolchain file](https://github.com/microsoft/vcpkg/blob/master/docs/examples/installing-and-using-packages.md#cmake) if this setting is unspecified.
+Path to the [CMake toolchain file](https://cmake.org/cmake/help/latest/variable/CMAKE_TOOLCHAIN_FILE.html). This path is passed to CMake as `"-DCMAKE_TOOLCHAIN_FILE = `. Toolchain files specify locations of compilers and toolchain utilities, and other target platform and compiler-related information. By default, Visual Studio uses the [vcpkg toolchain file](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/examples/installing-and-using-packages.md#cmake) if this setting is unspecified.
### Build root
@@ -70,7 +72,7 @@ For configurations such as Linux that use remote builds, the following settings
### `rsync` command arguments
-Extra command-line options passed to [`rsync`](https://download.samba.org/pub/rsync/rsync.html), a fast, versatile file-copying tool.
+Extra command-line options passed to [`rsync`](https://download.samba.org/pub/rsync/), a fast, versatile file-copying tool.
## CMake variables and cache
@@ -96,7 +98,7 @@ Corresponds to **generator**. Maps to the CMake **`-G`** switch, and specifies t
- "Visual Studio 14 2015 Win64"
- "Visual Studio 14 2015 ARM"
-Because Ninja is designed for fast build speeds instead of flexibility and function, it's set as the default. However, some CMake projects may be unable to correctly build using Ninja. If that occurs, you can instruct CMake to generate a Visual Studio project instead.
+Because Ninja is designed for fast build speeds instead of flexibility and function, it's set as the default. However, some CMake projects might be unable to correctly build using Ninja. If that occurs, you can instruct CMake to generate a Visual Studio project instead.
### IntelliSense mode
@@ -190,8 +192,10 @@ You can also directly edit *`CMakeSettings.json`* to create custom configuration
JSON IntelliSense helps you edit the *`CMakeSettings.json`* file:
- 
-
+ :::image type="complex" source="media/cmake-json-intellisense.png" alt-text="Screenshot of the CMake JSON IntelliSense pop-up in the editor.":::
+ The JSON IntelliSense pop-up for "configurations" shows buildCommandArgs, buildRoot, cmakeCommandArgs, configurationType, among several others.
+ :::image-end:::
+
For more information about each of the properties in the file, see [`CMakeSettings.json` schema reference](cmakesettings-reference.md).
::: moniker-end
diff --git a/docs/build/dll-frequently-asked-questions.yml b/docs/build/dll-frequently-asked-questions.yml
index 5c89b9fac9..d35f75948d 100644
--- a/docs/build/dll-frequently-asked-questions.yml
+++ b/docs/build/dll-frequently-asked-questions.yml
@@ -5,7 +5,7 @@ metadata:
ms.date: "05/06/2019"
helpviewer_keywords: ["troubleshooting [C++], DLLs", "DLLs [C++], frequently asked questions", "FAQs [C++], DLLs"]
ms.assetid: 09dd068e-fc33-414e-82f7-289c70680256
-
+ ms.topic: faq
title: DLL frequently asked questions
summary: |
diff --git a/docs/build/exception-handling-x64.md b/docs/build/exception-handling-x64.md
index 3447b9f6af..41a6e29b6e 100644
--- a/docs/build/exception-handling-x64.md
+++ b/docs/build/exception-handling-x64.md
@@ -440,6 +440,8 @@ typedef enum _UNWIND_OP_CODES {
UWOP_PUSH_MACHFRAME /* info == 0: no error-code, 1: error-code */
} UNWIND_CODE_OPS;
+typedef unsigned char UBYTE;
+
typedef union _UNWIND_CODE {
struct {
UBYTE CodeOffset;
@@ -488,7 +490,7 @@ typedef struct _RUNTIME_FUNCTION {
((PRUNTIME_FUNCTION)((base) + *(PULONG)GetLanguageSpecificDataPtr(info)))
#define GetExceptionDataPtr(info) \
- ((PVOID)((PULONG)GetLanguageSpecificData(info) + 1)
+ ((PVOID)((PULONG)GetLanguageSpecificData(info) + 1))
```
## See also
diff --git a/docs/build/exporting-c-functions-for-use-in-c-or-cpp-language-executables.md b/docs/build/exporting-c-functions-for-use-in-c-or-cpp-language-executables.md
index ae89cbf097..2386881514 100644
--- a/docs/build/exporting-c-functions-for-use-in-c-or-cpp-language-executables.md
+++ b/docs/build/exporting-c-functions-for-use-in-c-or-cpp-language-executables.md
@@ -1,15 +1,15 @@
---
-description: "Learn more about: Exporting C Functions for Use in C or C++ Language Executables"
-title: "Exporting C Functions for Use in C or C++ Language Executables"
-ms.date: "11/04/2016"
+description: "Learn more about: Exporting C functions for use in C or C++ language executables"
+title: "Export C functions for use in C or C++ language executables"
+ms.date: 05/24/2022
helpviewer_keywords: ["functions [C], exporting", "functions [C], C or C++ executables and", "__cplusplus macro", "exporting DLLs [C++], C functions in C++ executables", "exporting functions [C++], C functions in C++ executables"]
ms.assetid: b51d6e5e-37cf-4c1c-b0bf-fcf188c82f00
---
-# Exporting C Functions for Use in C or C++ Language Executables
+# Export C functions for use in C or C++ language executables
-If you have functions in a DLL written in C that you want to access from a C language or C++ language module, you should use the **__cplusplus** preprocessor macro to determine which language is being compiled, and then declare these functions with C linkage if being used from a C++ language module. If you use this technique and provide header files for your DLL, these functions can be used by C and C++ users with no change.
+If you have functions in a DLL written in C, you can use a preprocessor macro to make them easy to access from both C language and C++ language code. The **`__cplusplus`** preprocessor macro indicates which language is being compiled. You may use it to declare the functions with C linkage when called from C++ language code. If you use this technique and provide header files for your DLL, these functions can be used by C and C++ users with no change.
-The following code shows a header file that can be used by C and C++ client applications:
+The following code shows a header file that both C and C++ client applications can use:
```h
// MyCFuncs.h
@@ -26,7 +26,7 @@ __declspec( dllimport ) void AnotherCFunc();
#endif
```
-If you need to link C functions to your C++ executable and the function declaration header files have not used the above technique, in the C++ source file, do the following to prevent the compiler from decorating the C function names:
+Sometimes you may need to link C functions to your C++ executable, but the function declaration header files haven't used the above technique. You can still call the functions from C++. In the C++ source file, wrap the `#include` directive to prevent the compiler from decorating the C function names:
```cpp
extern "C" {
@@ -36,15 +36,15 @@ extern "C" {
## What do you want to do?
-- [Export from a DLL using .def files](exporting-from-a-dll-using-def-files.md)
+- [Export from a DLL using `.def` files](exporting-from-a-dll-using-def-files.md)
-- [Export from a DLL using __declspec(dllexport)](exporting-from-a-dll-using-declspec-dllexport.md)
+- [Export from a DLL using `__declspec(dllexport)`](exporting-from-a-dll-using-declspec-dllexport.md)
-- [Export and import using AFX_EXT_CLASS](exporting-and-importing-using-afx-ext-class.md)
+- [Export and import using `AFX_EXT_CLASS`](exporting-and-importing-using-afx-ext-class.md)
- [Determine which exporting method to use](determining-which-exporting-method-to-use.md)
-- [Import into an application using __declspec(dllimport)](importing-into-an-application-using-declspec-dllimport.md)
+- [Import into an application using `__declspec(dllimport)`](importing-into-an-application-using-declspec-dllimport.md)
- [Initialize a DLL](run-time-library-behavior.md#initializing-a-dll)
@@ -52,7 +52,7 @@ extern "C" {
- [Decorated names](reference/decorated-names.md)
-- [Using extern to Specify Linkage](../cpp/extern-cpp.md)
+- [Using `extern` to specify linkage](../cpp/extern-cpp.md)
## See also
diff --git a/docs/build/formatting-the-output-of-a-custom-build-step-or-build-event.md b/docs/build/formatting-the-output-of-a-custom-build-step-or-build-event.md
index 14b67bab22..938dc06425 100644
--- a/docs/build/formatting-the-output-of-a-custom-build-step-or-build-event.md
+++ b/docs/build/formatting-the-output-of-a-custom-build-step-or-build-event.md
@@ -1,11 +1,11 @@
---
-description: "Learn more about: Formatting the Output of a Custom Build Step or Build Event"
-title: "Formatting the Output of a Custom Build Step or Build Event"
-ms.date: "08/27/2018"
+description: "Learn more about: Formatting the output of a custom build step or build event"
+title: "Formatting the output of a custom build step or build event"
+ms.date: 03/15/2022
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"]
ms.assetid: 92ad3e38-24d7-4b89-90e6-5a16f5f998da
---
-# Formatting the Output of a Custom Build Step or Build Event
+# Formatting the output of a custom build step or build event
If the output of a custom build step or build event is formatted correctly, users get the following benefits:
@@ -13,28 +13,30 @@ If the output of a custom build step or build event is formatted correctly, user
- Output appears in the **Task List** window.
-- Clicking on the output in the **Output** window displays the appropriate topic.
+- Clicking on the output in the **Output** window displays the appropriate location.
-- F1 operations are enabled in the **Task List** window or **Output** window.
+- **F1** operations are enabled in the **Task List** window or **Output** window.
+
+## Output format
The format of the output should be:
-> {filename**(**line# \[**,** column#]**)** | *toolname*} **:** \[ any text ] {**error** | **warning**} code+number**:**localizable string \[ any text ]
+> { *filename*`(`*line-number* \[`,` *column-number*]`)` \| *tool-name* } `:` \[ *any-text* ] {`error` \| `warning`} *code-type-and-number* `:` *localizable-string* \[ *any-text* ]
Where:
-- {*a* | *b*} is a choice of either *a* or *b*.
+- { *a* \| *b* } is a choice of either *a* or *b*,
-- \[item] is an optional string or parameter.
+- \[ *item* ] is an optional string or parameter,
-- **Bold** represents a literal.
+- `text` represents a literal.
For example:
-> C:\\*sourcefile.cpp*(134) : error C2143: syntax error : missing ';' before '}'
+> C:\\sourcefile.cpp(134) : error C2143: syntax error : missing ';' before '}'
>
-> LINK : fatal error LNK1104: cannot open file '*somelib.lib*'
+> LINK : fatal error LNK1104: cannot open file 'some-library.lib'
## See also
-[Understanding Custom Build Steps and Build Events](understanding-custom-build-steps-and-build-events.md)
+[Understanding custom build steps and build events](understanding-custom-build-steps-and-build-events.md)
diff --git a/docs/build/get-started-linux-cmake.md b/docs/build/get-started-linux-cmake.md
index a22da6c554..1ffb0fb6d2 100644
--- a/docs/build/get-started-linux-cmake.md
+++ b/docs/build/get-started-linux-cmake.md
@@ -2,7 +2,7 @@
title: Create C++ cross-platform projects in Visual Studio
description: "How to set up, compile, and debug a C++ open-source CMake project in Visual Studio that targets both Linux and Windows."
ms.topic: tutorial
-ms.date: "01/08/2020"
+ms.date: 02/07/2022
---
# Tutorial: Create C++ cross-platform projects in Visual Studio
@@ -21,11 +21,13 @@ In this tutorial, you learn how to:
## Prerequisites
* Set up Visual Studio for Cross Platform C++ Development
+
* First, [install Visual Studio](https://visualstudio.microsoft.com/vs/) and choose the **Desktop development with C++** and **Linux development with C++ workloads**. This minimal install is only 3 GB. Depending on your download speed, installation shouldn't take more than 10 minutes.
* Set up a Linux machine for Cross Platform C++ Development
- * Visual Studio doesn't require any specific distribution of Linux. The OS can be running on a physical machine, in a VM, or in the cloud. You could also use the Windows Subsystem for Linux (WSL). However, for this tutorial a graphical environment is required. WSL isn't recommended here, because it's intended primarily for command-line operations.
- * Visual Studio requires these tools on the Linux machine: C++ compilers, gdb, ssh, rsync, make, and zip. On Debian-based systems, you can use this command to install these dependencies:
+
+ * Visual Studio doesn't require any specific distribution of Linux. The OS can be running on a physical machine, in a VM, or in the cloud. You could also use the Windows Subsystem for Linux (WSL). However, for this tutorial, a graphical environment is required. WSL isn't recommended here, because it's intended primarily for command-line operations.
+ * Visual Studio requires these tools on the Linux machine: C++ compilers, `gdb`, `ssh`, `rsync`, `make`, and `zip`. On Debian-based systems, you can use this command to install these dependencies:
```cmd
sudo apt install -y openssh-server build-essential gdb rsync make zip
@@ -38,7 +40,7 @@ In this tutorial, you learn how to:
chmod +x cmake-3.11.18033000-MSVC_2-Linux-x86_64.sh
```
- * You can see the options for running the script with `-–help`. We recommend that you use the `–prefix` option to specify installing in the **/usr** path, because **/usr/bin** is the default location where Visual Studio looks for CMake. The following example shows the Linux-x86_64 script. Change it as needed if you're using a different target platform.
+ * You can see the options for running the script with `--help`. We recommend that you use the `-prefix` option to specify installing in the **/usr** path, because **/usr/bin** is the default location where Visual Studio looks for CMake. The following example shows the Linux-x86_64 script. Change it as needed if you're using a different target platform.
```cmd
sudo ./cmake-3.11.18033000-MSVC_2-Linux-x86_64.sh --skip-license --prefix=/usr
@@ -49,43 +51,43 @@ In this tutorial, you learn how to:
## Clone an open-source CMake project from GitHub
-This tutorial uses the Bullet Physics SDK on GitHub. It provides collision detection and physics simulations for many applications. The SDK includes sample executable programs that compile and run without having to write additional code. This tutorial doesn't modify any of the source code or build scripts. To start, clone the *bullet3* repository from GitHub on the machine where you have Visual Studio installed.
+This tutorial uses the Bullet Physics SDK on GitHub. It provides collision detection and physics simulations for many applications. The SDK includes sample executable programs that compile and run without having to write other code. This tutorial doesn't modify any of the source code or build scripts. To start, clone the *bullet3* repository from GitHub on the machine where you have Visual Studio installed.
```cmd
git clone https://github.com/bulletphysics/bullet3.git
```
-1. On the Visual Studio main menu, choose **File > Open > CMake**. Navigate to the CMakeLists.txt file in the root of the bullet3 repo you just downloaded.
+1. On the Visual Studio main menu, choose **File > Open > CMake**. Navigate to the `CMakeLists.txt` file in the root of the bullet3 repo you downloaded.
- 
+ 
As soon as you open the folder, your folder structure becomes visible in the **Solution Explorer**.
- 
+ 
This view shows you exactly what is on disk, not a logical or filtered view. By default, it doesn't show hidden files.
1. Choose the **Show all files** button to see all the files in the folder.
- 
+ 
## Switch to targets view
When you open a folder that uses CMake, Visual Studio automatically generates the CMake cache. This operation might take a few moments, depending on the size of your project.
-1. In the **Output Window**, select **Show output from** and then choose **CMake** to monitor the status of the cache generation process. When the operation is complete, it says "Target info extraction done".
+1. In the **Output Window**, select **Show output from** and then choose **CMake** to monitor the status of the cache generation process. When the operation is complete, it says "Target info extraction done."
- 
+ 
After this operation completes, IntelliSense is configured. You can build the project, and debug the application. Visual Studio now shows a logical view of the solution, based on the targets specified in the CMakeLists files.
1. Use the **Solutions and Folders** button in the **Solution Explorer** to switch to CMake Targets View.
- 
+ 
- Here is what that view looks like for the Bullet SDK:
+ Here's what that view looks like for the Bullet SDK:
- 
+ 
Targets view provides a more intuitive view of what is in this source base. You can see some targets are libraries and others are executables.
@@ -97,17 +99,17 @@ Visual Studio creates a default **x64-Debug** configuration for Windows. Configu
1. Add a new configuration. Open the **Configuration** drop-down in the toolbar and select **Manage Configurations**.
- 
+ 
- The [CMake Settings Editor](customize-cmake-settings.md) opens. Select the green plus sign on the left-hand side of the editor to add a new configuration. The **Add Configuration to CMakeSettings** dialog appears.
+ The [CMake Settings Editor](customize-cmake-settings.md) opens. Select the green plus sign on the left-hand side of the editor to add a new configuration. The **Add Configuration to CMakeSettings** dialog appears:
- 
+ 
- This dialog shows all the configurations included with Visual Studio, plus any custom configurations that you create. If you want to continue to use a **x64-Debug** configuration, that should be the first one you add. Select **x64-Debug**, and then choose the **Select** button. Visual Studio creates the CMakeSettings.json file with a configuration for **x64-Debug**, and saves it to disk. You can use whatever names you like for your configurations by changing the name parameter directly in CMakeSettings.json.
+ This dialog shows all the configurations included with Visual Studio, plus any custom configurations that you create. If you want to continue to use a **x64-Debug** configuration that should be the first one you add. Select **x64-Debug**, and then choose the **Select** button. Visual Studio creates the CMakeSettings.json file with a configuration for **x64-Debug**, and saves it to disk. You can use whatever names you like for your configurations by changing the name parameter directly in CMakeSettings.json.
## Set a breakpoint, build, and run on Windows
-In this step, we'll debug an example program that demonstrates the Bullet Physics library.
+In this step, we debug an example program that demonstrates the Bullet Physics library.
1. In **Solution Explorer**, select AppBasicExampleGui and expand it.
@@ -121,17 +123,17 @@ In this step, we'll debug an example program that demonstrates the Bullet Physic
1. In the browser view above your source, you should see that you're in the `CommonRigidBodyBase`. To the right, you can select members to examine. Open the drop-down and select `mouseButtonCallback` to go to the definition of that function in the header.
- 
+ 
1. Place a breakpoint on the first line within this function. It gets hit when you click a mouse button within the window of the application, when run under the Visual Studio debugger.
-1. To launch the application, select the launch drop-down in the toolbar. It's the one with the green play icon that says "Select Startup Item". In the drop-down, select AppBasicExampleGui.exe. The executable name now displays on the launch button:
+1. To launch the application, select the launch drop-down in the toolbar. It's the one with the green play icon that says "Select Startup Item." In the drop-down, select AppBasicExampleGui.exe. The executable name now displays on the launch button:
- 
+ 
1. Choose the launch button to build the application and necessary dependencies, then launch it with the Visual Studio debugger attached. After a few moments, the running application appears:
- 
+ 
1. Move your mouse into the application window, then click a button to trigger the breakpoint. The breakpoint brings Visual Studio back to the foreground, and the editor shows the line where execution is paused. You can inspect the application variables, objects, threads, and memory, or step through your code interactively. Choose **Continue** to let the application resume, and then exit it normally. Or, halt execution within Visual Studio by using the stop button.
@@ -143,19 +145,21 @@ In this step, we'll debug an example program that demonstrates the Bullet Physic
1. Select **Linux-Debug** in the configuration drop-down.
- 
+ 
If it's the first time you're connecting to a Linux system, the **Connect to Remote System** dialog appears.
- 
-
+ :::image type="complex" source="./media/cmake-bullet3-connection-manager.png" alt-text="Screenshot of the Visual Studio Connect to Remote System dialog.":::
+ The dialog has fields for the host name, port, user name, authentication type, and password. All of the fields are blank except Port is set to 22 and Authentication type is set to Password.
+ :::image-end:::
+
If you've already added a remote connection, you can open this window by navigating to **Tools > Options > Cross Platform > Connection Manager**.
-1. Provide the [connection information to your Linux machine](../linux/connect-to-your-remote-linux-computer.md) and choose **Connect**. Visual Studio adds that machine as to CMakeSettings.json as your default connection for **Linux-Debug**. It also pulls down the headers from your remote machine, so you get [IntelliSense specific to that remote connection](../linux/configure-a-linux-project.md#remote_intellisense). Next, Visual Studio sends your files to the remote machine and generates the CMake cache on the remote system. These steps may take some time, depending on the speed of your network and power of your remote machine. You'll know it's complete when the message "Target info extraction done" appears in the CMake output window.
+1. Provide the [connection information to your Linux machine](../linux/connect-to-your-remote-linux-computer.md) and choose **Connect**. Visual Studio adds that machine as to CMakeSettings.json as your default connection for **Linux-Debug**. It also pulls down the headers from your remote machine, so you get [IntelliSense specific to that remote connection](../linux/configure-a-linux-project.md#remote_intellisense). Next, Visual Studio sends your files to the remote machine and generates the CMake cache on the remote system. These steps might take some time, depending on the speed of your network and power of your remote machine. You know it's complete when the message "Target info extraction done" appears in the CMake output window.
## Set a breakpoint, build, and run on Linux
-Because it's a desktop application, you need to provide some additional configuration information to the debug configuration.
+Because it's a desktop application, you need to provide some more configuration information to the debug configuration.
1. In the CMake Targets view, right-click AppBasicExampleGui and choose **Debug and Launch Settings** to open the launch.vs.json file that's in the hidden **.vs** subfolder. This file is local to your development environment. You can move it into the root of your project if you wish to check it in and save it with your team. In this file, a configuration has been added for AppBasicExampleGui. These default settings work in most cases, but not here. Because it's a desktop application, you need to provide some additional information to launch the program so you can see it on your Linux machine.
@@ -165,7 +169,7 @@ Because it's a desktop application, you need to provide some additional configur
echo $DISPLAY
```
- In the configuration for AppBasicExampleGui, there's a parameter array, "pipeArgs". It contains a line: "${debuggerCommand}". It's the command that launches gdb on the remote machine. Visual Studio must export the display into this context before that command runs. For example, if the value of your display is `:1`, modify that line as follows:
+ In the configuration for AppBasicExampleGui, there's a parameter array, "pipeArgs". It contains a line: "${debuggerCommand}". It's the command that launches `gdb` on the remote machine. Visual Studio must export the display into this context before that command runs. For example, if the value of your display is `:1`, modify that line as follows:
```cmd
"export DISPLAY=:1;${debuggerCommand}",
@@ -175,13 +179,17 @@ Because it's a desktop application, you need to provide some additional configur
1. Move your mouse into the application window, and click a button. The breakpoint is hit. Program execution pauses, Visual Studio comes back to the foreground, and you see your breakpoint. You should also see a Linux Console Window appear in Visual Studio. The window provides output from the remote Linux machine, and it can also accept input for `stdin`. Like any Visual Studio window, you can dock it where you prefer to see it. Its position is persisted in future sessions.
- 
+ :::image type="complex" source="media/cmake-bullet3-linux-console.png" alt-text="Screenshot of the Visual Studio Linux Console Window.":::
+ The output in the window indicates that the C11 functions dynamically loaded using dlopen/dlsym is OK, a GL 3.0 context has been created and the Direct GLX rendering context obtained and made current. The window has various version information for GL_VENDOR, GL_VERSION, GL_SHADING_LANGUAGE_VERSION, and so on.
+ :::image-end:::
-1. You can inspect the application variables, objects, threads, memory, and step through your code interactively using Visual Studio. But this time, you're doing it all on a remote Linux machine instead of your local Windows environment. You can choose **Continue** to let the application resume and exit normally, or you can choose the stop button, just as with local execution.
+1. You can inspect the application variables, objects, threads, memory, and step through your code interactively using Visual Studio. But this time, you're doing it all on a remote Linux machine instead of your local Windows environment. You can choose **Continue** to let the application resume and exit normally, or you can choose the stop button, as with local execution.
1. Look at the Call Stack window and view the Calls to `x11OpenGLWindow` since Visual Studio launched the application on Linux.
- 
+ :::image type="complex" source="media/cmake-bullet3-linux-callstack.png" alt-text="The Visual Studio Call Stack window, showing Linux call stack.":::
+ The callstack shows the breakpoint on CommonRigidBodyBase::mouseMoveCallback, and the calls that precede it such as OnMouseMove, X11OpenGLWindow::pumpMessage, and so on.
+ :::image-end:::
## What you learned
@@ -199,4 +207,5 @@ Learn more about configuring and debugging CMake projects in Visual Studio:
> [Configure CMake debugging sessions](configure-cmake-debugging-sessions.md)
> [Deploy, run, and debug your Linux project](../linux/deploy-run-and-debug-your-linux-project.md)
> [CMake predefined configuration reference](cmake-predefined-configuration-reference.md)
->
+> [vcpkg in CMake projects](/vcpkg/users/buildsystems/cmake-integration)
+> [Install and use packages with CMake in Visual Studio](/vcpkg/get_started/get-started-vs)
diff --git a/docs/build/how-to-add-custom-build-tools-to-msbuild-projects.md b/docs/build/how-to-add-custom-build-tools-to-msbuild-projects.md
index 979b34abdb..ca0ed06ff1 100644
--- a/docs/build/how-to-add-custom-build-tools-to-msbuild-projects.md
+++ b/docs/build/how-to-add-custom-build-tools-to-msbuild-projects.md
@@ -1,25 +1,27 @@
---
-description: "Learn more about: How to: Add Custom Build Tools to MSBuild Projects"
-title: "How to: Add Custom Build Tools to MSBuild Projects"
-ms.date: "11/04/2016"
+description: "Learn more about how to add custom build tools to MSBuild projects"
+title: "How to: Add custom build tools to MSBuild projects"
+ms.date: 03/15/2022
helpviewer_keywords: ["msbuild (c++), howto: add custom build tools"]
ms.assetid: de03899a-371d-4396-9bf9-34f45a65e909
---
-# How to: Add Custom Build Tools to MSBuild Projects
+# How to: Add custom build tools to MSBuild projects
-A custom build tool is a user-defined, command-line tool that is associated with a particular file.
+A custom build tool is a user-defined, command-line tool that's associated with a particular file.
-For a particular file, specify in the project file (.vcxproj) the command line to execute, any additional input or output files, and a message to display. If **MSBuild** determines that your output files are out of date with regard to your input files, it displays the message and executes the command-line tool.
+For a particular file, specify in the project file (*`.vcxproj`*) the command line to execute, any other input or output files, and a message to display. If **MSBuild** determines that your output files are out of date relative to your input files, it displays the message and executes the command-line tool.
-To specify when the custom build tool executes, use one or both of the `CustomBuildBeforeTargets` and `CustomBuildAfterTargets` XML elements in the project file. For example, you might specify that your custom build tool run after the MIDL compiler and before the C/C++ compiler. Specify the `CustomBuildBeforeTargets` element to execute the tool before a particular target runs; the `CustomBuildAfterTargets` element to execute the tool after a particular target; or both elements to run the tool between execution of two targets. If neither element is specified, your custom build tool executes at its default location, which is before the **MIDL** target.
+## Specify custom build tools and custom build steps
+
+To specify when the custom build tool executes, use one or both of the `CustomBuildBeforeTargets` and `CustomBuildAfterTargets` XML elements in the project file. For example, you might specify that your custom build tool run after the MIDL compiler and before the C/C++ compiler. Specify the `CustomBuildBeforeTargets` element to execute the tool before a particular target runs. Use the `CustomBuildAfterTargets` element to execute the tool after a particular target runs. Use both elements to run the tool between execution of two targets. If neither element is specified, your custom build tool executes at its default location, which is before the **MIDL** target.
Custom build steps and custom build tools share the information specified in the `CustomBuildBeforeTargets` and `CustomBuildAfterTargets` XML elements. Specify those targets one time in your project file.
### To add a custom build tool
-1. Add an item group to the project file and add an item for each input file. Specify the command, additional inputs, outputs, and a message as item metadata, as shown here. This example assumes that a "faq.txt" file exists in the same directory as your project.
+1. Add an item group to the project file and add an item for each input file. Specify the command and its inputs, outputs, and a message as item metadata, as shown here. This example assumes that a "faq.txt" file exists in the same directory as your project. The custom build step copies it to the output directory.
- ```
+ ```xml
Copying readme...
@@ -29,11 +31,11 @@ Custom build steps and custom build tools share the information specified in the
```
-### To define where in the build the custom build tools will execute
+### To define where in the build the custom build tools execute
-1. Add the following property group to the project file. You have to specify at least one of the targets, but you can omit the other if you are only interested in having your build step execute before (or after) a particular target. This example performs the custom step after compiling but before linking.
+1. Add the following property group to the project file. You have to specify at least one of the targets. You can omit the other if you're only interested in having your build step execute before (or after) a particular target. This example performs the custom step after compiling but before linking.
- ```
+ ```xml
ClCompile
Link
@@ -42,6 +44,8 @@ Custom build steps and custom build tools share the information specified in the
## See also
-[Walkthrough: Using MSBuild to Create a C++ Project](walkthrough-using-msbuild-to-create-a-visual-cpp-project.md)
-[How to: Use Build Events in MSBuild Projects](how-to-use-build-events-in-msbuild-projects.md)
-[How to: Add a Custom Build Step to MSBuild Projects](how-to-add-a-custom-build-step-to-msbuild-projects.md)
+[Walkthrough: Using MSBuild to create a C++ project](walkthrough-using-msbuild-to-create-a-visual-cpp-project.md)\
+[How to: Use build events in MSBuild projects](how-to-use-build-events-in-msbuild-projects.md)\
+[How to: Add a custom build step to MSBuild projects](how-to-add-a-custom-build-step-to-msbuild-projects.md)\
+[Common macros for MSBuild commands and properties](reference/common-macros-for-build-commands-and-properties.md)\
+[MSBuild well-known item metadata](/visualstudio/msbuild/msbuild-well-known-item-metadata)
diff --git a/docs/build/how-to-create-a-cpp-project-from-existing-code.md b/docs/build/how-to-create-a-cpp-project-from-existing-code.md
index 338beeacb2..7d4b11a4b2 100644
--- a/docs/build/how-to-create-a-cpp-project-from-existing-code.md
+++ b/docs/build/how-to-create-a-cpp-project-from-existing-code.md
@@ -1,21 +1,26 @@
---
description: "Learn more about: How to: Create a C++ Project from Existing Code"
title: "How to: Create a C++ Project from Existing Code"
-ms.date: "05/06/2019"
+ms.date: 08/12/2024
helpviewer_keywords: ["C++, creating projects from existing code", "Create New Project From Existing Code Files Wizard, project settings"]
f1_keywords: ["vc.appwiz.importwiz.location", "vc.appwiz.importwiz.appsettings", "vc.appwiz.importwiz.debugsettings", "vc.appwiz.importwiz.releasesettings"]
-ms.assetid: e328a938-395c-48ea-9e35-dd433de12b31
---
# How to: Create a C++ Project from Existing Code
-In Visual Studio, you can port existing code files into a C++ project using the **Create New Project From Existing Code Files** wizard. This wizard creates a project solution that uses the MSBuild system to manage source files and build configuration. It works best with relatively simple projects that do not have complex folder hierarchies. The wizard isn't available in older Express editions of Visual Studio.
+In Visual Studio, you can port existing code files into a C++ project using the **Create New Project From Existing Code Files** wizard. This wizard creates a project solution that uses the MSBuild system to manage source files and build configuration. It works best with relatively simple projects that don't have complex folder hierarchies. The wizard isn't available in older Express editions of Visual Studio.
Porting existing code files into a C++ project enables the use of native MSBuild project management features built into the IDE. If you prefer to use your existing build system, such as nmake makefiles, CMake, or alternatives, you can use the Open Folder or CMake options instead. For more information, see [Open Folder projects for C++](open-folder-projects-cpp.md) or [CMake projects in Visual Studio](cmake-projects-in-visual-studio.md). Both options let you use IDE features such as [IntelliSense](/visualstudio/ide/using-intellisense) and [Project Properties](working-with-project-properties.md).
### To create a C++ project from existing code
+The following instructions assume that Visual Studio is running and is past the start page. If you are on the Visual Studio start page, choose **Continue without code** to open the IDE.
+
1. On the **File** menu, select **New** > **Project From Existing Code**.
+1. The **Create New Project from Existing Code Files** wizard opens. Choose what type of project to create from the dropdown: **Visual C++**, **Visual Basic**, or **C#**. Then choose **Next** to continue.
+ :::image type="complex" source="./media/create-from-existing-code-wizard.png" alt-text="Screenshot showing the Create New Project from Existing Code dialog.":::
+ The project type dropdown shows the options Visual C++ (which is selected), Visual Basic, and C#.
+ :::image-end:::
1. Specify your project location, the directory for your source files, and the kinds of files the wizard imports into the new project. Choose **Next** to continue.
| Setting | Description |
@@ -58,7 +63,8 @@ Porting existing code files into a C++ project enables the use of native MSBuild
> [!NOTE]
> The **Build**, **Rebuild**, **Clean** command line, and **Output (for debugging)** settings are only enabled if the **Use external build system** option is selected on the **Specify Project Settings** page.
-1. Specify the Release configuration settings to use, these settings are the same as the Debug configuration settings. Choose **Finish** to generate the new project.
+1. Specify the Release configuration settings to use, these settings are the same as the Debug configuration settings.
+1. Choose **Finish** to generate the new project.
> [!NOTE]
> Here you can check **Same as Debug configuration** to specify that the wizard will generate Release configuration project settings identical to Debug configuration project settings. This option is checked by default. All other options on this page are inactive unless you uncheck this box.
diff --git a/docs/build/how-to-debug-a-release-build.md b/docs/build/how-to-debug-a-release-build.md
index bb260ccf93..3063cfc32b 100644
--- a/docs/build/how-to-debug-a-release-build.md
+++ b/docs/build/how-to-debug-a-release-build.md
@@ -1,31 +1,27 @@
---
description: "Learn more about: How to: Debug a Release Build"
title: "How to: Debug a Release Build"
-ms.date: "11/04/2016"
+ms.date: 03/14/2025
helpviewer_keywords: ["debugging [C++], release builds", "release builds, debugging"]
-ms.assetid: d333e4d1-4e6c-4384-84a9-cb549702da25
---
# How to: Debug a Release Build
-You can debug a release build of an application.
+This article explains which compiler and linker switches to set to enable you to debug a release build of an application.
-### To debug a release build
+A better experience is available starting in Visual Studio 2022 version 17.14 that allows you to debug optimized code as if it were compiled unoptimized, while retaining the speed of optimized code. For more information, see [C++ Dynamic Debugging (Preview)](/visualstudio/debugger/cpp-dynamic-debugging).
-1. Open the **Property Pages** dialog box for the project. For details, see [Set C++ compiler and build properties in Visual Studio](working-with-project-properties.md).
+## To debug a release build
+1. Open the **Property Pages** dialog box for the project. For details, see [Set C++ compiler and build properties in Visual Studio](working-with-project-properties.md).
1. Click the **C/C++** node. Set **Debug Information Format** to [C7 compatible (/Z7)](reference/z7-zi-zi-debug-information-format.md) or **Program Database (/Zi)**.
-
1. Expand **Linker** and click the **General** node. Set **Enable Incremental Linking** to [No (/INCREMENTAL:NO)](reference/incremental-link-incrementally.md).
-
-1. Select the **Debugging** node. Set **Generate Debug Info** to [Yes (/DEBUG)](reference/debug-generate-debug-info.md).
-
-1. Select the **Optimization** node. Set **References** to [/OPT:REF](reference/opt-optimizations.md) and **Enable COMDAT Folding** to [/OPT:ICF](reference/opt-optimizations.md).
-
+1. Under **Linker**, select the **Debugging** node. Set **Generate Debug Info** to [Yes (/DEBUG)](reference/debug-generate-debug-info.md).
+1. Under **Linker**, select the **Optimization** node. Set **References** to [No (/OPT:NOREF)](reference/opt-optimizations.md) and **Enable COMDAT Folding** to [No (/OPT:NOICF)](reference/opt-optimizations.md).
1. You can now debug your release build application. To find a problem, step through the code (or use Just-In-Time debugging) until you find where the failure occurs, and then determine the incorrect parameters or code.
If an application works in a debug build, but fails in a release build, one of the compiler optimizations may be exposing a defect in the source code. To isolate the problem, disable selected optimizations for each source code file until you locate the file and the optimization that is causing the problem. (To expedite the process, you can divide the files into two groups, disable optimization on one group, and when you find a problem in a group, continue dividing until you isolate the problem file.)
- You can use [/RTC](reference/rtc-run-time-error-checks.md) to try to expose such bugs in your debug builds.
+ Use [/RTC](reference/rtc-run-time-error-checks.md) to try to expose such bugs in your debug builds.
For more information, see [Optimizing Your Code](optimizing-your-code.md).
diff --git a/docs/build/how-to-embed-a-manifest-inside-a-c-cpp-application.md b/docs/build/how-to-embed-a-manifest-inside-a-c-cpp-application.md
deleted file mode 100644
index cb98e6dabb..0000000000
--- a/docs/build/how-to-embed-a-manifest-inside-a-c-cpp-application.md
+++ /dev/null
@@ -1,254 +0,0 @@
----
-description: "Learn more about: How to: Embed a Manifest Inside a C/C++ Application"
-title: "How to: Embed a Manifest Inside a C/C++ Application"
-ms.date: "05/06/2019"
-helpviewer_keywords: ["manifests [C++]", "embedding manifests", "makefiles, updating to embed manifest"]
-ms.assetid: ec0bac69-2fdc-466c-ab0d-710a22974e5d
----
-# How to: Embed a Manifest Inside a C/C++ Application
-
-We recommended that you embed the manifest of your application or library inside the final binary because this guarantees correct runtime behavior in most scenarios. By default, Visual Studio tries to embed the manifest when it builds a project. For more information, see [Manifest Generation in Visual Studio](manifest-generation-in-visual-studio.md). However, if you build your application by using nmake, you have to make some changes to the makefile. This section shows how to change the makefiles so that it automatically embeds the manifest inside the final binary.
-
-## Two approaches
-
-There are two ways to embed the manifest inside an application or library.
-
-- If you are not doing an incremental build you can directly embed the manifest using a command line similar to the following as a post-build step:
-
- ```cmd
- mt.exe -manifest MyApp.exe.manifest -outputresource:MyApp.exe;1
- ```
-
- or
-
- ```cmd
- mt.exe -manifest MyLibrary.dll.manifest -outputresource:MyLibrary.dll;2
- ```
-
- Use 1 for an EXE and 2 for a DLL.
-
-- If you are doing an incremental build, use the following steps:
-
- - Link the binary to generate the MyApp.exe.manifest file.
-
- - Convert the manifest to a resource file.
-
- - Re-link (incrementally) to embed the manifest resource into the binary.
-
-The following examples show how to change makefiles to incorporate both techniques.
-
-## Makefiles (Before)
-
-Consider the nmake script for MyApp.exe, a simple application built from one file:
-
-```
-# build MyApp.exe
-!if "$(DEBUG)" == "1"
-CPPFLAGS=$(CPPFLAGS) /MDd
-LFLAGS=$(LFLAGS) /INCREMENTAL
-!else
-CPPFLAGS=$(CPPFLAGS) /MD
-!endif
-
-MyApp.exe : MyApp.obj
- link $** /out:$@ $(LFLAGS)
-
-MyApp.obj : MyApp.cpp
-
-clean :
- del MyApp.obj MyApp.exe
-```
-
-If this script is run unchanged with Visual Studio, it successfully creates MyApp.exe. It also creates the external manifest file MyApp.exe.manifest, for use by the operating system to load dependent assemblies at runtime.
-
-The nmake script for MyLibrary.dll looks very similar:
-
-```
-# build MyLibrary.dll
-!if "$(DEBUG)" == "1"
-CPPFLAGS=$(CPPFLAGS) /MDd
-LFLAGS=$(LFLAGS) /DLL /INCREMENTAL
-
-!else
-CPPFLAGS=$(CPPFLAGS) /MD
-LFLAGS=$(LFLAGS) /DLL
-
-!endif
-
-MyLibrary.dll : MyLibrary.obj
- link $** /out:$@ $(LFLAGS)
-
-MyLibrary.obj : MyLibrary.cpp
-
-clean :
- del MyLibrary.obj MyLibrary.dll
-```
-
-## Makefiles (After)
-
-To build with embedded manifests you have to make four small changes to the original makefiles. For the MyApp.exe makefile:
-
-```
-# build MyApp.exe
-!include makefile.inc
-#^^^^^^^^^^^^^^^^^^^^ Change #1. (Add full path if necessary.)
-
-!if "$(DEBUG)" == "1"
-CPPFLAGS=$(CPPFLAGS) /MDd
-LFLAGS=$(LFLAGS) /INCREMENTAL
-!else
-CPPFLAGS=$(CPPFLAGS) /MD
-!endif
-
-MyApp.exe : MyApp.obj
- link $** /out:$@ $(LFLAGS)
- $(_VC_MANIFEST_EMBED_EXE)
-#^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Change #2
-
-MyApp.obj : MyApp.cpp
-
-clean :
- del MyApp.obj MyApp.exe
- $(_VC_MANIFEST_CLEAN)
-#^^^^^^^^^^^^^^^^^^^^^^^^ Change #3
-
-!include makefile.targ.inc
-#^^^^^^^^^^^^^^^^^^^^^^^^^ Change #4. (Add full path if necessary.)
-```
-
-For the MyLibrary.dll makefile:
-
-```
-# build MyLibrary.dll
-!include makefile.inc
-#^^^^^^^^^^^^^^^^^^^^ Change #1. (Add full path if necessary.)
-
-!if "$(DEBUG)" == "1"
-CPPFLAGS=$(CPPFLAGS) /MDd
-LFLAGS=$(LFLAGS) /DLL /INCREMENTAL
-
-!else
-CPPFLAGS=$(CPPFLAGS) /MD
-LFLAGS=$(LFLAGS) /DLL
-
-!endif
-
-MyLibrary.dll : MyLibrary.obj
- link $** /out:$@ $(LFLAGS)
- $(_VC_MANIFEST_EMBED_DLL)
-#^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Change #2.
-
-MyLibrary.obj : MyLibrary.cpp
-
-clean :
- del MyLibrary.obj MyLibrary.dll
- $(_VC_MANIFEST_CLEAN)
-#^^^^^^^^^^^^^^^^^^^^^^^^ Change #3.
-
-!include makefile.targ.inc
-#^^^^^^^^^^^^^^^^^^^^^^^^^ Change #4. (Add full path if necessary.)
-```
-
-The makefiles now include two files that do the real work, makefile.inc and makefile.targ.inc.
-
-Create makefile.inc and copy the following into it:
-
-```
-# makefile.inc -- Include this file into existing makefile at the very top.
-
-# _VC_MANIFEST_INC specifies whether build is incremental (1 - incremental).
-# _VC_MANIFEST_BASENAME specifies name of a temporary resource file.
-
-!if "$(DEBUG)" == "1"
-CPPFLAGS=$(CPPFLAGS) /MDd
-LFLAGS=$(LFLAGS) /INCREMENTAL
-_VC_MANIFEST_INC=1
-_VC_MANIFEST_BASENAME=__VC90.Debug
-
-!else
-CPPFLAGS=$(CPPFLAGS) /MD
-_VC_MANIFEST_INC=0
-_VC_MANIFEST_BASENAME=__VC90
-
-!endif
-
-####################################################
-# Specifying name of temporary resource file used only in incremental builds:
-
-!if "$(_VC_MANIFEST_INC)" == "1"
-_VC_MANIFEST_AUTO_RES=$(_VC_MANIFEST_BASENAME).auto.res
-!else
-_VC_MANIFEST_AUTO_RES=
-!endif
-
-####################################################
-# _VC_MANIFEST_EMBED_EXE - command to embed manifest in EXE:
-
-!if "$(_VC_MANIFEST_INC)" == "1"
-
-#MT_SPECIAL_RETURN=1090650113
-#MT_SPECIAL_SWITCH=-notify_resource_update
-MT_SPECIAL_RETURN=0
-MT_SPECIAL_SWITCH=
-_VC_MANIFEST_EMBED_EXE= \
-if exist $@.manifest mt.exe -manifest $@.manifest -out:$(_VC_MANIFEST_BASENAME).auto.manifest $(MT_SPECIAL_SWITCH) & \
-if "%ERRORLEVEL%" == "$(MT_SPECIAL_RETURN)" \
-rc /r $(_VC_MANIFEST_BASENAME).auto.rc & \
-link $** /out:$@ $(LFLAGS)
-
-!else
-
-_VC_MANIFEST_EMBED_EXE= \
-if exist $@.manifest mt.exe -manifest $@.manifest -outputresource:$@;1
-
-!endif
-
-####################################################
-# _VC_MANIFEST_CLEAN - command to clean resources files generated temporarily:
-
-!if "$(_VC_MANIFEST_INC)" == "1"
-
-_VC_MANIFEST_CLEAN=-del $(_VC_MANIFEST_BASENAME).auto.res \
- $(_VC_MANIFEST_BASENAME).auto.rc \
- $(_VC_MANIFEST_BASENAME).auto.manifest
-
-!else
-
-_VC_MANIFEST_CLEAN=
-
-!endif
-
-# End of makefile.inc
-####################################################
-```
-
-Now create **makefile.targ.inc** and copy the following into it:
-
-```
-# makefile.targ.inc - include this at the very bottom of the existing makefile
-
-####################################################
-# Commands to generate initial empty manifest file and the RC file
-# that references it, and for generating the .res file:
-
-$(_VC_MANIFEST_BASENAME).auto.res : $(_VC_MANIFEST_BASENAME).auto.rc
-
-$(_VC_MANIFEST_BASENAME).auto.rc : $(_VC_MANIFEST_BASENAME).auto.manifest
- type <<$@
-#include
-1RT_MANIFEST"$(_VC_MANIFEST_BASENAME).auto.manifest"
-<< KEEP
-
-$(_VC_MANIFEST_BASENAME).auto.manifest :
- type <<$@
-
-
-
-<< KEEP
-
-# end of makefile.targ.inc
-```
-
-## See also
-
-[Understanding Manifest Generation for C/C++ Programs](understanding-manifest-generation-for-c-cpp-programs.md)
diff --git a/docs/build/how-to-enable-a-64-bit-visual-cpp-toolset-on-the-command-line.md b/docs/build/how-to-enable-a-64-bit-visual-cpp-toolset-on-the-command-line.md
index 1c061847d2..4e5fb87009 100644
--- a/docs/build/how-to-enable-a-64-bit-visual-cpp-toolset-on-the-command-line.md
+++ b/docs/build/how-to-enable-a-64-bit-visual-cpp-toolset-on-the-command-line.md
@@ -3,7 +3,6 @@ description: "Learn more about: How to: Enable a 64-Bit, x64 hosted MSVC toolset
title: "How to: Enable a 64-Bit MSVC Toolset on the Command Line"
ms.date: "07/24/2019"
helpviewer_keywords: ["x64 [C++]", "64-bit compiler [C++], command line usage", "64-bit compiler [C++], toolset enabling at command line", "command line [C++], 64-bit compiler", "Itanium [C++], command-line compiler", "IPF", "Itanium [C++]", "IPF, command-line compiler", "x64 [C++], command-line compiler"]
-ms.assetid: 4da93a19-e20d-4778-902a-5eee9a6a90b5
---
# How to: Enable a 64-Bit, x64 hosted MSVC toolset on the command line
@@ -11,11 +10,13 @@ Visual Studio includes C++ compilers, linkers, and other tools that you can use
## Use a 64-bit hosted developer command prompt shortcut
-To access these command prompts on Windows, on the **Start** menu, open the folder for your version of Visual Studio, and then choose one of the x64 native or cross-tool developer command prompts.
+To access these command prompts on Windows, on the **Start** menu type `x64` and then choose one of the x64 native or cross-tool developer command prompts.
-
+:::image type="complex" source="./media/x64-native-tools-command-prompt.png" alt-text="Screenshot showing the start menu with x64 in the search box and the x64 Native Tools Command Prompt shortcut selected.":::
+If you have different versions of Visual Studio installed, other versions of the prompt appear. Choose the prompt for the version of Visual Studio that you want to use.
+:::image-end:::
-To access these command prompts on Windows 8.1, on the **Start** screen, open **All apps**. Under the heading for the installed version of Visual Studio, open the **Visual Studio** folder (in older versions of Visual Studio, it may be named **Visual Studio Tools**). On earlier versions of Windows, choose **Start**, expand **All Programs**, the folder for your version of **Visual Studio** (and on older versions of Visual Studio, **Visual Studio Tools**). For more information, see [Developer command prompt shortcuts](building-on-the-command-line.md#developer_command_prompt_shortcuts).
+On earlier versions of Windows, choose **Start**, expand **All Programs**, and then expand the folder for your version of **Visual Studio** (and on older versions of Visual Studio, **Visual Studio Tools**). For more information, see [Developer command prompt shortcuts](building-on-the-command-line.md#developer_command_prompt_shortcuts).
## Use Vcvarsall.bat to set a 64-bit hosted build architecture
diff --git a/docs/build/how-to-modify-the-target-framework-and-platform-toolset.md b/docs/build/how-to-modify-the-target-framework-and-platform-toolset.md
index b85c149a46..a91d9d9158 100644
--- a/docs/build/how-to-modify-the-target-framework-and-platform-toolset.md
+++ b/docs/build/how-to-modify-the-target-framework-and-platform-toolset.md
@@ -1,7 +1,6 @@
---
description: "Learn more about: How to: Modify the Target Framework and Platform Toolset"
title: "How to: Modify the Target Framework and Platform Toolset"
-ms.custom: "contperf-fy21q3"
ms.date: 03/31/2021
helpviewer_keywords: ["msbuild (c++), howto: modify target framework and platform toolset"]
---
@@ -24,7 +23,7 @@ Visual Studio also supports multitargeting for C++ projects. You can use the lat
## Target framework (C++/CLI project only)
-When you change the target Framework, also change the platform toolset to a version that supports that Framework. For example, to target the .NET Framework 4.5, you must use a compatible platform toolset. These toolsets include Visual Studio 2015 (v140), Visual Studio 2013 (v120), or Visual Studio 2012 (v110). You can use the [Windows 7.1 SDK](https://www.microsoft.com/download/details.aspx?id=8279) to target .NET Framework 2.0, 3.0, 3.5, and 4.
+When you change the target Framework, also change the platform toolset to a version that supports that Framework. For example, to target the .NET Framework 4.5, you must use a compatible platform toolset. These toolsets include Visual Studio 2015 (v140), Visual Studio 2013 (v120), or Visual Studio 2012 (v110). You can use the [Windows 7.1 SDK](https://www.microsoft.com/en-us/download/details.aspx?id=8442) to target .NET Framework 2.0, 3.0, 3.5, and 4.
You can extend the target platform further by creating a custom platform toolset. For more information, see [C++ Native Multi-Targeting](https://devblogs.microsoft.com/cppblog/c-native-multi-targeting/) on the Visual C++ blog.
diff --git a/docs/build/how-to-use-build-events-in-msbuild-projects.md b/docs/build/how-to-use-build-events-in-msbuild-projects.md
index c747397334..72aea3d96a 100644
--- a/docs/build/how-to-use-build-events-in-msbuild-projects.md
+++ b/docs/build/how-to-use-build-events-in-msbuild-projects.md
@@ -1,9 +1,8 @@
---
-description: "Learn more about: How to: Use Build Events in MSBuild Projects"
title: "How to: Use Build Events in MSBuild Projects"
+description: "Learn more about: How to: Use Build Events in MSBuild Projects"
ms.date: "11/04/2016"
helpviewer_keywords: ["msbuild (c++), howto: use build events in projects"]
-ms.assetid: 2a58dc9d-3d50-4e49-97c1-86c5a05ce218
---
# How to: Use Build Events in MSBuild Projects
@@ -33,7 +32,7 @@ The following table lists each *use-in-build* element:
The following example can be added inside of the Project element of the myproject.vcxproj file created in [Walkthrough: Using MSBuild to Create a C++ Project](walkthrough-using-msbuild-to-create-a-visual-cpp-project.md). A *pre-build* event makes a copy of main.cpp; a *pre-link* event makes a copy of main.obj; and a *post-build* event makes a copy of myproject.exe. If the project is built using a release configuration, the build events are executed. If the project is built using a debug configuration, the build events are not executed.
-``` xml
+```xml
copy $(ProjectDir)main.cpp $(ProjectDir)copyOfMain.cpp
@@ -64,5 +63,5 @@ The following example can be added inside of the Project element of the myprojec
## See also
-[MSBuild on the command line - C++](msbuild-visual-cpp.md)
+[MSBuild on the command line - C++](msbuild-visual-cpp.md)\
[Walkthrough: Using MSBuild to Create a C++ Project](walkthrough-using-msbuild-to-create-a-visual-cpp-project.md)
diff --git a/docs/build/launch-vs-schema-reference-cpp.md b/docs/build/launch-vs-schema-reference-cpp.md
index 787510553f..290cc1a1ce 100644
--- a/docs/build/launch-vs-schema-reference-cpp.md
+++ b/docs/build/launch-vs-schema-reference-cpp.md
@@ -18,7 +18,7 @@ To create the file, right-click on an executable file in **Solution Explorer** a
| `buildConfigurations` | array | A key-value pair that specifies the name of the build mode to apply the configurations. For example, `Debug` or `Release` and the configurations to use according to the selected build mode. |
| `currentDir` | string | Specifies the full directory path to the Build Target. The directory is detected automatically unless this parameter is set. |
| `cwd` | string | Full path to the directory on the remote system where the program will run. Defaults to `"${debugInfo.defaultWorkingDirectory}"` |
-| `debugType` | string | Specifies the debugging mode according to the type of code (native, managed, or mixed). The mode is automatically detected unless this parameter is set. Allowed values: `"native"`", `"managed"`, `"mixed"`. |
+| `debugType` | string | Specifies the debugging mode according to the type of code (native, managed, or mixed). The mode is automatically detected unless this parameter is set. Allowed values: `"native"`, `"managed"`, `"mixed"`. |
| `env` | array | Specifies a key-value list of custom environment variables. For example: `env:{"myEnv":"myVal"}`. |
| `inheritEnvironments` | array | Specifies a set of environment variables inherited from multiple sources. You can define some variables in files like *`CMakeSettings.json`* or *`CppProperties.json`* and make them available to debug context. **Visual Studio 16.4:** Specify environment variables on a per-target basis using the `env.VARIABLE_NAME` syntax. To unset a variable, set it to `"null"`. |
| `name` | string | Specifies the name of the entry in the **Startup Item** dropdown. |
@@ -37,7 +37,7 @@ To create the file, right-click on an executable file in **Solution Explorer** a
|--|--|--|
| `program` | string | Full path to program executable on the remote machine. When using CMake, the macro `${debugInfo.fullTargetPath}` can be used as the value of this field. |
| `processId` | integer | Optional process ID to attach the debugger to. |
-| `sourceFileMap` | object | Optional source file mappings passed to the debug engine. Format: `{ "\": "\" }` or `{ "\": { "editorPath": "\", "useForBreakpoints": true } }`. Example: `{ "/home/user/foo": "C:\\foo" }` or `{ "/home/user/foo": { "editorPath": "c:\\foo", "useForBreakpoints": true } }`. See [Source file map options](#source_file_map_options). |
+| `sourceFileMap` | object | Optional source file mappings passed to the debug engine. Format: `{ "\": "\" }` or `{ "\": { "editorPath": "\", "useForBreakpoints": true } }`. Example: `{ "/home/user/foo": "C:\\foo" }` or `{ "/home/user/foo": { "editorPath": "c:\\foo", "useForBreakpoints": true } }`. For more information, see [Source file map options](#source_file_map_options). |
| `additionalProperties` | string | One of the sourceFileMapOptions. (See below.) |
| `MIMode` | string | Indicates the type of MI-enabled console debugger that the MIDebugEngine will connect to. Allowed values are `"gdb"`, `"lldb"`. |
| `args` | array | Command-line arguments passed to the program. |
@@ -48,14 +48,14 @@ To create the file, right-click on an executable file in **Solution Explorer** a
| `remoteMachineName` | string | The remote Linux machine that hosts gdb and the program to debug. Use the Connection Manager for adding new Linux machines. When using CMake, the macro `${debugInfo.remoteMachineName}` can be used as the value of this field. |
| `miDebuggerPath` | string | The path to the MI-enabled debugger (such as gdb). When unspecified, it will search PATH first for the debugger. |
| `miDebuggerServerAddress` | string | Network address of the MI-enabled debugger server to connect to. Example: `"localhost:1234"`. |
-| `setupCommands` | array | One or more GDB/LLDB commands to execute to set up the underlying debugger. Example: `"setupCommands": [ { "text": "-enable-pretty-printing", "description": "Enable GDB pretty printing", "ignoreFailures": true }]`. See [Launch setup commands](#launch_setup_commands). |
+| `setupCommands` | array | One or more GDB/LLDB commands to execute to set up the underlying debugger. Example: `"setupCommands": [ { "text": "-enable-pretty-printing", "description": "Enable GDB pretty printing", "ignoreFailures": true }]`. For more information, see [Launch setup commands](#launch_setup_commands). |
| `customLaunchSetupCommands` | array | If provided, this value replaces the default commands used to launch a target with some other commands. For example, use "-target-attach" to attach to a target process. An empty command list replaces the launch commands with nothing, which can be useful if the debugger is being provided launch options as command-line options. Example: `"customLaunchSetupCommands": [ { "text": "target-run", "description": "run target", "ignoreFailures": false }]`. |
| `launchCompleteCommand` | string | The command to execute after the debugger is fully set up, to cause the target process to run. Allowed values are "exec-run", "exec-continue", "None". The default value is "exec-run". |
| `debugServerPath` | string | Optional full path to debug server to launch. Defaults to null. |
| `debugServerArgs` | string | Optional debug server args. Defaults to null. |
| `filterStderr` | boolean | Search stderr stream for server-started pattern and log stderr to debug output. Defaults to **`false`**. |
| `coreDumpPath` | string | Optional full path to a core dump file for the specified program. Defaults to null. |
-| externalConsole | boolean | If true, a console is launched for the debuggee. If **`false`**, no console is launched. The default for this setting is **`false`**. This option is ignored in some cases for technical reasons. |
+| `externalConsole` | boolean | If true, a console is launched for the debuggee. If **`false`**, no console is launched. The default for this setting is **`false`**. This option is ignored in some cases for technical reasons. |
| `pipeTransport` | string | When present, this value tells the debugger to connect to a remote computer using another executable as a pipe that will relay standard input/output between Visual Studio and the MI-enabled debugger (such as gdb). Allowed values: one or more [Pipe Transport Options](#pipe_transport_options). |
## debugInfo macros
diff --git a/docs/build/manifest-generation-at-the-command-line.md b/docs/build/manifest-generation-at-the-command-line.md
deleted file mode 100644
index e7acf1a1d6..0000000000
--- a/docs/build/manifest-generation-at-the-command-line.md
+++ /dev/null
@@ -1,18 +0,0 @@
----
-description: "Learn more about: Manifest Generation at the Command Line"
-title: "Manifest Generation at the Command Line"
-ms.date: "11/04/2016"
-helpviewer_keywords: ["manifests [C++]", "manifest tool (mt.exe)"]
-ms.assetid: fc2ff255-82b1-4c44-af76-8405c5850292
----
-# Manifest Generation at the Command Line
-
-When building C/C++ applications from the command line using nmake or similar tools, the manifest is generated after the linker has processed all object files and built the final binary. The linker collects assembly information stored in the object files and combines this information into a final manifest file. By default the linker will generate a file named *binary_name*.*extension*.manifest to describe the final binary. The linker does not embed a manifest file inside the binary and can only generate a manifest as an external file. There are several ways to embed a manifest inside the final binary, such as using the [Manifest Tool (mt.exe)](/windows/win32/sbscs/mt-exe) or compiling the manifest into a resource file. It is important to keep in mind that specific rules have to be followed when embedding a manifest inside the final binary to enable such features as incremental linking, signing, and edit and continue. These and other options are discussed in [How to: Embed a Manifest Inside a C/C++ Application](how-to-embed-a-manifest-inside-a-c-cpp-application.md) when building on the command line.
-
-## See also
-
-[Manifests](/windows/win32/sbscs/manifests)
-[/INCREMENTAL (Link Incrementally)](reference/incremental-link-incrementally.md)
-[Strong Name Assemblies (Assembly Signing) (C++/CLI)](../dotnet/strong-name-assemblies-assembly-signing-cpp-cli.md)
-[Edit and Continue](/visualstudio/debugger/edit-and-continue)
-[Understanding Manifest Generation for C/C++ Programs](understanding-manifest-generation-for-c-cpp-programs.md)
diff --git a/docs/build/manifest-generation-in-visual-studio.md b/docs/build/manifest-generation-in-visual-studio.md
deleted file mode 100644
index e8c943d4a3..0000000000
--- a/docs/build/manifest-generation-in-visual-studio.md
+++ /dev/null
@@ -1,28 +0,0 @@
----
-description: "Learn more about: Manifest Generation in Visual Studio"
-title: "Manifest Generation in Visual Studio"
-ms.date: "11/04/2016"
-helpviewer_keywords: ["manifests [C++]"]
-ms.assetid: 0af60aa9-d223-42cd-8426-b3fc543a2a81
----
-# Manifest Generation in Visual Studio
-
-Generation of a manifest file for a particular project can be controlled in the project **Property Pages** dialog. On the **Configuration Properties** tab, click **Linker**, then **Manifest File**, then **Generate Manifest**. By default the project properties of new projects are set to generate a manifest file. However it is possible to disable generation of the manifest for a project using the **Generate Manifest** property of the project. When this property is set to **Yes**, the manifest for this project is generated. Otherwise the linker ignores assembly information when resolving dependencies of the application code, and does not generate the manifest.
-
-The build system in Visual Studio allows the manifest to be embedded in the final binary application file, or generated as an external file. This behavior is controlled by the **Embed Manifest** option in the **Project Properties** dialog. To set this property, open the **Manifest Tool** node, then select **Input and Output**. If the manifest is not embedded, it is generated as an external file and saved in the same directory as the final binary. If the manifest is embedded, Visual Studio embeds the final manifests using the following process:
-
-1. After the source code is compiled to object files, the linker collects dependent assembly information. While linking the final binary, the linker generates an intermediate manifest that is used later to generate the final manifest.
-
-1. After the intermediate manifest and linking are finished, the manifest tool will be executed to merge a final manifest and save it as an external file.
-
-1. The project build system then detects whether the manifest generated by the manifest tool contains different information than the manifest already embedded in the binary.
-
-1. If the manifest embedded in the binary is different from the manifest generated by the manifest tool, or the binary does not contain an embedded manifest, Visual Studio will invoke the linker one more time to embed the external manifest file inside the binary as a resource.
-
-1. If the manifest embedded in the binary is the same as the manifest generated by the manifest tool, the build will continue to the next build steps.
-
-The manifest is embedded inside the final binary as a text resource and it can be viewed by opening the final binary as a file in Visual Studio. To ensure that the manifest points to the correct libraries, follow the steps described in [Understanding the Dependencies of a Visual C++ Application](../windows/understanding-the-dependencies-of-a-visual-cpp-application.md) or follow the suggestions described in the [Troubleshooting](troubleshooting-c-cpp-isolated-applications-and-side-by-side-assemblies.md) section.
-
-## See also
-
-[Understanding Manifest Generation for C/C++ Programs](understanding-manifest-generation-for-c-cpp-programs.md)
diff --git a/docs/build/media/add-configure-preset-to-cmakepresets.png b/docs/build/media/add-configure-preset-to-cmakepresets.png
index 343e8a85ed..47d963209c 100644
Binary files a/docs/build/media/add-configure-preset-to-cmakepresets.png and b/docs/build/media/add-configure-preset-to-cmakepresets.png differ
diff --git a/docs/build/media/clang-install-vs2022.png b/docs/build/media/clang-install-vs2022.png
new file mode 100644
index 0000000000..cd97b752d3
Binary files /dev/null and b/docs/build/media/clang-install-vs2022.png differ
diff --git a/docs/build/media/cmake-build-errors.png b/docs/build/media/cmake-build-errors.png
index 089db013a3..80127fdebd 100644
Binary files a/docs/build/media/cmake-build-errors.png and b/docs/build/media/cmake-build-errors.png differ
diff --git a/docs/build/media/cmake-bullet3-connection-manager.png b/docs/build/media/cmake-bullet3-connection-manager.png
index afdedb01e3..345ec7ec4b 100644
Binary files a/docs/build/media/cmake-bullet3-connection-manager.png and b/docs/build/media/cmake-bullet3-connection-manager.png differ
diff --git a/docs/build/media/cmake-cmakelists-error.png b/docs/build/media/cmake-cmakelists-error.png
index 6601ecbed3..5c0877845b 100644
Binary files a/docs/build/media/cmake-cmakelists-error.png and b/docs/build/media/cmake-cmakelists-error.png differ
diff --git a/docs/build/media/cmake-cmakelists.png b/docs/build/media/cmake-cmakelists.png
index f957bb6c1d..58f4729779 100644
Binary files a/docs/build/media/cmake-cmakelists.png and b/docs/build/media/cmake-cmakelists.png differ
diff --git a/docs/build/media/cmake-debugger-entry.png b/docs/build/media/cmake-debugger-entry.png
new file mode 100644
index 0000000000..0f7eae51a2
Binary files /dev/null and b/docs/build/media/cmake-debugger-entry.png differ
diff --git a/docs/build/media/cmake-general-prefer-cmake-presets.png b/docs/build/media/cmake-general-prefer-cmake-presets.png
index 4cb0c1ac64..1026817075 100644
Binary files a/docs/build/media/cmake-general-prefer-cmake-presets.png and b/docs/build/media/cmake-general-prefer-cmake-presets.png differ
diff --git a/docs/build/media/cmake-install-2022.png b/docs/build/media/cmake-install-2022.png
new file mode 100644
index 0000000000..870db48e1c
Binary files /dev/null and b/docs/build/media/cmake-install-2022.png differ
diff --git a/docs/build/media/cmake-targets-view.png b/docs/build/media/cmake-targets-view.png
index f756047205..ac9dab9002 100644
Binary files a/docs/build/media/cmake-targets-view.png and b/docs/build/media/cmake-targets-view.png differ
diff --git a/docs/build/media/cmake-targets-view2.png b/docs/build/media/cmake-targets-view2.png
index 04ae1e2a13..673ddd555b 100644
Binary files a/docs/build/media/cmake-targets-view2.png and b/docs/build/media/cmake-targets-view2.png differ
diff --git a/docs/build/media/create-from-existing-code-wizard.png b/docs/build/media/create-from-existing-code-wizard.png
new file mode 100644
index 0000000000..881cbe8a36
Binary files /dev/null and b/docs/build/media/create-from-existing-code-wizard.png differ
diff --git a/docs/build/media/debug-targets-view.png b/docs/build/media/debug-targets-view.png
new file mode 100644
index 0000000000..a9ba70b3c5
Binary files /dev/null and b/docs/build/media/debug-targets-view.png differ
diff --git a/docs/build/media/desktop-app-project-run-150.gif b/docs/build/media/desktop-app-project-run-150.gif
deleted file mode 100644
index a46faeb947..0000000000
Binary files a/docs/build/media/desktop-app-project-run-150.gif and /dev/null differ
diff --git a/docs/build/media/new-dropdowns.png b/docs/build/media/new-dropdowns.png
new file mode 100644
index 0000000000..47a83973c6
Binary files /dev/null and b/docs/build/media/new-dropdowns.png differ
diff --git a/docs/build/media/switch-to-targets-view.png b/docs/build/media/switch-to-targets-view.png
new file mode 100644
index 0000000000..455bbfebc9
Binary files /dev/null and b/docs/build/media/switch-to-targets-view.png differ
diff --git a/docs/build/media/vcppdir_libdir_macros.png b/docs/build/media/vcppdir_libdir_macros.png
index 430fd309e7..80f0d633ed 100644
Binary files a/docs/build/media/vcppdir_libdir_macros.png and b/docs/build/media/vcppdir_libdir_macros.png differ
diff --git a/docs/build/media/visual-c---project-defaults.png b/docs/build/media/visual-c---project-defaults.png
index 3b3db949ce..659946ac9c 100644
Binary files a/docs/build/media/visual-c---project-defaults.png and b/docs/build/media/visual-c---project-defaults.png differ
diff --git a/docs/build/media/visual-c---property-pages-showing-active-configuration.png b/docs/build/media/visual-c---property-pages-showing-active-configuration.png
index 57e12a4419..521ba2fec9 100644
Binary files a/docs/build/media/visual-c---property-pages-showing-active-configuration.png and b/docs/build/media/visual-c---property-pages-showing-active-configuration.png differ
diff --git a/docs/build/media/visual-c---property-pages-showing-release-config.png b/docs/build/media/visual-c---property-pages-showing-release-config.png
index 763a22945a..39ff39170d 100644
Binary files a/docs/build/media/visual-c---property-pages-showing-release-config.png and b/docs/build/media/visual-c---property-pages-showing-release-config.png differ
diff --git a/docs/build/media/vs2019-scan-module-dependencies.png b/docs/build/media/vs2019-scan-module-dependencies.png
index 5b207ea85c..8541eff487 100644
Binary files a/docs/build/media/vs2019-scan-module-dependencies.png and b/docs/build/media/vs2019-scan-module-dependencies.png differ
diff --git a/docs/build/media/vscpp-quickstart-first-run.gif b/docs/build/media/vscpp-quickstart-first-run.gif
deleted file mode 100644
index 10d887cbcb..0000000000
Binary files a/docs/build/media/vscpp-quickstart-first-run.gif and /dev/null differ
diff --git a/docs/build/media/x64-native-tools-command-prompt.png b/docs/build/media/x64-native-tools-command-prompt.png
index ac088d3aa2..bc48f40b7a 100644
Binary files a/docs/build/media/x64-native-tools-command-prompt.png and b/docs/build/media/x64-native-tools-command-prompt.png differ
diff --git a/docs/build/modify-project-properties-without-changing-project-file.md b/docs/build/modify-project-properties-without-changing-project-file.md
index 55a167526f..aebbc2c0f7 100644
--- a/docs/build/modify-project-properties-without-changing-project-file.md
+++ b/docs/build/modify-project-properties-without-changing-project-file.md
@@ -1,7 +1,7 @@
---
description: "Learn more about: How to: Modify C++ project properties and targets without changing the project file"
title: "How to: Modify C++ project properties and targets without changing the project file"
-ms.date: "11/28/2018"
+ms.date: "7/28/2023"
helpviewer_keywords: ["project properties [C++], modifying outside project file"]
---
# How to: Modify C++ project properties and targets without changing the project file
@@ -13,27 +13,27 @@ You can override project properties and targets from the MSBuild command prompt
*To override project properties:*
-1. Create a .props file that specifies the properties you want to override.
+1. Create a `.props` file that specifies the properties you want to override.
-1. From the command prompt: set ForceImportBeforeCppTargets="C:\sources\my_props.props"
+1. From the command prompt: `set ForceImportBeforeCppTargets="C:\sources\my_props.props"`
*To override project targets:*
-1. Create a .targets file with their implementation or a particular target
+1. Create a `.targets` file with their implementation or a particular target
-2. From the command prompt: set ForceImportAfterCppTargets ="C:\sources\my_target.targets"
+2. From the command prompt: `set ForceImportAfterCppTargets ="C:\sources\my_target.targets"`
-You can also set either option on the msbuild command line by using the /p: option:
+You can also set either option on the msbuild command line by using the `/p:` option:
```cmd
-> msbuild myproject.sln /p:ForceImportBeforeCppTargets="C:\sources\my_props.props"
-> msbuild myproject.sln /p:ForceImportAfterCppTargets="C:\sources\my_target.targets"
+msbuild myproject.sln /p:ForceImportBeforeCppTargets="C:\sources\my_props.props"
+msbuild myproject.sln /p:ForceImportAfterCppTargets="C:\sources\my_target.targets"
```
-Overriding properties and targets in this way is equivalent to adding the following imports to all .vcxproj files in the solution:
+Overriding properties and targets in this way is equivalent to adding the following imports to all `.vcxproj` files in the solution:
-```cmd
-
+```xml
+
-
+
```
diff --git a/docs/build/open-folder-projects-cpp.md b/docs/build/open-folder-projects-cpp.md
index 7e49f70c10..dff693a632 100644
--- a/docs/build/open-folder-projects-cpp.md
+++ b/docs/build/open-folder-projects-cpp.md
@@ -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
{
@@ -147,7 +147,6 @@ This creates (or opens) the *tasks.vs.json* file in the .vs folder which Visual
}
]
}
-
```
The JSON file is placed in the *.vs* subfolder. To see that folder, click on the **Show All Files** button at the top of **Solution Explorer**. You can run this task by right-clicking on the root node in **Solution Explorer** and choosing **build hello**. When the task completes you should see a new file, *hello.exe* in **Solution Explorer**.
@@ -194,7 +193,6 @@ To customize your program's command line arguments and debugging instructions, r
}
]
}
-
```
To start debugging, choose the executable in the debug dropdown, then click the green arrow:
diff --git a/docs/build/profile-guided-optimizations.md b/docs/build/profile-guided-optimizations.md
index 4c6cdc579d..065565ef0d 100644
--- a/docs/build/profile-guided-optimizations.md
+++ b/docs/build/profile-guided-optimizations.md
@@ -9,7 +9,7 @@ ms.assetid: 2225c307-d3ae-42c1-8345-a5a959d132dc
Profile-guided optimization (PGO) lets you optimize a whole executable file, where the optimizer uses data from test runs of the .exe or .dll file. The data represents the likely performance of the program in a production environment.
-Profile-guided optimizations are only available for x86 or x64 native targets. Profile-guided optimizations aren't available for executable files that run on the common language runtime. Even if you produce an assembly with mixed native and managed code (by using the **/clr** compiler option), you can't use profile-guided optimization on just the native code. If you attempt to build a project with these options set in the IDE, a build error results.
+Profile-guided optimizations are only available for x86, x64, or ARM64 native targets. Profile-guided optimizations aren't available for executable files that run on the common language runtime. Even if you produce an assembly with mixed native and managed code (by using the **/clr** compiler option), you can't use profile-guided optimization on just the native code. If you attempt to build a project with these options set in the IDE, a build error results.
> [!NOTE]
> Information that's gathered from profiling test runs overrides optimizations that would otherwise be in effect if you specify **/Ob**, **/Os**, or **/Ot**. For more information, see [/Ob (Inline Function Expansion)](reference/ob-inline-function-expansion.md) and [/Os, /Ot (Favor Small Code, Favor Fast Code)](reference/os-ot-favor-small-code-favor-fast-code.md).
diff --git a/docs/build/project-property-inheritance.md b/docs/build/project-property-inheritance.md
index cccf6e6fbe..3456a29290 100644
--- a/docs/build/project-property-inheritance.md
+++ b/docs/build/project-property-inheritance.md
@@ -24,7 +24,7 @@ Project properties are stored in several files. Some are stored directly in the
::: moniker range=">=msvc-160"
-Project properties are stored in several files. Some are stored directly in the *`.vcxproj`* project file. Others come from other *`.targets`* or *`.props`* files that the project file imports and which supply default values. You'll find the Visual Studio project files in a locale-specific folder under the base directory, *`%VSINSTALLDIR%MSBuild\Microsoft\VC\`*. The `` is specific to the version of Visual Studio. It's *`v160`* for Visual Studio 2019.
+Project properties are stored in several files. Some are stored directly in the *`.vcxproj`* project file. Others come from other *`.targets`* or *`.props`* files that the project file imports and which supply default values. You'll find the Visual Studio project files in a locale-specific folder under the base directory, *`%VSINSTALLDIR%\MSBuild\Microsoft\VC\`*. The `` is specific to the version of Visual Studio. It's *`v160`* for Visual Studio 2019.
::: moniker-end
diff --git a/docs/build/reference/advanced-property-page.md b/docs/build/reference/advanced-property-page.md
index a6e787e267..f119173610 100644
--- a/docs/build/reference/advanced-property-page.md
+++ b/docs/build/reference/advanced-property-page.md
@@ -1,9 +1,10 @@
---
description: "Use the Advanced property page in Visual Studio 2019 to set various properties for C++ projects."
title: "Advanced Property Page (Project)"
-ms.date: 11/22/2021
+ms.date: 08/31/2022
f1_keywords: ["VC.Project.VCConfiguration.TargetExt", "VC.Project.VCConfiguration.DeleteExtensionsOnClean", "VC.Project.VCConfiguration.BuildLogFile", "VC.Project.VCConfiguration.PreferredToolArchitecture", "VC.Project.VCConfiguration.UseDebugLibraries", "VC.Project.VCConfiguration.EnableUnitySupport", "VC.Project.VCConfiguration.CopyLocalDeploymentContent", "VC.Project.VCConfiguration.CopyLocalProjectReference", "VC.Project.VCConfiguration.CopyLocalDebugSymbols", "VC.Project.VCConfiguration.CopyCppRuntimeToOutputDir", "VC.Project.VCConfiguration.useOfMfc", "VC.Project.VCConfiguration.CharacterSet", "VC.Project.VCConfiguration.WholeProgramOptimization", "VC.Project.VCConfiguration.VCToolsVersion", "VC.Project.VCConfiguration.LLVMToolsVersion", "VC.Project.VCConfiguration.ManagedExtensions", "VC.Project.TargetFrameworkVersion", "VC.Project.VCConfiguration.EnableManagedIncrementalBuild", "VC.Project.VCConfiguration.ManagedAssembly"]
---
+
# Advanced Property Page
::: moniker range="<=msvc-150"
@@ -42,7 +43,7 @@ To programmatically access this property, see **/ALIGN**[**:**_number_]
+> **`/ALIGN`**\[**`:`*`number`***]
### Arguments
-*number*
+*`number`*\
The alignment value in bytes.
## Remarks
-The **/ALIGN** option specifies the alignment of each section within the linear address space of the program. The *number* argument is in bytes and must be a power of two. The default is 4K (4096). The linker issues a warning if the alignment produces an invalid image.
+The **`/ALIGN`** linker option specifies the alignment of each section within the linear address space of the program. The *`number`* argument is in bytes and must be a power of two. The default is 4K (4096). The linker issues a warning if the alignment produces an invalid image.
-Unless you are writing an application such as a device driver, you should not need to modify the alignment.
+Unless you're writing an application such as a device driver, you shouldn't need to modify the alignment.
-It is possible to modify the alignment of a particular section with the align parameter to the [/SECTION](section-specify-section-attributes.md) option.
+It's possible to modify the alignment of a particular section with the *`align`* parameter to the [`/SECTION`](section-specify-section-attributes.md) option.
-The alignment value that you specify cannot be smaller than the largest section alignment.
+The alignment value that you specify can't be smaller than the largest section alignment.
### To set this linker option in the Visual Studio development environment
@@ -40,5 +41,5 @@ The alignment value that you specify cannot be smaller than the largest section
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/allowbind-prevent-dll-binding.md b/docs/build/reference/allowbind-prevent-dll-binding.md
index f3d1146904..583b85e26a 100644
--- a/docs/build/reference/allowbind-prevent-dll-binding.md
+++ b/docs/build/reference/allowbind-prevent-dll-binding.md
@@ -1,22 +1,24 @@
---
-description: "Learn more about: /ALLOWBIND (Prevent DLL Binding)"
-title: "/ALLOWBIND (Prevent DLL Binding)"
-ms.date: "11/04/2016"
+description: "Learn more about: /ALLOWBIND (Prevent DLL binding)"
+title: "/ALLOWBIND (Prevent DLL binding)"
+ms.date: 05/11/2022
f1_keywords: ["VC.Project.VCLinkerTool.PreventDLLBinding", "/allowbind"]
helpviewer_keywords: ["/ALLOWBIND linker option", "binding DLLs", "preventing DLL binding", "ALLOWBIND linker option", "-ALLOWBIND linker option", "DLLs [C++], preventing binding"]
ms.assetid: 30e37e24-12e4-407e-988a-39d357403598
---
-# /ALLOWBIND (Prevent DLL Binding)
+# `/ALLOWBIND` (Prevent DLL binding)
-```
-/ALLOWBIND[:NO]
-```
+Set a flag to disallow DLL binding.
+
+## Syntax
+
+> **`/ALLOWBIND`**\[**`:NO`**]
## Remarks
-/ALLOWBIND:NO sets a bit in a DLL's header that indicates to Bind.exe that the image is not allowed to be bound. You may not want a DLL to be bound if it has been digitally signed (binding invalidates the signature).
+The **`/ALLOWBIND:NO`** linker option sets a bit in a DLL's header that indicates to Bind.exe that the image can't be bound. You may not want a DLL to be bound if it's been digitally signed (binding invalidates the signature).
-You can edit an existing DLL for /ALLOWBIND functionality with the [/ALLOWBIND](allowbind.md) option of the EDITBIN utility.
+You can edit an existing DLL for **`/ALLOWBIND`** functionality with the [`/ALLOWBIND`](allowbind.md) option of the EDITBIN utility.
### To set this linker option in the Visual Studio development environment
@@ -24,7 +26,7 @@ You can edit an existing DLL for /ALLOWBIND functionality with the [/ALLOWBIND](
1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
-1. Enter `/ALLOWBIND:NO` into **Additional Options**.
+1. Enter *`/ALLOWBIND:NO`* into **Additional Options**. Choose **OK** or **Apply** to apply the change.
### To set this linker option programmatically
@@ -32,7 +34,7 @@ You can edit an existing DLL for /ALLOWBIND functionality with the [/ALLOWBIND](
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
-[BindImage function](/windows/win32/api/imagehlp/nf-imagehlp-bindimage)
-[BindImageEx function](/windows/win32/api/imagehlp/nf-imagehlp-bindimageex)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)\
+[`BindImage` function](/windows/win32/api/imagehlp/nf-imagehlp-bindimage)\
+[`BindImageEx` function](/windows/win32/api/imagehlp/nf-imagehlp-bindimageex)
diff --git a/docs/build/reference/allowbind.md b/docs/build/reference/allowbind.md
index c57e11a615..b7404db175 100644
--- a/docs/build/reference/allowbind.md
+++ b/docs/build/reference/allowbind.md
@@ -11,7 +11,6 @@ ms.assetid: eaadbb8c-4339-4281-9a75-3a1ce2352ff8
Specifies whether a DLL can be bound.
```
-
/ALLOWBIND[:NO]
```
diff --git a/docs/build/reference/allowisolation-manifest-lookup.md b/docs/build/reference/allowisolation-manifest-lookup.md
index 7b475485b1..4d178ade64 100644
--- a/docs/build/reference/allowisolation-manifest-lookup.md
+++ b/docs/build/reference/allowisolation-manifest-lookup.md
@@ -1,32 +1,30 @@
---
-description: "Learn more about: /ALLOWISOLATION (Manifest Lookup)"
-title: "/ALLOWISOLATION (Manifest Lookup)"
-ms.date: "11/04/2016"
+description: "Learn more about: /ALLOWISOLATION (Manifest lookup)"
+title: "/ALLOWISOLATION (Manifest lookup)"
+ms.date: 05/11/2022
f1_keywords: ["/ALLOWISOLATION", "VC.Project.VCLinkerTool.AllowIsolation"]
helpviewer_keywords: ["-ALLOWISOLATION linker option", "/ALLOWISOLATION linker option"]
ms.assetid: 6d41851e-b3c1-4bdf-beaa-031773089d6f
---
-# /ALLOWISOLATION (Manifest Lookup)
+# `/ALLOWISOLATION` (Manifest lookup)
Specifies behavior for manifest lookup.
## Syntax
-```
-/ALLOWISOLATION[:NO]
-```
+> **`/ALLOWISOLATION`**\[**`:NO`**]
## Remarks
-**/ALLOWISOLATION:NO** indicates DLLs are loaded as if there was no manifest and causes the linker to set the `IMAGE_DLLCHARACTERISTICS_NO_ISOLATION` bit in the optional header's `DllCharacteristics` field.
+The **`/ALLOWISOLATION:NO`** linker option indicates DLLs are loaded as if there was no manifest and causes the linker to set the `IMAGE_DLLCHARACTERISTICS_NO_ISOLATION` bit in the optional header's `DllCharacteristics` field.
-**/ALLOWISOLATION** causes the operating system to do manifest lookups and loads.
+**`/ALLOWISOLATION`** causes the operating system to do manifest lookups and loads.
-**/ALLOWISOLATION** is the default.
+**`/ALLOWISOLATION`** is the default.
-When isolation is disabled for an executable, the Windows loader will not attempt to find an application manifest for the newly created process. The new process will not have a default activation context, even if there is a manifest inside the executable or placed in the same directory as the executable with name executable-name**.exe.manifest**.
+When isolation is disabled for an executable, the Windows loader won't attempt to find an application manifest for the newly created process. The new process won't have a default activation context, even if there's a manifest inside the executable or placed in the same directory as the executable with name *`.exe.manifest`*.
-For more information, see [Manifest Files Reference](/windows/win32/SbsCs/manifest-files-reference).
+For more information, see [Manifest files reference](/windows/win32/SbsCs/manifest-files-reference).
### To set this linker option in the Visual Studio development environment
@@ -38,5 +36,5 @@ For more information, see [Manifest Files Reference](/windows/win32/SbsCs/manife
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/allowisolation.md b/docs/build/reference/allowisolation.md
index 28ab8b6038..579f9900b3 100644
--- a/docs/build/reference/allowisolation.md
+++ b/docs/build/reference/allowisolation.md
@@ -13,7 +13,6 @@ Specifies behavior for manifest lookup.
## Syntax
```
-
/ALLOWISOLATION[:NO]
```
diff --git a/docs/build/reference/analyze-code-analysis.md b/docs/build/reference/analyze-code-analysis.md
index e2f0739798..8064dc9e98 100644
--- a/docs/build/reference/analyze-code-analysis.md
+++ b/docs/build/reference/analyze-code-analysis.md
@@ -1,10 +1,9 @@
---
title: "/analyze (Code analysis)"
description: "The Microsoft C++ compiler /analyze option syntax and usage."
-ms.date: 10/19/2021
-f1_keywords: ["VC.Project.VCCLCompilerTool.EnablePREfast", "/analyze", "VC.Project.VCCLCompilerTool.PREfastAdditionalOptions", "VC.Project.VCCLCompilerTool.PREfastAdditionalPlugins"]
+ms.date: 02/17/2022
+f1_keywords: ["VC.Project.VCCLCompilerTool.EnablePREfast", "/analyze", "VC.Project.VCCLCompilerTool.PREfastAdditionalOptions", "VC.Project.VCCLCompilerTool.PREfastAdditionalPlugins", "VC.Project.VCCLCompilerTool.DisableAnalyzeExternal", "VC.Project.VCCLCompilerTool.AnalyzeExternalRuleset"]
helpviewer_keywords: ["/analyze compiler option [C++]", "-analyze compiler option [C++]", "analyze compiler option [C++]"]
-ms.assetid: 81da536a-e030-4bd4-be18-383927597d08
---
# `/analyze` (Code analysis)
@@ -135,7 +134,7 @@ Then, use compiler option `/analyze:plugin EspXEngine.dll` to use the EspXEngine
#### External file analysis options
-Starting in Visual Studio 2019 version 16.10, you can specify different analysis rules and behavior for external headers. By using the **`/external:I`**, **`/external:env`**, or **`/external:anglebrackets`** options, directories can be specified as "external" directories. Any files that are included by using `#include`from an external directory or one of its subdirectories are considered as external headers. For more information, see [`/external` (External headers diagnostics)](external-external-headers-diagnostics.md).
+Starting in Visual Studio 2019 version 16.10, you can specify different analysis rules and behavior for external headers. Use the **`/external:I`**, **`/external:env`**, or **`/external:anglebrackets`** options to specify directories as "external" directories. Any files that are included by using `#include` from an external directory or its subdirectories are considered as external headers. For more information, see [`/external` (External headers diagnostics)](external-external-headers-diagnostics.md).
Code analysis provides these options to control analysis of external files:
@@ -206,14 +205,14 @@ Specifies the current project directory. If the ruleset (or an item it includes)
Specifies a semicolon-separated list of ruleset search paths. If the ruleset (or an item it includes) is a file name, then the compiler first looks for the file under the *`project_directory`* specified by **`/analyze:projectdirectory`**, if any, followed by the specified *`ruleset_directories`*. This option is available starting in Visual Studio 2019 version 16.9.
**`/analyze:ruleset`** *`ruleset_files`*\
-Specifies one or more ruleset files to use for analysis. This option can make analysis more efficient. That's because the analysis engine tries to exclude checkers that have no active rules specified in the ruleset files before running. Otherwise, the engine runs all checkers enabled.
+Specifies one or more ruleset files to use for analysis. This option can make analysis more efficient; the analysis engine tries to exclude checkers that have no active rules specified in the ruleset files before running. Otherwise, the engine runs all checkers enabled.
::: moniker-end
::: moniker range="msvc-150"
**`/analyze:ruleset`** *`ruleset_file`*\
-Specifies a ruleset file to use for analysis. This option can make analysis more efficient. That's because the analysis engine tries to exclude checkers that have no active rules specified in the ruleset file before running. Otherwise, the engine runs all checkers enabled.
+Specifies a ruleset file to use for analysis. This option can make analysis more efficient; the analysis engine tries to exclude checkers that have no active rules specified in the ruleset file before running. Otherwise, the engine runs all checkers enabled.
::: moniker-end
@@ -267,6 +266,26 @@ For more information, see [Code analysis for C/C++ overview](../../code-quality/
1. Modify one or more of the **Code Analysis** properties.
+1. Choose **OK** or **Apply** to save your changes.
+
+::: moniker range=">=msvc-160"
+
+To set external file analysis options in Visual Studio 2019 version 16.10 and later:
+
+1. Open the project's **Property Pages** dialog box.
+
+1. Select the **Configuration Properties** > **C/C++** > **External Includes** property page.
+
+1. Set properties:
+
+ - **Disable Code Analysis for External Headers** sets the **`/analyze:external-`** option.
+
+ - **Analysis Ruleset for External Headers** sets the **`/analyze:external:ruleset path`** option.
+
+1. Choose **OK** or **Apply** to save your changes.
+
+::: moniker-end
+
### To set this compiler option programmatically
1. See .
diff --git a/docs/build/reference/appcontainer-windows-store-app.md b/docs/build/reference/appcontainer-windows-store-app.md
index 4d57c088f3..4c0e6f856c 100644
--- a/docs/build/reference/appcontainer-windows-store-app.md
+++ b/docs/build/reference/appcontainer-windows-store-app.md
@@ -1,26 +1,22 @@
---
-description: "Learn more about: /APPCONTAINER (Microsoft Store App)"
-title: "/APPCONTAINER (UWP/Microsoft Store App)"
-ms.date: "11/04/2016"
+description: "Learn more about: /APPCONTAINER (Microsoft Store app)"
+title: "/APPCONTAINER (UWP/Microsoft Store app)"
+ms.date: 05/11/2022
ms.assetid: 9a432db5-7640-460b-ab18-6f61fa7daf6f
---
-# /APPCONTAINER (Microsoft Store App)
+# `/APPCONTAINER` (Microsoft Store app)
-Specifies whether the linker creates an executable image that must be run in an app container.
+Specifies whether the linker creates an executable image that must run in an AppContainer environment.
## Syntax
-```
-/APPCONTAINER[:NO]
-```
+> **`/APPCONTAINER`**\[**`:NO`**]
## Remarks
-By default, /APPCONTAINER is off.
+The **`/APPCONTAINER`** linker option modifies an executable to indicate whether the app must run in the AppContainer process-isolation environment. Specify **`/APPCONTAINER`** for an app that must run in the AppContainer environment—for example, a Universal Windows Platform (UWP) or Windows Phone 8.x app. The option is set automatically in Visual Studio when you create a Universal Windows app from a template. For a desktop app, specify **`/APPCONTAINER:NO`** or just omit the option. By default, **`/APPCONTAINER`** is off.
-This option modifies an executable to indicate whether the app must be run in the appcontainer process-isolation environment. Specify /APPCONTAINER for an app that must run in the appcontainer environment—for example, a Universal Windows Platform (UWP) or Windows Phone 8.x app. (The option is set automatically in Visual Studio when you create a Universal Windows app from a template.) For a desktop app, specify /APPCONTAINER:NO or just omit the option.
-
-The /APPCONTAINER option was introduced in Windows 8.
+The **`/APPCONTAINER`** option was introduced in Windows 8.
### To set this linker option in Visual Studio
@@ -28,9 +24,9 @@ The /APPCONTAINER option was introduced in Windows 8.
1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
-1. In **Additional Options**, enter `/APPCONTAINER` or `/APPCONTAINER:NO`.
+1. In **Additional Options**, enter *`/APPCONTAINER`* or *`/APPCONTAINER:NO`*.
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/appcontainer.md b/docs/build/reference/appcontainer.md
index 3b0db522a6..7cf45709d1 100644
--- a/docs/build/reference/appcontainer.md
+++ b/docs/build/reference/appcontainer.md
@@ -11,7 +11,6 @@ ms.assetid: 0ca4f1ec-c8de-4a37-b3e2-deda7af0bb88
Marks an executable that must run in an app container—for example, a Microsoft Store or Universal Windows app.
```
-
/APPCONTAINER[:NO]
```
diff --git a/docs/build/reference/arch-arm.md b/docs/build/reference/arch-arm.md
index b622745e0e..8d7ebd3293 100644
--- a/docs/build/reference/arch-arm.md
+++ b/docs/build/reference/arch-arm.md
@@ -1,34 +1,31 @@
---
description: "Learn more about: /arch (ARM)"
title: "/arch (ARM)"
-ms.date: "11/04/2016"
-ms.assetid: 4f1406ff-f174-487c-a126-8ab06cf447c1
+ms.date: 07/01/2022
---
-# /arch (ARM)
+# `/arch` (ARM)
-Specifies the architecture for code generation on ARM. See also [/arch (x86)](arch-x86.md) and [/arch (x64)](arch-x64.md).
+Specifies the architecture for code generation on ARM. These switches apply to the ARM targeting version of the compiler. For more information on **`/arch`** for other target architectures, see [`/arch` (ARM64)](arch-arm64.md), [`/arch` (x64)](arch-x64.md), and [`/arch` (x86)](arch-x86.md)
## Syntax
-```
-/arch:[ARMv7VE|VFPv4]
-```
+> **`/arch:`**\[**`ARMv7VE`**|**`VFPv4`**]
## Arguments
-**/arch:ARMv7VE**
+**`/arch:ARMv7VE`**\
Enables the use of ARMv7VE Virtualization Extensions instructions.
-**/arch:VFPv4**
-Enables the use of ARM VFPv4 instructions. If this option is not specified, VFPv3 is the default.
+**`/arch:VFPv4`**\
+Enables the use of ARM VFPv4 instructions. If this option isn't specified, VFPv3 is the default.
## Remarks
-The `_M_ARM_FP` macro (for ARM only) indicates which, if any, **/arch** compiler option was used. For more information, see [Predefined Macros](../../preprocessor/predefined-macros.md).
+The `_M_ARM_FP` macro (for ARM only) indicates which, if any, **`/arch`** compiler option was used. For more information, see [Predefined macros](../../preprocessor/predefined-macros.md).
-When you use [/clr](clr-common-language-runtime-compilation.md) to compile, **/arch** has no effect on code generation for managed functions. **/arch** only affects code generation for native functions.
+When you use [`/clr`](clr-common-language-runtime-compilation.md) to compile, **`/arch`** has no effect on code generation for managed functions. **`/arch`** only affects code generation for native functions.
-### To set the /arch:ARMv7VE or /arch:VFPv4 compiler option in Visual Studio
+### To set the `/arch:ARMv7VE` or `/arch:VFPv4` compiler option in Visual Studio
1. Open the **Property Pages** dialog box for the project. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
@@ -42,6 +39,6 @@ When you use [/clr](clr-common-language-runtime-compilation.md) to compile, **/a
## See also
-[/arch (Minimum CPU Architecture)](arch-minimum-cpu-architecture.md)
-[MSVC Compiler Options](compiler-options.md)
-[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
+[`/arch` (Minimum CPU architecture)](arch-minimum-cpu-architecture.md)\
+[MSVC compiler options](compiler-options.md)\
+[MSVC compiler command-line syntax](compiler-command-line-syntax.md)
diff --git a/docs/build/reference/arch-arm64.md b/docs/build/reference/arch-arm64.md
new file mode 100644
index 0000000000..7b432961ec
--- /dev/null
+++ b/docs/build/reference/arch-arm64.md
@@ -0,0 +1,63 @@
+---
+title: "/arch (ARM64)"
+description: "Learn more about: /arch (ARM64)"
+ms.date: 05/24/2024
+---
+# `/arch` (ARM64)
+
+Specifies the Arm A-Profile architecture extension for code generation on ARM64. These switches apply to the ARM64 targeting version of the compiler. For more information about **`/arch`** for other target architectures, see [`/arch` (x86)](arch-x86.md), [`/arch` (x64)](arch-x64.md), and [`/arch` (ARM)](arch-arm.md).
+
+## Syntax
+
+>**`/arch:`**[[+feature]](feature-arm64.md)\
+>**`/arch:`**[[+feature]](feature-arm64.md)
+
+## Arguments
+
+**`/arch:armv8.x`**\
+Specifies the Armv8-A architecture, where **`x`** is a required extension value from **`0`** to **`9`**1. By default, the compiler uses the **`/arch:armv8.0`** behavior if no architecture is specified.
+
+**`/arch:armv9.x`**2\
+Specifies the Armv9-A architecture, where **`x`** is a required extension value from **`0`** to **`4`**. By default, the compiler uses the **`/arch:armv8.0`** behavior if no architecture is specified.
+
+## Remarks
+
+You can specify an ARM64 extension from Armv8.0-A through Armv8.9-A, and Armv9.0-A through Armv9.4-A. Optionally, enable one or more architecture features by appending a feature argument to the option3. For example, to target Armv8.0-A and enable feature `FEAT_LSE`, append feature argument **`lse`** so that the option becomes **`/arch:armv8.0+lse`**. For more information about available features and their requirements, see [`/feature` (ARM64)](feature-arm64.md)3.
+
+> [!NOTE]
+> Depending on your version of Visual Studio, the compiler may not yet generate instructions from all feature sets required by the extension level you specify. For example, **`/arch:armv8.1`** allows the *`Interlocked`* intrinsic functions to use the appropriate atomic instruction introduced with the Armv8.1-A extension feature `FEAT_LSE`, but compiler support requires Visual Studio 2022 version 17.2 or later.
+
+The `_M_ARM64` macro is defined by default when compiling for an ARM64 target. For more information, see [Predefined macros](../../preprocessor/predefined-macros.md).
+
+The `__ARM_ARCH` macro is defined for `/arch:ARMv8.0` and higher. It indicates the ARM architecture extension level that the compiler is targeting. For more information, see [Predefined macros](../../preprocessor/predefined-macros.md).
+
+```cpp
+#if __ARM_ARCH >= 802
+ // code that requires ARMv8.2...
+#endif
+```
+
+**`/arch`** only affects code generation for native functions. When you use [`/clr`](clr-common-language-runtime-compilation.md) to compile, **`/arch`** has no effect on code generation for managed functions.
+
+### To set the `/arch` compiler option in Visual Studio
+
+1. Open the **Property Pages** dialog box for the project. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+
+1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
+
+1. In the **Additional options** box, add *`/arch:armv8.0`* or replace `armv8.0` with a different ARM64 extension. Choose **OK** to save your changes.
+
+### To set this compiler option programmatically
+
+- See .
+
+1 Armv8-A architecture extension `armv8.9` is available starting in Visual Studio 2022 version 17.10.\
+2 Armv9-A architecture extensions are available starting in Visual Studio 2022 version 17.10.\
+3 Architecture feature enablement is available starting in Visual Studio 2022 version 17.10.
+
+## See also
+
+[`/arch` (Minimum CPU architecture)](arch-minimum-cpu-architecture.md)\
+[Predefined macros](../../preprocessor/predefined-macros.md)\
+[MSVC compiler options](compiler-options.md)\
+[MSVC compiler command-line syntax](compiler-command-line-syntax.md)
diff --git a/docs/build/reference/arch-minimum-cpu-architecture.md b/docs/build/reference/arch-minimum-cpu-architecture.md
index 48a02679bc..3c17866868 100644
--- a/docs/build/reference/arch-minimum-cpu-architecture.md
+++ b/docs/build/reference/arch-minimum-cpu-architecture.md
@@ -1,22 +1,23 @@
---
description: "Learn more about: /arch (Minimum CPU Architecture)"
title: "/arch (Minimum CPU Architecture)"
-ms.date: "11/04/2016"
+ms.date: 06/30/2022
f1_keywords: ["VC.Project.VCCLCompilerTool.EnableEnhancedInstructionSet", "/arch"]
helpviewer_keywords: ["-arch compiler option [C++]", "/arch compiler option [C++]", "arch compiler option [C++]"]
-ms.assetid: cc17da15-47bd-4e74-b905-4e73c3bdb8a0
---
-# /arch (Minimum CPU Architecture)
+# `/arch` (Minimum CPU Architecture)
-The architecture options specify the architecture for code generation. Select the base hardware architecture you are working with to see /arch options for that target platform.
+The architecture options specify the architecture for code generation. Select the base hardware architecture you're working with to see **`/arch`** options for that target platform.
-- [/arch (x86)](arch-x86.md)
+- [`/arch (x86`)](arch-x86.md)
-- [/arch (x64)](arch-x64.md)
+- [`/arch (x64)`](arch-x64.md)
-- [/arch (ARM)](arch-arm.md)
+- [`/arch (ARM)`](arch-arm.md)
+
+- [`/arch (ARM64)`](arch-arm64.md)
## See also
-[MSVC Compiler Options](compiler-options.md)
-[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
+[MSVC compiler options](compiler-options.md)\
+[MSVC compiler command-line syntax](compiler-command-line-syntax.md)
diff --git a/docs/build/reference/arch-x64.md b/docs/build/reference/arch-x64.md
index ffa9f2996e..0bcf4ff202 100644
--- a/docs/build/reference/arch-x64.md
+++ b/docs/build/reference/arch-x64.md
@@ -1,57 +1,75 @@
---
description: "Learn more about: /arch (x64)"
title: "/arch (x64)"
-ms.date: "10/01/2019"
-ms.assetid: ecda22bf-5bed-43f4-99fb-88aedd83d9d8
+ms.date: 06/30/2022
+f1_keywords: ["/arch:SSE2", "/arch:SSE4.2", "/arch:AVX", "/arch:AVX2", "/arch:AVX512", "/arch:AVX10.1"]
+helpviewer_keywords: ["/arch:SSE2 compiler option [C++]", "/arch:SSE4.2 compiler option [C++]", "/arch:AVX compiler option [C++]", "/arch:AVX2 compiler option [C++]", "/arch:AVX512 compiler option [C++]", "/arch:AVX10.1 compiler option [C++]"]
---
-# /arch (x64)
+# `/arch` (x64)
-Specifies the architecture for code generation on x64. Also see [/arch (x86)](arch-x86.md) and [/arch (ARM)](arch-arm.md).
+Specifies the architecture for code generation on x64. These switches apply to the x64 targeting version of the compiler. For more information on **`/arch`** for other target architectures, see [`/arch` (x86)](arch-x86.md), [`/arch` (ARM64)](arch-arm64.md), and [`/arch` (ARM)](arch-arm.md).
## Syntax
-```
-/arch:[AVX|AVX2|AVX512]
-```
+> **`/arch:`**\[**`SSE2`**|**`SSE4.2`**|**`AVX`**|**`AVX2`**|**`AVX512`**|**`AVX10.1`**]
## Arguments
-**/arch:AVX**
-Enables the use of Intel Advanced Vector Extensions instructions.
+**`/arch:SSE2`**\
+Enables Intel Streaming SIMD Extensions 2. The default instruction set is SSE2 if no **`/arch`** option is specified.
-**/arch:AVX2**
-Enables the use of Intel Advanced Vector Extensions 2 instructions.
+**`/arch:SSE4.2`**\
+Enables Intel Streaming SIMD Extensions 4.2.
-**/arch:AVX512**
-Enables the use of Intel Advanced Vector Extensions 512 instructions.
+**`/arch:AVX`**\
+Enables Intel Advanced Vector Extensions.
+
+**`/arch:AVX2`**\
+Enables Intel Advanced Vector Extensions 2.
+
+**`/arch:AVX512`**\
+Enables Intel Advanced Vector Extensions 512.
+
+**`/arch:AVX10.1`**\
+Enables Intel Advanced Vector Extensions 10 version 1.
## Remarks
-The **/arch** option enables the use of certain instruction set extensions, particularly for vector calculation, available in processors from Intel and AMD. In general, more recently introduced processors may support additional extensions over those supported by older processors, although you should consult the documentation for a particular processor or test for instruction set extension support using [__cpuid](../../intrinsics/cpuid-cpuidex.md) before executing code using an instruction set extension.
+The **`/arch`** option enables the use of certain instruction set extensions, particularly for vector calculation, available in processors from Intel and AMD. In general, more recently introduced processors may support extensions beyond the ones supported by older processors, although you should consult the documentation for a particular processor or test for instruction set extension support using [`__cpuid`](../../intrinsics/cpuid-cpuidex.md) before executing code using an instruction set extension. You can also use the [`__check_isa_support`](../../intrinsics/check-isa-arch-support.md) intrinsic to check for more frequently used CPU features.
-**/arch** only affects code generation for native functions. When you use [/clr](clr-common-language-runtime-compilation.md) to compile, **/arch** has no effect on code generation for managed functions.
+**`/arch`** only affects code generation for native functions. When you use [`/clr`](clr-common-language-runtime-compilation.md) to compile, **`/arch`** has no effect on code generation for managed functions.
The processor extensions have the following characteristics:
-- The default mode uses SSE2 instructions for scalar floating-point and vector calculations. These instructions allow calculation with 128-bit vectors of single-precision, double-precision and 1, 2, 4 or 8 byte integer values, as well as single-precision and double-precision scalar floating-point values.
+- The default mode uses SSE2 instructions for scalar floating-point and vector calculations. These instructions allow calculation with 128-bit vectors of single-precision, double-precision and 1, 2, 4 or 8-byte integer values, as well as single-precision and double-precision scalar floating-point values.
+
+- **`SSE4.2`** uses the full set of SSE instructions for floating-point scalar, vector, and integer vector calculations.
+
+- **`AVX`** introduced an alternative instruction encoding for vector and floating-point scalar instructions. It allows vectors of either 128 bits or 256 bits, and zero-extends all vector results to the full vector size. (For legacy compatibility, SSE-style vector instructions preserve all bits beyond bit 127.) Most floating-point operations are extended to 256 bits.
-- **AVX** introduced an alternative instruction encoding for vector and floating-point scalar instructions that allows vectors of either 128 bits or 256 bits, and zero-extends all vector results to the full vector size. (For legacy compatibility, SSE-style vector instructions preserve all bits beyond bit 127.) Most floating-point operations are extended to 256 bits.
+- **`AVX2`** extends most integer operations to 256-bit vectors and enables use of Fused Multiply-Add (FMA) instructions.
-- **AVX2** extends most integer operations to 256-bit vectors and enables use of Fused Multiply-Add (FMA) instructions.
+- **`AVX-512`** introduced another instruction encoding form that allows 512-bit vectors, masking, embedded rounding/broadcast, and new instructions. The default vector length for **`AVX-512`** is 512 bits and can be changed to 256 bits using the [`/vlen`](vlen.md) flag.
-- **AVX-512** introduced another instruction encoding form that allows 512-bit vectors, plus certain other optional features. Instructions for additional operations were also added.
+- **`AVX10.1`** adds more instructions on top of **`AVX-512`**. The default vector length for **`AVX10.1`** is 256 bits and can be changed to 512 bits using the [`/vlen`](vlen.md) flag.
-Each **/arch** option may also enable the use of other non-vector instructions that are associated with that option. An example is the use of certain BMI instructions when **/arch:AVX2** is specified.
+Each **`/arch`** option may also enable the use of other non-vector instructions that are associated with that option. An example is the use of certain BMI instructions when **`/arch:AVX2`** is specified.
-The `__AVX__` preprocessor symbol is defined when the **/arch:AVX**, **/arch:AVX2** or **/arch:AVX512** compiler option is specified. The `__AVX2__` preprocessor symbol is defined when the **/arch:AVX2** or **/arch:AVX512** compiler option is specified. The `__AVX512F__`, `__AVX512CD__`, `__AVX512BW__`, `__AVX512DQ__` and `__AVX512VL__` preprocessor symbols are defined when the **/arch:AVX512** compiler option is specified. For more information, see [Predefined Macros](../../preprocessor/predefined-macros.md). The **/arch:AVX2** option was introduced in Visual Studio 2013 Update 2, version 12.0.34567.1. Limited support for **/arch:AVX512** was added in Visual Studio 2017, and expanded in Visual Studio 2019.
+The `__AVX__` preprocessor symbol is defined when the **`/arch:AVX`**, **`/arch:AVX2`**, **`/arch:AVX512`**, or **`/arch:AVX10.1`** compiler option is specified.
+The `__AVX2__` preprocessor symbol is defined when the **`/arch:AVX2`**, **`/arch:AVX512`**, or **`/arch:AVX10.1`** compiler option is specified.
+The `__AVX512F__`, `__AVX512CD__`, `__AVX512BW__`, `__AVX512DQ__`, and `__AVX512VL__` preprocessor symbols are defined when the **`/arch:AVX512`**, or **`/arch:AVX10.1`** compiler option is specified.
+The `__AVX10_VER__` preprocessor symbol is defined when the **`/arch:AVX10.1`** compiler option is specified. It indicates the AVX10 version the compiler is targeting. For more information, see [Predefined macros](../../preprocessor/predefined-macros.md).
+The **`/arch:AVX2`** option was introduced in Visual Studio 2013 Update 2, version 12.0.34567.1.
+Limited support for **`/arch:AVX512`** was added in Visual Studio 2017, and expanded in Visual Studio 2019.
+Support for **`/arch:AVX10.1`** was added in Visual Studio 2022.
-### To set the /arch:AVX, /arch:AVX2 or /arch:AVX512 compiler option in Visual Studio
+### To set the `/arch` compiler option in Visual Studio
1. Open the **Property Pages** dialog box for the project. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
1. Select the **Configuration Properties** > **C/C++** > **Code Generation** property page.
-1. In the **Enable Enhanced Instruction Set** drop-down box, choose **Advanced Vector Extensions (/arch:AVX)**, **Advanced Vector Extensions 2 (/arch:AVX2)** or **Advanced Vector Extensions 512 (/arch:AVX512)**.
+1. Modify the **Enable Enhanced Instruction Set** property.
### To set this compiler option programmatically
@@ -59,6 +77,6 @@ The `__AVX__` preprocessor symbol is defined when the **/arch:AVX**, **/arch:AVX
## See also
-[/arch (Minimum CPU Architecture)](arch-minimum-cpu-architecture.md)
-[MSVC Compiler Options](compiler-options.md)
-[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
+[`/arch` (Minimum CPU Architecture)](arch-minimum-cpu-architecture.md)\
+[MSVC compiler options](compiler-options.md)\
+[MSVC compiler command-line syntax](compiler-command-line-syntax.md)
diff --git a/docs/build/reference/arch-x86.md b/docs/build/reference/arch-x86.md
index 73eefc119a..cb71ce0716 100644
--- a/docs/build/reference/arch-x86.md
+++ b/docs/build/reference/arch-x86.md
@@ -1,64 +1,68 @@
---
description: "Learn more about: /arch (x86)"
title: "/arch (x86)"
-ms.date: "10/01/2019"
-ms.assetid: 9dd5a75d-06e4-4674-aade-33228486078d
+ms.date: 06/30/2022
+f1_keywords: ["/arch:IA32", "/arch:SSE", "/arch:SSE2", "/arch:AVX", "/arch:AVX2", "/arch:AVX512", "/arch:AVX10.1"]
+helpviewer_keywords: ["/arch:IA32 compiler option [C++]", "/arch:SSE compiler option [C++]", "/arch:SSE2 compiler option [C++]", "/arch:AVX compiler option [C++]", "/arch:AVX2 compiler option [C++]", "/arch:AVX512 compiler option [C++]", "/arch:AVX10.1 compiler option [C++]"]
---
-# /arch (x86)
+# `/arch` (x86)
-Specifies the architecture for code generation on x86. Also see [/arch (x64)](arch-x64.md) and [/arch (ARM)](arch-arm.md).
+Specifies the architecture for code generation on x86. These switches apply to the x86 (32-bit) targeting version of the compiler. For more information on **`/arch`** for other target architectures, see [`/arch` (ARM64)](arch-arm64.md), [`/arch` (x64)](arch-x64.md), and [`/arch` (ARM)](arch-arm.md).
## Syntax
-```
-/arch:[IA32|SSE|SSE2|AVX|AVX2|AVX512]
-```
+> **`/arch:`**\[**`IA32`**|**`SSE`**|**`SSE2`**|**`AVX`**|**`AVX2`**|**`AVX512`**|**`AVX10.1`**]
## Arguments
-**/arch:IA32**
+**`/arch:IA32`**\
Specifies no enhanced instructions and also specifies x87 for floating-point calculations.
-**/arch:SSE**
-Enables the use of SSE instructions.
+**`/arch:SSE`**\
+Enables Intel Streaming SIMD Extensions.
-**/arch:SSE2**
-Enables the use of SSE2 instructions. This is the default instruction on x86 platforms if no **/arch** option is specified.
+**`/arch:SSE2`**\
+Enables Intel Streaming SIMD Extensions 2. The default instruction set is SSE2 if no **`/arch`** option is specified.
-**/arch:AVX**
-Enables the use of Intel Advanced Vector Extensions instructions.
+**`/arch:AVX`**\
+Enables Intel Advanced Vector Extensions.
-**/arch:AVX2**
-Enables the use of Intel Advanced Vector Extensions 2 instructions.
+**`/arch:AVX2`**\
+Enables Intel Advanced Vector Extensions 2.
-**/arch:AVX512**
-Enables the use of Intel Advanced Vector Extensions 512 instructions.
+**`/arch:AVX512`**\
+Enables Intel Advanced Vector Extensions 512.
+
+**`/arch:AVX10.1`**\
+Enables Intel Advanced Vector Extensions 10 version 1.
## Remarks
-The **/arch** option enables or disables the use of certain instruction set extensions, particularly for vector calculation, available in processors from Intel and AMD. In general, more recently introduced processors may support additional extensions over those supported by older processors, although you should consult the documentation for a particular processor or test for instruction set extension support using [__cpuid](../../intrinsics/cpuid-cpuidex.md) before executing code using an instruction set extension.
+The **`/arch`** option enables or disables the use of certain instruction set extensions, particularly for vector calculation, available in processors from Intel and AMD. In general, more recently introduced processors may support extensions beyond the ones supported by older processors. You should consult the documentation for a particular processor or test for instruction set extension support using [`__cpuid`](../../intrinsics/cpuid-cpuidex.md) before executing code using an instruction set extension. You can also use the [`__check_isa_support`](../../intrinsics/check-isa-arch-support.md) intrinsic to check for more frequently used CPU features.
+
+**`/arch`** only affects code generation for native functions. When you use [`/clr`](clr-common-language-runtime-compilation.md) to compile, **`/arch`** has no effect on code generation for managed functions.
-**/arch** only affects code generation for native functions. When you use [/clr](clr-common-language-runtime-compilation.md) to compile, **/arch** has no effect on code generation for managed functions.
+The **`/arch`** options refer to instruction set extensions with the following characteristics:
-The **/arch** options refer to instruction set extensions with the following characteristics:
+- **`IA32`** is the legacy 32-bit x86 instruction set without any vector operations and using x87 for floating-point calculations.
-- **IA32** is the legacy 32-bit x86 instruction set without any vector operations and using x87 for floating-point calculations.
+- **`SSE`** allows calculation with vectors of up to four single-precision floating-point values. Corresponding scalar floating-point instructions were added as well.
-- **SSE** allows calculation with vectors of up to four single-precision floating-point values. Corresponding scalar floating-point instructions were added as well.
+- **`SSE2`** allows calculation with 128-bit vectors of single-precision, double-precision and 1, 2, 4, or 8-byte integer values. Double-precision scalar instructions were also added.
-- **SSE2** allows calculation with 128-bit vectors of single-precision, double-precision and 1, 2, 4 or 8 byte integer values. Double-precision scalar instructions were also added.
+- **`AVX`** introduced an alternative instruction encoding for vector and floating-point scalar instructions. It allows vectors of either 128 bits or 256 bits, and zero-extends all vector results to the full vector size. (For legacy compatibility, SSE-style vector instructions preserve all bits beyond bit 127.) Most floating-point operations are extended to 256 bits.
-- **AVX** introduced an alternative instruction encoding for vector and floating-point scalar instructions that allows vectors of either 128 bits or 256 bits, and zero-extends all vector results to the full vector size. (For legacy compatibility, SSE-style vector instructions preserve all bits beyond bit 127.) Most floating-point operations are extended to 256 bits.
+- **`AVX2`** extends most integer operations to 256-bit vectors, and enables use of Fused Multiply-Add (FMA) instructions.
-- **AVX2** extends most integer operations to 256-bit vectors, and enables use of Fused Multiply-Add (FMA) instructions.
+- **`AVX512`** introduced another instruction encoding form that allows 512-bit vectors, masking, embedded rounding/broadcast, and new instructions. The default vector length for **`AVX512`** is 512 bits and can be changed to 256 bits using the [`/vlen`](vlen.md) flag.
-- **AVX512** introduced another instruction encoding form that allows 512-bit vectors, plus certain other optional features. Instructions for additional operations were also added.
+- **`AVX10.1`** adds more instructions on top of **`AVX-512`**. The default vector length for **`AVX10.1`** is 256 bits and can be changed to 512 bits using the [`/vlen`](vlen.md) flag.
-The optimizer chooses when and how to use vector instructions depending on which **/arch** is specified. Scalar floating-point computations are performed with SSE or AVX instructions when available. Some calling conventions specify passing floating-point arguments on the x87 stack, and as a result, your code may use a mixture of both x87 and SSE/AVX instructions for floating-point computations. Integer vector instructions can also be used for some 64-bit integer operations when available.
+The optimizer chooses when and how to use vector instructions depending on which **`/arch`** is specified. Scalar floating-point computations are usually performed with SSE or AVX instructions when available. Some calling conventions specify passing floating-point arguments on the x87 stack, and as a result, your code may use a mixture of both x87 and SSE/AVX instructions for floating-point computations. Integer vector instructions can also be used for some 64-bit integer operations when available.
-In addition to the vector and floating-point scalar instructions, each **/arch** option may also enable the use of other non-vector instructions that are associated with that option. An example is the CMOVcc instruction family that first appeared on the Intel Pentium Pro processors. Because SSE instructions were introduced with the subsequent Intel Pentium III processor, CMOVcc instructions may be generated except when **/arch:IA32** is specified.
+In addition to the vector and floating-point scalar instructions, each **`/arch`** option may also enable the use of other non-vector instructions that are associated with that option. An example is the CMOVcc instruction family that first appeared on the Intel Pentium Pro processors. Because SSE instructions were introduced with the subsequent Intel Pentium III processor, CMOVcc instructions may be generated except when **`/arch:IA32`** is specified.
-Floating-point operations are normally rounded to double-precision (64-bit) in x87 code, but you can use `_controlfp` to modify the FP control word, including setting the precision control to extended precision (80-bit) or single-precision (32-bit). For more information, see [_control87, _controlfp, \__control87_2](../../c-runtime-library/reference/control87-controlfp-control87-2.md). SSE and AVX have separate single-precision and double-precision instructions for each operation, so there is no equivalent for SSE/AVX code. This can change how results are rounded when the result of a floating-point operation is used directly in further calculation instead of assigning it to a user variable. Consider the following:
+Floating-point operations are normally rounded to double-precision (64-bit) in x87 code, but you can use `_controlfp` to modify the FP control word, including setting the precision control to extended precision (80-bit) or single-precision (32-bit). For more information, see [`_control87`, `_controlfp`, `__control87_2`](../../c-runtime-library/reference/control87-controlfp-control87-2.md). SSE and AVX have separate single-precision and double-precision instructions for each operation, so there's no equivalent for SSE/AVX code. It can change how results are rounded when the result of a floating-point operation is used directly in further calculation instead of assigning it to a user variable. Consider the following operations:
```cpp
r = f1 * f2 + d; // Different results are possible on SSE/SSE2.
@@ -72,7 +76,7 @@ r = t + d; // This should produce the same overall result
// whether x87 stack is used or SSE/SSE2 is used.
```
-**/arch** and [/QIfist](qifist-suppress-ftol.md) cannot be used on the same compiland. The **/QIfist** option changes the rounding behavior of floating-point to integer conversion. The default behavior is to truncate (round toward zero), whereas the **/QIfist** option specifies use of the floating-point environment rounding mode. Because this changes the behavior of all floating-point to integer conversions, this flag has been deprecated. When compiling for SSE or AVX you can round a floating-point value to an integer using the floating-point environment rounding mode by using an intrinsic function sequence:
+**`/arch`** and [`/QIfist`](qifist-suppress-ftol.md) can't be used together. The **`/QIfist`** option changes the rounding behavior of floating-point to integer conversion. The default behavior is to truncate (round toward zero), whereas the **`/QIfist`** option specifies use of the [floating-point environment](fp-specify-floating-point-behavior.md) rounding mode. Because the option changes the behavior of all floating-point to integer conversions, **`/QIfist`** is deprecated. When compiling for SSE or AVX, you can round a floating-point value to an integer using the floating-point environment rounding mode by using an intrinsic function sequence:
```cpp
int convert_float_to_int(float x) {
@@ -84,9 +88,9 @@ int convert_double_to_int(double x) {
}
```
-The `_M_IX86_FP`, `__AVX__`, `__AVX2__`, `__AVX512F__`, `__AVX512CD__`, `__AVX512BW__`, `__AVX512DQ__` and `__AVX512VL__` macros indicate which, if any, **/arch** compiler option was used. For more information, see [Predefined Macros](../../preprocessor/predefined-macros.md). The **/arch:AVX2** option and `__AVX2__` macro were introduced in Visual Studio 2013 Update 2, version 12.0.34567.1. Limited support for **/arch:AVX512** was added in Visual Studio 2017, and expanded in Visual Studio 2019.
+The `_M_IX86_FP`, `__AVX__`, `__AVX2__`, `__AVX512F__`, `__AVX512CD__`, `__AVX512BW__`, `__AVX512DQ__`, `__AVX512VL__`, and `__AVX10_VER__` macros indicate which, if any, **`/arch`** compiler option was used. For more information, see [Predefined macros](../../preprocessor/predefined-macros.md). The **`/arch:AVX2`** option, and `__AVX2__` macro were introduced in Visual Studio 2013 Update 2, version 12.0.34567.1. Limited support for **`/arch:AVX512`** was added in Visual Studio 2017, and expanded in Visual Studio 2019. Support for **`/arch:AVX10.1`** was added in Visual Studio 2022.
-### To set this compiler option for AVX, AVX2, AVX512, IA32, SSE, or SSE2 in Visual Studio
+### To set the `/arch` compiler option in Visual Studio
1. Open the **Property Pages** dialog box for the project. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
@@ -100,6 +104,6 @@ The `_M_IX86_FP`, `__AVX__`, `__AVX2__`, `__AVX512F__`, `__AVX512CD__`, `__AVX51
## See also
-[/arch (Minimum CPU Architecture)](arch-minimum-cpu-architecture.md)
-[MSVC Compiler Options](compiler-options.md)
-[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
+[`/arch` (Minimum CPU Architecture)](arch-minimum-cpu-architecture.md)\
+[MSVC compiler options](compiler-options.md)\
+[MSVC compiler command-line syntax](compiler-command-line-syntax.md)
diff --git a/docs/build/reference/arm64-function-pad-min-x64.md b/docs/build/reference/arm64-function-pad-min-x64.md
new file mode 100644
index 0000000000..28fabf8505
--- /dev/null
+++ b/docs/build/reference/arm64-function-pad-min-x64.md
@@ -0,0 +1,43 @@
+---
+description: "Learn more about: /ARM64XFUNCTIONPADMINX64 (Minimum padding between x64 functions in an ARM64X image)"
+title: "/ARM64XFUNCTIONPADMINX64 (Minimum x64 function padding)"
+ms.date: 01/08/2024
+helpviewer_keywords: ["/ARM64XFUNCTIONPADMINX64 linker option", "-ARM64XFUNCTIONPADMINX64 linker option", "ARM64XFUNCTIONPADMINX64 linker option"]
+---
+# /ARM64XFUNCTIONPADMINX64 (Minimum x64 function padding)
+
+Specifies the minimum number of bytes of padding between x64 functions in ARM64X images.
+
+## Syntax
+
+```
+/ARM64XFUNCTIONPADMINX64:[number]
+```
+
+## Arguments
+
+*number*\
+The minimum number of bytes of padding between x64 functions.
+
+## Remarks
+
+This switch ensures that there is at least as much padding between X64 functions in an ARM64X image as specified. There may be more padding to meet architecture alignment requirements.
+
+This flag is available in Visual Studio 17.8 and later.
+
+### To set this linker option in the Visual Studio development environment
+
+1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
+1. Modify the **Additional Options** property to include **/ARM64XFUNCTIONPADMINX64:**`number`, where `number` is the minimum number of bytes of padding to put between x64 functions, and then choose **OK**.
+
+### To set this linker option programmatically
+
+- See .
+
+## See also
+
+[`/FUNCTIONPADMIN` (Create hotpatchable image)](../reference/functionpadmin-create-hotpatchable-image.md)\
+[`/NOFUNCTIONPADSECTION`](no-function-pad-section.md)\
+[MSVC Linker Options](linker-options.md)\
+[MSVC linker reference](linking.md)
diff --git a/docs/build/reference/assemblydebug-add-debuggableattribute.md b/docs/build/reference/assemblydebug-add-debuggableattribute.md
index 62c71671dc..fb77f5d492 100644
--- a/docs/build/reference/assemblydebug-add-debuggableattribute.md
+++ b/docs/build/reference/assemblydebug-add-debuggableattribute.md
@@ -1,56 +1,58 @@
---
description: "Learn more about: /ASSEMBLYDEBUG (Add DebuggableAttribute)"
title: "/ASSEMBLYDEBUG (Add DebuggableAttribute)"
-ms.date: "11/04/2016"
+ms.date: 05/11/2022
f1_keywords: ["VC.Project.VCLinkerTool.AssemblyDebug", "/ASSEMBLYDEBUG"]
helpviewer_keywords: ["/ASSEMBLYDEBUG linker option", "-ASSEMBLYDEBUG linker option", "ASSEMBLYDEBUG linker option"]
ms.assetid: 94443af3-470c-41d7-83a0-7434563d7982
---
-# /ASSEMBLYDEBUG (Add DebuggableAttribute)
+# `/ASSEMBLYDEBUG` (Add DebuggableAttribute)
-```
-/ASSEMBLYDEBUG[:DISABLE]
-```
+Specify whether to emit the `DebuggableAttribute` attribute with debug information tracking and to disable JIT optimizations.
-/ASSEMBLYDEBUG emits the **DebuggableAttribute** attribute with debug information tracking and disables JIT optimizations. This is the same as specifying the following attribute in source:
+## Syntax
-```
+> **`/ASSEMBLYDEBUG`**\[**`:DISABLE`**]
+
+## Remarks
+
+The **`/ASSEMBLYDEBUG`** linker option emits the `DebuggableAttribute` attribute with debug information tracking and disables JIT optimizations. This option is the same as specifying the following attribute in source:
+
+```cpp
[assembly:Debuggable(true, true)]; // same as /ASSEMBLYDEBUG
```
-/ASSEMBLYDEBUG:DISABLE emits the **DebuggableAttribute** attribute but disables the tracking of debug information and enables JIT optimizations. This is the same as specifying the following attribute in source:
+**`/ASSEMBLYDEBUG:DISABLE`** emits the `DebuggableAttribute` attribute but disables the tracking of debug information and enables JIT optimizations. This option is the same as specifying the following attribute in source:
-```
+```cpp
[assembly:Debuggable(false, false)]; // same as /ASSEMBLYDEBUG:DISABLE
```
-The default is to not emit the **DebuggableAttribute** attribute.
+By default, the linker doesn't emit the `DebuggableAttribute` attribute.
-DebuggableAttribute can also be added to an assembly directly in source code. For example,
+`DebuggableAttribute` can also be added to an assembly directly in source code. For example:
-```
+```cpp
[assembly:Debuggable(true, true)]; // same as /ASSEMBLYDEBUG
```
-## Remarks
-
-It is necessary to explicitly specify that a managed image be debuggable. Using [/Zi](z7-zi-zi-debug-information-format.md) alone is not sufficient.
+You must explicitly specify that a managed image is debuggable. The [`/Zi`](z7-zi-zi-debug-information-format.md) option alone is insufficient.
Other linker options that affect assembly generation are:
-- [/ASSEMBLYLINKRESOURCE](assemblylinkresource-link-to-dotnet-framework-resource.md)
+- [`/ASSEMBLYLINKRESOURCE`](assemblylinkresource-link-to-dotnet-framework-resource.md)
-- [/ASSEMBLYMODULE](assemblymodule-add-a-msil-module-to-the-assembly.md)
+- [`/ASSEMBLYMODULE`](assemblymodule-add-a-msil-module-to-the-assembly.md)
-- [/ASSEMBLYRESOURCE](assemblyresource-embed-a-managed-resource.md)
+- [`/ASSEMBLYRESOURCE`](assemblyresource-embed-a-managed-resource.md)
-- [/DELAYSIGN](delaysign-partially-sign-an-assembly.md)
+- [`/DELAYSIGN`](delaysign-partially-sign-an-assembly.md)
-- [/KEYCONTAINER](keycontainer-specify-a-key-container-to-sign-an-assembly.md)
+- [`/KEYCONTAINER`](keycontainer-specify-a-key-container-to-sign-an-assembly.md)
-- [/KEYFILE](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md)
+- [`/KEYFILE`](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md)
-- [/NOASSEMBLY](noassembly-create-a-msil-module.md)
+- [`/NOASSEMBLY`](noassembly-create-a-msil-module.md)
### To set this linker option in the Visual Studio development environment
@@ -66,5 +68,5 @@ Other linker options that affect assembly generation are:
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/assemblylinkresource-link-to-dotnet-framework-resource.md b/docs/build/reference/assemblylinkresource-link-to-dotnet-framework-resource.md
index 8a36b426db..bb0cd45a3f 100644
--- a/docs/build/reference/assemblylinkresource-link-to-dotnet-framework-resource.md
+++ b/docs/build/reference/assemblylinkresource-link-to-dotnet-framework-resource.md
@@ -1,49 +1,51 @@
---
-description: "Learn more about: /ASSEMBLYLINKRESOURCE (Link to .NET Framework Resource)"
-title: "/ASSEMBLYLINKRESOURCE (Link to .NET Framework Resource)"
-ms.date: "11/04/2016"
+description: "Learn more about: /ASSEMBLYLINKRESOURCE (Link to .NET Framework resource)"
+title: "/ASSEMBLYLINKRESOURCE (Link to .NET Framework resource)"
+ms.date: 05/11/2022
f1_keywords: ["/ASSEMBLYLINKRESOURCE", "VC.Project.VCLinkerTool.AssemblyLinkResource"]
helpviewer_keywords: ["-ASSEMBLYLINKRESOURCE linker option", "ASSEMBLYLINKRESOURCE linker option", "/ASSEMBLYLINKRESOURCE linker option"]
ms.assetid: 8b6ad184-1b33-47a4-8513-4803cf915b64
---
-# /ASSEMBLYLINKRESOURCE (Link to .NET Framework Resource)
+# `/ASSEMBLYLINKRESOURCE` (Link to .NET Framework resource)
-```
-/ASSEMBLYLINKRESOURCE:filename
-```
+Create a link to a .NET Framework resource in the output file.
+
+## Syntax
+
+> **`/ASSEMBLYLINKRESOURCE:`*`filename`***
## Arguments
-*filename*
-The .NET Framework resource file to which you want to link from the assembly.
+*`filename`*
+The .NET Framework resource file to link from the assembly.
## Remarks
-The /ASSEMBLYLINKRESOURCE option creates a link to a .NET Framework resource in the output file; the resource file is not placed in the output file. [/ASSEMBLYRESOURCE](assemblyresource-embed-a-managed-resource.md) embeds a resource file in the output file.
+The **`/ASSEMBLYLINKRESOURCE`** linker option creates a link to a .NET Framework resource in the output file. The resource file isn't placed in the output file. Use the [`/ASSEMBLYRESOURCE`](assemblyresource-embed-a-managed-resource.md) option to embed a resource file in the output file.
Linked resources are public in the assembly when created with the linker.
-/ASSEMBLYLINKRESOURCE requires that the compilation include [/clr](clr-common-language-runtime-compilation.md); [/LN](ln-create-msil-module.md) or [/NOASSEMBLY](noassembly-create-a-msil-module.md) is not allowed with /ASSEMBLYLINKRESOURCE.
+**`/ASSEMBLYLINKRESOURCE`** requires the [`/clr`](clr-common-language-runtime-compilation.md) compiler option. The [`/LN`](ln-create-msil-module.md) or [`/NOASSEMBLY`](noassembly-create-a-msil-module.md) options aren't allowed with **`/ASSEMBLYLINKRESOURCE`**.
-If *filename* is a .NET Framework resource file created, for example, by [Resgen.exe](/dotnet/framework/tools/resgen-exe-resource-file-generator) or in the development environment, it can be accessed with members in the **System.Resources** namespace. For more information, see [System.Resources.ResourceManager](/dotnet/api/system.resources.resourcemanager). For all other resources, use the **GetManifestResource**\* methods in the **System.Reflection.Assembly** class to access the resource at run time.
+If *`filename`* is a .NET Framework resource file that's created, for example, by [`Resgen.exe`](/dotnet/framework/tools/resgen-exe-resource-file-generator) or in the development environment, it can be accessed with members in the `System.Resources` namespace. For more information, see [`System.Resources.ResourceManager`](/dotnet/api/system.resources.resourcemanager). For all other resources, use the `GetManifestResource*` methods in the `System.Reflection.Assembly` class to access the resource at run time.
-*filename* can be any file format. For example, you may want to make a native DLL part of the assembly, so it can be installed into the Global Assembly Cache and accessed from managed code in the assembly.
+*`filename`* can have any file format. For example, you may want to make a native DLL part of the assembly. Then it can be installed into the Global Assembly Cache and accessed from managed code in the assembly.
Other linker options that affect assembly generation are:
-- [/ASSEMBLYDEBUG](assemblydebug-add-debuggableattribute.md)
+- [`/ASSEMBLYDEBUG`](assemblydebug-add-debuggableattribute.md)
-- [/ASSEMBLYMODULE](assemblymodule-add-a-msil-module-to-the-assembly.md)
+- [`/ASSEMBLYMODULE`](assemblymodule-add-a-msil-module-to-the-assembly.md)
-- [/ASSEMBLYRESOURCE](assemblyresource-embed-a-managed-resource.md)
+- [`/ASSEMBLYRESOURCE`](assemblyresource-embed-a-managed-resource.md)
-- [/DELAYSIGN](delaysign-partially-sign-an-assembly.md)
+- [`/DELAYSIGN`](delaysign-partially-sign-an-assembly.md)
-- [/KEYCONTAINER](keycontainer-specify-a-key-container-to-sign-an-assembly.md)
+- [`/KEYCONTAINER`](keycontainer-specify-a-key-container-to-sign-an-assembly.md)
-- [/KEYFILE](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md)
+- [`/KEYFILE`](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md)
-- [/NOASSEMBLY](noassembly-create-a-msil-module.md)
+- [`/NOASSEMBLY`](noassembly-create-a-msil-module.md)
### To set this linker option in the Visual Studio development environment
@@ -51,7 +53,7 @@ Other linker options that affect assembly generation are:
1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
-1. Type the option into the **Additional Options** box.
+1. Enter the option in **Additional Options**. Choose **OK** or **Apply** to apply the change.
### To set this linker option programmatically
@@ -59,5 +61,5 @@ Other linker options that affect assembly generation are:
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/assemblymodule-add-a-msil-module-to-the-assembly.md b/docs/build/reference/assemblymodule-add-a-msil-module-to-the-assembly.md
index 59423c6bbc..60b001d27d 100644
--- a/docs/build/reference/assemblymodule-add-a-msil-module-to-the-assembly.md
+++ b/docs/build/reference/assemblymodule-add-a-msil-module-to-the-assembly.md
@@ -1,53 +1,53 @@
---
-description: "Learn more about: /ASSEMBLYMODULE (Add a MSIL Module to the Assembly)"
-title: "/ASSEMBLYMODULE (Add a MSIL Module to the Assembly)"
-ms.date: "11/04/2016"
+description: "Learn more about: /ASSEMBLYMODULE (Add an MSIL module to the assembly)"
+title: "/ASSEMBLYMODULE (Add an MSIL module to the assembly)"
+ms.date: 05/11/2022
f1_keywords: ["/assemblymodule", "VC.Project.VCLinkerTool.AddModuleNamesToAssembly"]
helpviewer_keywords: ["ASSEMBLYMODULE linker option", "assemblies [C++], adding modules to", "assemblies [C++]", "/ASSEMBLYMODULE linker option", "-ASSEMBLYMODULE linker option"]
ms.assetid: 67357da8-e4b6-49fd-932c-329a5777f143
---
-# /ASSEMBLYMODULE (Add a MSIL Module to the Assembly)
+# `/ASSEMBLYMODULE` (Add an MSIL module to the assembly)
-```
-/ASSEMBLYMODULE:filename
-```
+## Syntax
-## Arguments
+> **`/ASSEMBLYMODULE:`*`filename`***
-*filename*
+### Arguments
+
+*`filename`*\
The module you want to include in this assembly.
## Remarks
-The /ASSEMBLYMODULE option allows you to add a module reference to an assembly. Type information in the module will not be available to the assembly program that added the module reference. However, type information in the module will be available to any program that references the assembly.
+The **`/ASSEMBLYMODULE`** linker option allows you to add a module reference to an assembly. Type information in the module won't be available to the assembly program that added the module reference. However, type information in the module will be available to any program that references the assembly.
-Use [#using](../../preprocessor/hash-using-directive-cpp.md) to both add a module reference to an assembly and make the module's type information available to the assembly program.
+Use [`#using`](../../preprocessor/hash-using-directive-cpp.md) to both add a module reference to an assembly and make the module's type information available to the assembly program.
For example, consider the following scenario:
-1. Create a module with [/LN](ln-create-msil-module.md).
+1. Create a module with [`/LN`](ln-create-msil-module.md).
-1. Use /ASSEMBLYMODULE in a different project to include the module in the current compilation, which will create an assembly. This project will not reference the module with `#using`.
+1. Use **`/ASSEMBLYMODULE`** in a different project to include the module in the current compilation, which creates an assembly. This project won't reference the module with `#using`.
1. Any project that references this assembly can now also use types from the module.
Other linker options that affect assembly generation are:
-- [/ASSEMBLYDEBUG](assemblydebug-add-debuggableattribute.md)
+- [`/ASSEMBLYDEBUG`](assemblydebug-add-debuggableattribute.md)
-- [/ASSEMBLYLINKRESOURCE](assemblylinkresource-link-to-dotnet-framework-resource.md)
+- [`/ASSEMBLYLINKRESOURCE`](assemblylinkresource-link-to-dotnet-framework-resource.md)
-- [/ASSEMBLYRESOURCE](assemblyresource-embed-a-managed-resource.md)
+- [`/ASSEMBLYRESOURCE`](assemblyresource-embed-a-managed-resource.md)
-- [/DELAYSIGN](delaysign-partially-sign-an-assembly.md)
+- [`/DELAYSIGN`](delaysign-partially-sign-an-assembly.md)
-- [/NOASSEMBLY](noassembly-create-a-msil-module.md)
+- [`/NOASSEMBLY`](noassembly-create-a-msil-module.md)
-- [/KEYFILE](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md)
+- [`/KEYFILE`](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md)
-- [/KEYCONTAINER](keycontainer-specify-a-key-container-to-sign-an-assembly.md)
+- [`/KEYCONTAINER`](keycontainer-specify-a-key-container-to-sign-an-assembly.md)
-The MSVC linker accepts .netmodule files as input and the output file produced by the linker will be an assembly or .netmodule with no run-time dependence on any of the .netmodules that were input to the linker. For more information, see [.netmodule Files as Linker Input](netmodule-files-as-linker-input.md).
+The MSVC linker accepts *`.netmodule`* files as input and the output file produced by the linker will be an assembly or *`.netmodule`* file with no run-time dependence on any of the *`.netmodule`* files that were input to the linker. For more information, see [`.netmodule` files as linker input](netmodule-files-as-linker-input.md).
### To set this linker option in the Visual Studio development environment
@@ -63,5 +63,5 @@ The MSVC linker accepts .netmodule files as input and the output file produced b
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/assemblyresource-embed-a-managed-resource.md b/docs/build/reference/assemblyresource-embed-a-managed-resource.md
index ee50a4984d..c21d423109 100644
--- a/docs/build/reference/assemblyresource-embed-a-managed-resource.md
+++ b/docs/build/reference/assemblyresource-embed-a-managed-resource.md
@@ -1,50 +1,52 @@
---
-description: "Learn more about: /ASSEMBLYRESOURCE (Embed a Managed Resource)"
-title: "/ASSEMBLYRESOURCE (Embed a Managed Resource)"
-ms.date: "11/04/2016"
+description: "Learn more about: /ASSEMBLYRESOURCE (Embed a managed resource)"
+title: "/ASSEMBLYRESOURCE (Embed a managed resource)"
+ms.date: 05/11/2022
f1_keywords: ["VC.Project.VCLinkerTool.EmbedManagedResourceFile", "/ASSEMBLYRESOURCE"]
helpviewer_keywords: ["ASSEMBLYRESOURCE linker option", "assemblies [C++]", "-ASSEMBLYRESOURCE linker option", "assemblies [C++], linking resource files", "/ASSEMBLYRESOURCE linker option"]
ms.assetid: 0ce6e1fb-921b-4b1b-a59c-d35388d789f2
---
-# /ASSEMBLYRESOURCE (Embed a Managed Resource)
+# `/ASSEMBLYRESOURCE` (Embed a managed resource)
-```
-/ASSEMBLYRESOURCE:filename[,[name][,PRIVATE]]
-```
+Embeds a managed resource in an assembly.
-## Parameters
+## Syntax
-*filename*
+> **`/ASSEMBLYRESOURCE:`*`filename`***\[**`,`**\[***`name`***]\[**`,PRIVATE`**]]
+
+## Arguments
+
+*`filename`*\
The managed resource you want to embed in this assembly.
-*name*
+*`name`*\
Optional. The logical name for the resource; the name used to load the resource. The default is the name of the file.
-Optionally, you can specify if the file should be private in the assembly manifest. By default, *name* is public in the assembly.
+Optionally, you can use `PRIVATE` to specify if the file should be private in the assembly manifest. By default, *`name`* is public in the assembly.
## Remarks
-Use the /ASSEMBLYRESOURCE option to embed a resource in an assembly.
+Use the **`/ASSEMBLYRESOURCE`** linker option to embed a resource in an assembly.
-Resources are public in the assembly when created with the linker. The linker does not allow you to rename the resource in the assembly.
+Resources are public in the assembly when created with the linker. The linker doesn't allow you to rename the resource in the assembly.
-If *filename* is a .NET Framework resource (.resources) file created, for example, by the [Resource File Generator (Resgen.exe)](/dotnet/framework/tools/resgen-exe-resource-file-generator) or in the development environment, it can be accessed with members in the **System.Resources** namespace (see [System.Resources.ResourceManager](/dotnet/api/system.resources.resourcemanager) for more information). For all other resources, use the **GetManifestResource**\* methods in **System.Reflection.Assembly** class to access the resource at run time.
+If *`filename`* is a .NET Framework resource (*`.resources`*) file created, for example, by the [Resource file generator (`Resgen.exe`)](/dotnet/framework/tools/resgen-exe-resource-file-generator) or in the development environment, it can be accessed with members in the `System.Resources` namespace. For more information, see [`System.Resources.ResourceManager`](/dotnet/api/system.resources.resourcemanager). For all other resources, use the `GetManifestResource*` methods in the `System.Reflection.Assembly` class to access the resource at run time.
Other linker options that affect assembly generation are:
-- [/ASSEMBLYDEBUG](assemblydebug-add-debuggableattribute.md)
+- [`/ASSEMBLYDEBUG`](assemblydebug-add-debuggableattribute.md)
-- [/ASSEMBLYLINKRESOURCE](assemblylinkresource-link-to-dotnet-framework-resource.md)
+- [`/ASSEMBLYLINKRESOURCE`](assemblylinkresource-link-to-dotnet-framework-resource.md)
-- [/ASSEMBLYMODULE](assemblymodule-add-a-msil-module-to-the-assembly.md)
+- [`/ASSEMBLYMODULE`](assemblymodule-add-a-msil-module-to-the-assembly.md)
-- [/DELAYSIGN](delaysign-partially-sign-an-assembly.md)
+- [`/DELAYSIGN`](delaysign-partially-sign-an-assembly.md)
-- [/KEYFILE](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md)
+- [`/KEYFILE`](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md)
-- [/KEYCONTAINER](keycontainer-specify-a-key-container-to-sign-an-assembly.md)
+- [`/KEYCONTAINER`](keycontainer-specify-a-key-container-to-sign-an-assembly.md)
-- [/NOASSEMBLY](noassembly-create-a-msil-module.md)
+- [`/NOASSEMBLY`](noassembly-create-a-msil-module.md)
### To set this linker option in the Visual Studio development environment
@@ -60,5 +62,5 @@ Other linker options that affect assembly generation are:
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/at-specify-a-linker-response-file.md b/docs/build/reference/at-specify-a-linker-response-file.md
index db8b195c3c..b72b81d9d8 100644
--- a/docs/build/reference/at-specify-a-linker-response-file.md
+++ b/docs/build/reference/at-specify-a-linker-response-file.md
@@ -1,37 +1,37 @@
---
-description: "Learn more about: @ (Specify a Linker Response File)"
-title: "@ (Specify a Linker Response File)"
-ms.date: "09/05/2018"
+description: "Learn more about: @ (Specify a linker response file)"
+title: "@ (Specify a linker response file)"
+ms.date: 05/11/2022
f1_keywords: ["@"]
helpviewer_keywords: ["linker [C++], response files", "command files [C++]", "command files [C++], linker response file", "@ linker option", "response files, C/C++ linker"]
ms.assetid: 5530014f-17d0-4f6b-a6b0-a6ba34f34cfd
---
-# @ (Specify a Linker Response File)
+# `@` (Specify a linker response file)
Specifies a linker response file.
## Syntax
-> **\@**response_file
+> **`@`** *`response_file`*
## Arguments
-*response_file*
-A text file specifying linker commands.
+*`response_file`*\
+A text file that contains linker commands.
## Remarks
-See [@ (Specify a Compiler Response File)](at-specify-a-compiler-response-file.md) for more information.
+For more information, see [`@` (Specify a compiler response file)](at-specify-a-compiler-response-file.md).
### To set this linker option in the Visual Studio development environment
-- This linker option is not available from the Visual Studio development environment.
+- This linker option isn't available from the Visual Studio development environment.
### To set this linker option programmatically
-- This linker option cannot be changed programmatically.
+- This linker option can't be changed programmatically.
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/atl-program-or-control-source-and-header-files.md b/docs/build/reference/atl-program-or-control-source-and-header-files.md
index 827a02bd71..5057444504 100644
--- a/docs/build/reference/atl-program-or-control-source-and-header-files.md
+++ b/docs/build/reference/atl-program-or-control-source-and-header-files.md
@@ -1,26 +1,60 @@
---
-description: "Learn more about: ATL Program or Control Source and Header Files"
-title: "ATL Program or Control Source and Header Files"
-ms.date: "11/04/2016"
+description: "Learn more about: ATL program or control source and header files"
+title: "ATL program or control source and header files"
+ms.date: 09/27/2022
helpviewer_keywords: ["file types [C++], ATL source and headers"]
ms.assetid: cb65372f-4880-4007-b582-a52eaa568fd1
---
-# ATL Program or Control Source and Header Files
+# ATL program or control source and header files
-The following files are created when you create an ATL project in Visual Studio, depending on the options you select for the project you create.
+The following files are created when you create an ATL project in Visual Studio, depending on the options you select for the project you create. The file names depend on the name you choose for your project, which we'll call *`ProjectName`*.
-All of these files are located in the *Projname* directory, and in either the Header Files (.h files) folder or Source Files (.cpp files) folder in Solution Explorer.
+All of the files created by the project template are located in the *`ProjectName`* and *`ProjectNamePS`* project directories. In Solution Explorer, the *`ProjectName`* files are located in the **Generated Files**, **Header Files**, **Resource Files**, and **Source Files** folders. The *`ProjectNamePS`* files are in the **Generated Files** and **Source Files** folders. Not all files listed here are generated for every project type. Files in the **Generated Files** folder are generated automatically by the MIDL compiler; they shouldn't be edited directly.
-|File name|Description|
-|---------------|-----------------|
-|*Projname*.h|The main include file containing the C++ interface definitions and GUID declarations of the items defined in ATLSample.idl. It is regenerated by MIDL during compilation.|
-|*Projname*.cpp|The main program source file. It contains the implementation of your DLL's exports for an in-process server and the implementation of `WinMain` for a local server. For a service, this additionally implements all the service management functions.|
-|Resource.h|The header file for the resource file.|
-|StdAfx.cpp|Includes the files StdAfx.h and Atlimpl.cpp.|
-|StdAfx.h|Includes the ATL header files.|
+::: moniker range=">=msvc-150"
+
+| File name | Description |
+|--|--|
+| *`ProjectName_i.c`* | The generated source file containing the C++ IID and CLSID definitions and GUID declarations of the items defined in *`ProjectName.idl`*. Don't edit this file; it's regenerated by MIDL during compilation. Link this file with the server and any clients. |
+| *`ProjectName_i.h`* | The generated include file containing the C++ interface declarations and GUID declarations of the items defined in *`ProjectName.idl`*. Don't edit this file; it's regenerated by MIDL during compilation. Include this file in source files for the server and any clients. |
+| *`ProjectName.rc`* | The main program resource file. |
+| *`ProjectName.rgs`* | The main program registration file. |
+| *`ProjectName.cpp`* | The main program source file. In DLL projects, it contains the implementation of your DLL's exports for an in-process server. In EXE projects, it contains the implementation of `WinMain` for a local server. For a service, this file implements all the service management functions. |
+| *`ProjectName.def`* | In DLL projects, the definitions for your DLL's exports. |
+| *`ProjectName.idl`* | The IDL source for your project. The MIDL tool processes this file to produce the type library (*`.tlb`*) and marshaling code. |
+| *`framework.h`* | Sets preprocessor macros and includes the ATL header files, the *`targetver.h`* version support header, and the *`Resource.h`* resource file header. |
+| *`dllmain.h`* | In DLL projects, the header file for the module class. |
+| *`dllmain.cpp`* | In DLL projects, the source file for the `DllMain` function. |
+| *`Resource.h`* | The header file for the resource file. |
+| *`targetver.h`* | Includes *`SDKDDKVer.h`*. To build your application for a previous Windows platform, include *`WinSDKVer.h`* and set the `_WIN32_WINNT` macro to the platform you wish to support before including *`SDKDDKVer.h`*. |
+| *`pch.cpp`* | Includes the file *`pch.h`*. |
+| *`pch.h`* | Includes the *`framework.h`* header file. |
+
+::: moniker-end
+
+::: moniker range="msvc-140"
+
+| File name | Description |
+|--|--|
+| *`ProjectName_i.c`* | The generated source file containing the C++ IID and CLSID definitions and GUID declarations of the items defined in *`ProjectName.idl`*. Don't edit this file; it's regenerated by MIDL during compilation. Link this file with the server and any clients. |
+| *`ProjectName_i.h`* | The generated include file containing the C++ interface declarations and GUID declarations of the items defined in *`ProjectName.idl`*. Don't edit this file; it's regenerated by MIDL during compilation. Include this file in source files for the server and any clients. |
+| *`ProjectName.rc`* | The main program resource file. |
+| *`ProjectName.rgs`* | The main program registration file. |
+| *`ProjectName.cpp`* | The main program source file. In DLL projects, it contains the implementation of your DLL's exports for an in-process server. In EXE projects, it contains the implementation of `WinMain` for a local server. For a service, this file implements all the service management functions. |
+| *`ProjectName.def`* | In DLL projects, the definitions for your DLL's exports. |
+| *`ProjectName.idl`* | The IDL source for your project. The MIDL tool processes this file to produce the type library (*`.tlb`*) and marshaling code. |
+| *`dllmain.h`* | In DLL projects, the header file for the module class. |
+| *`dllmain.cpp`* | In DLL projects, the source file for the `DllMain` function. |
+| *`resource.h`* | The header file for the resource file. |
+| *`targetver.h`* | Includes *`SDKDDKVer.h`*. To build your application for a previous Windows platform, include *`WinSDKVer.h`* and set the `_WIN32_WINNT` macro to the platform you wish to support before including *`SDKDDKVer.h`*. |
+| *`stdafx.cpp`* | Includes the file *`stdafx.h`*. |
+| *`stdafx.h`* | Sets preprocessor macros and includes the ATL header files, the *`targetver.h`* version support header, and the *`resource.h`* resource file header. |
+
+::: moniker-end
## See also
-[File Types Created for Visual Studio C++ projects](file-types-created-for-visual-cpp-projects.md)
-[MFC Program or Control Source and Header Files](mfc-program-or-control-source-and-header-files.md)
-[CLR Projects](files-created-for-clr-projects.md)
+[File types created for Visual Studio C++ projects](file-types-created-for-visual-cpp-projects.md)\
+[MFC program or control source and header files](mfc-program-or-control-source-and-header-files.md)\
+[Add ATL support to an existing MFC executable or DLL](../../mfc/reference/adding-atl-support-to-your-mfc-project.md)\
+[CLR projects](files-created-for-clr-projects.md)
diff --git a/docs/build/reference/base-base-address.md b/docs/build/reference/base-base-address.md
index e6d026d383..1728032bac 100644
--- a/docs/build/reference/base-base-address.md
+++ b/docs/build/reference/base-base-address.md
@@ -1,54 +1,51 @@
---
-description: "Learn more about: /BASE (Base Address)"
-title: "/BASE (Base Address)"
-ms.date: "09/05/2018"
+description: "Learn more about: /BASE (Base address)"
+title: "/BASE (Base address)"
+ms.date: 03/27/2025
f1_keywords: ["/base", "VC.Project.VCLinkerTool.BaseAddress"]
helpviewer_keywords: ["base addresses [C++]", "programs [C++], preventing relocation", "semicolon [C++], specifier", "-BASE linker option", "key address size", "environment variables [C++], LIB", "programs [C++], base address", "LIB environment variable", "BASE linker option", "DLLs [C++], linking", "/BASE linker option", "@ symbol for base address", "executable files [C++], base address", "at sign symbol for base address"]
-ms.assetid: 00b9f6fe-0bd2-4772-a69c-7365eb199069
---
-# /BASE (Base Address)
+# `/BASE` (Base address)
Specifies the base address for a program.
## Syntax
-> **/BASE:**{*address*[**,**size] | **\@**filename**,**key}
+> **`/BASE:`**{*`address`*[**`,`***`size`*] | **`@`***`filename`***`,`***`key`*}
## Remarks
> [!NOTE]
-> For security reasons, Microsoft recommends you use the [/DYNAMICBASE](dynamicbase-use-address-space-layout-randomization.md) option instead of specifying base addresses for your executables. This generates an executable image that can be randomly rebased at load time by using the address space layout randomization (ASLR) feature of Windows. The /DYNAMICBASE option is on by default.
+> For security reasons, Microsoft recommends you use the [`/DYNAMICBASE`](dynamicbase-use-address-space-layout-randomization.md) option instead of specifying base addresses for your executables. **`/DYNAMICBASE`** generates an executable image that can be randomly rebased at load time by using the address space layout randomization (ASLR) feature of Windows. The **`/DYNAMICBASE`** option is on by default.
-The /BASE option sets a base address for the program, overriding the default location for an .exe or DLL file. The default base address for an .exe file is 0x400000 for 32-bit images or 0x140000000 for 64-bit images. For a DLL, the default base address is 0x10000000 for 32-bit images or 0x180000000 for 64-bit images. On operating systems that do not support address space layout randomization (ASLR), or when the /DYNAMICBASE:NO option was set, the operating system first attempts to load a program at its specified or default base address. If sufficient space is not available there, the system relocates the program. To prevent relocation, use the [/FIXED](fixed-fixed-base-address.md) option.
+The **`/BASE`** linker option sets a base address for the program. It overrides the default location for an EXE or DLL file. The default base address for an EXE file is 0x400000 for 32-bit images or 0x140000000 for 64-bit images. For a DLL, the default base address is 0x10000000 for 32-bit images or 0x180000000 for 64-bit images. On operating systems that don't support address space layout randomization (ASLR), or when the **`/DYNAMICBASE:NO`** option was set, the operating system first attempts to load a program at its specified or default base address. If insufficient space is available there, the system relocates the program. To prevent relocation, use the [`/FIXED`](fixed-fixed-base-address.md) option.
-The linker issues an error if *address* is not a multiple of 64K. You can optionally specify the size of the program; the linker issues a warning if the program can't fit in the size you specified.
+The linker issues an error if *`address`* isn't a multiple of 64K. You can optionally specify the size of the program. The linker issues a warning if the program can't fit in the size you specified.
-On the command line, another way to specify the base address is by using a base address response file. A base address response file is a text file that contains the base addresses and optional sizes of all the DLLs your program will use, and a unique text key for each base address. To specify a base address by using a response file, use an at sign (**\@**) followed by the name of the response file, *filename*, followed by a comma, then the *key* value for the base address to use in the file. The linker looks for *filename* in either the specified path, or if no path is specified, in the directories specified in the LIB environment variable. Each line in *filename* represents one DLL and has the following syntax:
+On the command line, another way to specify the base address is by using a *base address response file*. A base address response file is a text file that contains the base addresses and optional sizes of all the DLLs your program uses, and a unique text key for each base address. To specify a base address by using a response file, use an at sign (**`@`**) followed by the name of the response file, *`filename`*, followed by a comma, then the *`key`* value for the base address to use in the file. The linker looks for *`filename`* in either the specified path, or if no path is specified, in the directories specified in the `LIB` environment variable. The fully qualified *`filename`* must not exceed `MAX_PATH` (260 characters). Each line in *`filename`* represents one DLL and has the following syntax:
-> *key* *address* [*size*] **;** *comment*
+> *`key`* *`address`* \[*`size`*] **`;`** *`comment`*
-The *key* is a string of alphanumeric characters and is not case sensitive. It is usually the name of a DLL, but it need not be. The *key* is followed by a base *address* in C-language, hexadecimal, or decimal notation and an optional maximum *size*. All three arguments are separated by spaces or tabs. The linker issues a warning if the specified *size* is less than the virtual address space required by the program. A *comment* is specified by a semicolon (**;**) and can be on the same or a separate line. The linker ignores all text from the semicolon to the end of the line. This example shows part of such a file:
+The *`key`* is a string of alphanumeric characters and isn't case sensitive. It's usually the name of a DLL, but that's not required. The *`key`* is followed by a base *`address`* in C-language, hexadecimal, or decimal notation and an optional maximum *`size`*. All three arguments are separated by spaces or tabs. The linker issues a warning if the specified *`size`* is less than the virtual address space required by the program. A *`comment`* is specified by a semicolon (**`;`**) and can be on the same or a separate line. The linker ignores all text from the semicolon to the end of the line. This example shows part of such a file:
-```
+```txt
main 0x00010000 0x08000000 ; for PROJECT.exe
one 0x28000000 0x00100000 ; for DLLONE.DLL
two 0x28100000 0x00300000 ; for DLLTWO.DLL
```
-If the file that contains these lines is called DLLS.txt, the following example command applies this information:
+If the file that contains these lines is called `DLLS.txt`, the following example command applies this information:
-```
+```cmd
link dlltwo.obj /dll /base:@dlls.txt,two
```
-Another way to set the base address is by using the *BASE* argument in a [NAME](name-c-cpp.md) or [LIBRARY](library.md) statement. The /BASE and [/DLL](dll-build-a-dll.md) options together are equivalent to the **LIBRARY** statement.
+Another way to set the base address is by using the *`BASE`* argument in a [`NAME`](name-c-cpp.md) or [`LIBRARY`](library.md) statement. The **`/BASE`** and [`/DLL`](dll-build-a-dll.md) options together are equivalent to the **`LIBRARY`** statement.
### To set this linker option in the Visual Studio development environment
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
-
1. Select the **Configuration Properties** > **Linker** > **Advanced** property page.
-
1. Modify the **Base Address** property.
### To set this linker option programmatically
@@ -57,5 +54,5 @@ Another way to set the base address is by using the *BASE* argument in a [NAME](
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/bscmake-options.md b/docs/build/reference/bscmake-options.md
index 2bd54b3e3d..f9b87e68d5 100644
--- a/docs/build/reference/bscmake-options.md
+++ b/docs/build/reference/bscmake-options.md
@@ -1,63 +1,67 @@
---
-title: "BSCMAKE Options"
+title: "BSCMAKE options"
description: "Reference to the Microsoft BSCMAKE utility command-line options."
-ms.date: "02/09/2020"
+ms.date: 03/21/2022
f1_keywords: ["VC.Project.VCBscMakeTool.OutputFile", "VC.Project.VCBscMakeTool.SuppressStartupBanner", "VC.Project.VCBscMakeTool.PreserveSBR"]
helpviewer_keywords: ["/v BSCMAKE option", "Iu BSCMAKE option", "browse information files (.bsc), content", "/Er BSCMAKE option", "NOLOGO BSCMAKE option", "/s BSCMAKE option", "/Ei BSCMAKE option", "/o BSCMAKE option", "/NOLOGO BSCMAKE option", "/Iu BSCMAKE option", "s BSCMAKE option (/s)", "/Em BSCMAKE option", "Em BSCMAKE option", "Es BSCMAKE option", "files [C++], BSCMAKE", "Er BSCMAKE option", "BSCMAKE, options for controlling files", "controlling BSCMAKE options", "El BSCMAKE option", "/El BSCMAKE option", "/Es BSCMAKE option", "Ei BSCMAKE option"]
ms.assetid: fa2f1e06-c684-41cf-80dd-6a554835ebd2
---
-# BSCMAKE Options
+# BSCMAKE options
> [!WARNING]
-> Although BSCMAKE is still installed with Visual Studio, it is no longer used by the IDE. Since Visual Studio 2008, browse and symbol information is stored automatically in a SQL Server *`.sdf`* file in the solution folder.
+> Although BSCMAKE is still installed with Visual Studio, it's no longer used by the IDE. Since Visual Studio 2008, browse and symbol information is stored automatically in a SQL Server *`.sdf`* file in the solution folder.
-This section describes the options available for controlling BSCMAKE. Several options control the content of the browse information file by excluding or including certain information. The exclusion options can allow BSCMAKE to run faster and may result in a smaller *`.bsc`* file. Option names are case-sensitive (except for **/HELP** and **/NOLOGO**).
+This section describes the options available for controlling BSCMAKE. Several options control the content of the browse information file by excluding or including certain information. The exclusion options can allow BSCMAKE to run faster and may result in a smaller *`.bsc`* file. Option names are case-sensitive (except for **`/HELP`** and **`/NOLOGO`**).
-Only **/NOLOGO** and **/o** are available from within the Visual Studio development environment. See [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md) for information on access a project's property pages.
+Only **`/NOLOGO`** and **`/o`** are available from within the Visual Studio development environment. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
-**/Ei (**_filename_...**)**\
-Excludes the contents of the specified include files from the browse information file. To specify multiple files, separate the names with a space and enclose the list in parentheses. Parentheses aren't necessary if you specify only one *filename*. Use **/Ei** along with the **/Es** option to exclude files not excluded by **/Es**.
+## Options
-**/El**\
+**`/Ei (`** *`filename`* ... **`)`**\
+Excludes the contents of one or more specified *`filename`* include files from the browse information file. To specify multiple files, separate the names with a space and enclose the list in parentheses. Parentheses aren't necessary if you specify only one *`filename`*. Use **`/Ei`** along with the **`/Es`** option to exclude files not excluded by **`/Es`**.
+
+**`/El`**\
Excludes local symbols. The default is to include local symbols. For more information about local symbols, see [Creating an .sbr File](creating-an-dot-sbr-file.md).
-**/Em**\
-Excludes symbols in the body of macros. Use **/Em** to include only the names of macros in the browse information file. The default is to include both the macro names and the result of the macro expansions.
+**`/Em`**\
+Excludes symbols in the body of macros. Use **`/Em`** to include only the names of macros in the browse information file. The default is to include both the macro names and the result of the macro expansions.
-**/Er (**_symbol_...**)**\
-Excludes the specified symbols from the browse information file. To specify multiple symbol names, separate the names with a space and enclose the list in parentheses. Parentheses are unnecessary if you specify only one *symbol*.
+**`/Er (`** *`symbol`* ... **`)`**\
+Excludes one or more of the specified *`symbol`* symbols from the browse information file. To specify multiple symbol names, separate the names with a space and enclose the list in parentheses. Parentheses are unnecessary if you specify only one *`symbol`*.
-**/Es**\
-Excludes every include file specified with an absolute path, or found in an absolute path specified in the INCLUDE environment variable. (Usually, these files are the system include files, which contain much information you may not need in your browse information file.) This option doesn't exclude files specified without a path, or with relative paths, or files found in a relative path in INCLUDE. You can use the **/Ei** option along with **/Es** to exclude files that **/Es** doesn't exclude. If you want to exclude only some of the files, use **/Ei** instead of **/Es**, and list the files you want to exclude.
+**`/Es`**\
+Excludes every include file specified with an absolute path, or found in an absolute path specified in the INCLUDE environment variable. (Usually, these files are the system include files, which contain much information you may not need in your browse information file.) This option doesn't exclude files specified without a path, or with relative paths, or files found in a relative path in INCLUDE. You can use the **`/Ei`** option along with **`/Es`** to exclude files that **`/Es`** doesn't exclude. If you want to exclude only some of the files, use **`/Ei`** instead of **`/Es`**, and list the files you want to exclude.
-**/errorreport:**[**none** | **prompt** | **queue** | **send**]\
-This option is deprecated. Starting in Windows Vista, error reporting is controlled by [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings.
+**`/errorreport:`**\[ **`none`** \| **`prompt`** \| **`queue`** \| **`send`** ]\
+This option is deprecated. In Windows Vista and later, error reporting is controlled by [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings.
-**/HELP**\
+**`/HELP`**\
Displays a summary of the BSCMAKE command-line syntax.
-**/Iu**\
+**`/Iu`**\
Includes unreferenced symbols. By default, BSCMAKE doesn't record any symbols that are defined but not referenced. If an *`.sbr`* file has been packed, this option has no effect for that input file because the compiler has already removed the unreferenced symbols.
-**/n**\
-Forces a nonincremental build. Use **/n** to force a full build of the browse information file whether a *`.bsc`* file exists or not, and to prevent *`.sbr`* files from being truncated. See [How BSCMAKE Builds a .bsc File](how-bscmake-builds-a-dot-bsc-file.md).
+**`/n`**\
+Forces a non-incremental build. Use **`/n`** to force a full build of the browse information file whether a *`.bsc`* file exists or not, and to prevent *`.sbr`* files from being truncated. For more information, see [How BSCMAKE builds a `.bsc` file](how-bscmake-builds-a-dot-bsc-file.md).
-**/NOLOGO**\
+**`/NOLOGO`**\
Suppresses the BSCMAKE copyright message.
-**/o** *filename*\
-Specifies a name for the browse information file. By default, BSCMAKE gives the browse information file the base name of the first *`.sbr`* file and a *`.bsc`* extension.
+**`/o`** *`filename`*\
+The *`filename`* option parameter specifies a name for the browse information file. By default, BSCMAKE gives the browse information file the base name of the first *`.sbr`* file and a *`.bsc`* extension.
-**/S (**_filename_...**)**\
-Tells BSCMAKE to process the specified include file the first time it's encountered and to exclude it otherwise. Use this option to save processing time when a file (such as a header, or *`.h`*, file for a *`.c`* or *`.cpp`* source file) is included in several source files but is unchanged by preprocessing directives each time. Use this option if a file is changed in ways unimportant for the browse information file you're creating. To specify multiple files, separate the names with a space, and enclose the list in parentheses. Parentheses aren't necessary if you specify only one *filename*. If you want to exclude the file every time it's included, use the **/Ei** or **/Es** option.
+**`/S (`** *`filename`* ... **`)`**\
+Tells BSCMAKE to process each specified *`filename`* include file the first time it's encountered and to exclude it otherwise. Use this option to save processing time when a file (such as a header, or *`.h`*, file for a *`.c`* or *`.cpp`* source file) is included in several source files but is unchanged by preprocessing directives each time. Use this option if a file is changed in ways unimportant for the browse information file you're creating. To specify multiple files, separate the names with a space, and enclose the list in parentheses. Parentheses aren't necessary if you specify only one *`filename`*. If you want to exclude the file every time it's included, use the **`/Ei`** or **`/Es`** option.
-**/v**\
+**`/v`**\
Provides verbose output, which includes the name of each *`.sbr`* file being processed and information about the complete BSCMAKE run.
-**/?**\
+**`/?`**\
Displays a brief summary of BSCMAKE command-line syntax.
-The following command line tells BSCMAKE to do a full build of MAIN.bsc from three *`.sbr`* files. It also tells BSCMAKE to exclude duplicate instances of TOOLBOX.h:
+## Example
+
+The following command line tells BSCMAKE to do a full build of *`main.bsc`* from three *`.sbr`* files. It also tells BSCMAKE to exclude duplicate instances of *`toolbox.h`*:
```cmd
BSCMAKE /n /S toolbox.h /o main.bsc file1.sbr file2.sbr file3.sbr
@@ -65,4 +69,4 @@ BSCMAKE /n /S toolbox.h /o main.bsc file1.sbr file2.sbr file3.sbr
## See also
-[BSCMAKE Reference](bscmake-reference.md)
+[BSCMAKE reference](bscmake-reference.md)
diff --git a/docs/build/reference/building-browse-information-files-overview.md b/docs/build/reference/building-browse-information-files-overview.md
index d69bc31429..c7217d48af 100644
--- a/docs/build/reference/building-browse-information-files-overview.md
+++ b/docs/build/reference/building-browse-information-files-overview.md
@@ -1,43 +1,43 @@
---
description: "Learn more about: Building Browse Information Files: Overview"
title: "Building Browse Information Files: Overview"
-ms.date: "05/06/2019"
+ms.date: 03/02/2022
helpviewer_keywords: [".bsc files, about .bsc files", "bsc files, about bsc files", "browse information files (.bsc)", "browse information files (.bsc), creating"]
ms.assetid: b5c12832-51f6-4953-8044-4264dd0fb242
---
# Building Browse Information Files: Overview
> [!WARNING]
-> Although BSCMAKE is still installed with Visual Studio, it is no longer used by the IDE. Since Visual Studio 2008, browse and symbol information is stored automatically in a SQL Server .sdf file in the solution folder.
+> Although BSCMAKE is still installed with Visual Studio, it's no longer used by the IDE. Since Visual Studio 2008, browse and symbol information is stored automatically in a SQL Server *`.sdf`* file in the solution folder.
-To create browse information for symbol browsing, the compiler creates an .sbr file for each source file in your project, then BSCMAKE.EXE concatenates the .sbr files into one .bsc file.
+To create browse information for symbol browsing, the compiler creates an *`.sbr`* file for each source file in your project, then BSCMAKE.EXE concatenates the *`.sbr`* files into one *`.bsc`* file.
-Generating .sbr and .bsc files takes time, so Visual Studio turns these functions off by default. If you want to browse current information, you must turn the browse options on and build your project again.
+Generating *`.sbr`* and *`.bsc`* files takes time, so Visual Studio turns off these functions by default. If you want to browse current information, you must turn on the browse options and build your project again.
-Use [/FR](fr-fr-create-dot-sbr-file.md) or [/Fr](fr-fr-create-dot-sbr-file.md) to tell the compiler to create .sbr files. To create .bsc files, you can call [BSCMAKE](bscmake-command-line.md) from the command line. Using BSCMAKE from the command line gives you more precise control over the manipulation of browse information files. See [BSCMAKE Reference](bscmake-reference.md) for more information.
+Use [`/FR`](fr-fr-create-dot-sbr-file.md) or [`/Fr`](fr-fr-create-dot-sbr-file.md) to tell the compiler to create *`.sbr`* files. To create *`.bsc`* files, you can call [BSCMAKE](bscmake-command-line.md) from the command line. Using BSCMAKE from the command line gives you more precise control over the manipulation of browse information files. For more information, see [BSCMAKE reference](bscmake-reference.md).
> [!TIP]
-> You can turn on .sbr file generation but leave .bsc file generation turned off. This provides fast builds but also enables you to create a fresh .bsc file quickly by turning on .bsc file generation and building the project.
+> You can turn on *`.sbr`* file generation but leave *`.bsc`* file generation turned off. This provides fast builds but also enables you to create a fresh *`.bsc`* file quickly by turning on *`.bsc`* file generation and building the project.
-You can reduce the time, memory, and disk space required to build a .bsc file by reducing the size of the .bsc file.
+You can reduce the time, memory, and disk space required to build a *`.bsc`* file by reducing the size of the *`.bsc`* file.
See [General Property Page (Project)](general-property-page-project.md) for information on how to build a browser file in the development environment.
-### To create a smaller .bsc file
+### To create a smaller `.bsc` file
1. Use [BSCMAKE command-line options](bscmake-options.md) to exclude information from the browse information file.
-1. Omit local symbols in one or more .sbr files when compiling or assembling.
+1. Omit local symbols in one or more *`.sbr`* files when compiling or assembling.
-1. If an object file does not contain information needed for your current stage of debugging, omit its .sbr file from the BSCMAKE command when you rebuild the browse information file.
+1. If an object file doesn't contain information needed for your current stage of debugging, omit its *`.sbr`* file from the BSCMAKE command when you rebuild the browse information file.
-### To combine the browse information from several projects into one browser file (.bsc)
+### To combine the browse information from several projects into one browser file (`.bsc`)
-1. Either don't build the .bsc file at the project level or use the /n switch to prevent the .sbr files from being truncated.
+1. Either don't build the *`.bsc`* file at the project level or use the **`/n`** switch to prevent the *`.sbr`* files from being truncated.
-1. After all the projects are built, run BSCMAKE with all of the .sbr files as input. Wildcards are accepted. For instance, if you had project directories C:\X, C:\Y, and C:\Z with .sbr files in them and you wanted to combine them all into one .bsc file, then use BSCMAKE C:\X\\\*.sbr C:\Y\\\*.sbr C:\Z\\\*.sbr /o c:\whatever_directory\combined.bsc to build the combined .bsc file.
+1. After all the projects are built, run BSCMAKE with all of the *`.sbr`* files as input. Wildcards are accepted. For instance, if you had project directories *`C:\X`*, *`C:\Y`*, and *`C:\Z`* with *`.sbr`* files in them and you wanted to combine them all into one *`.bsc`* file, then use `BSCMAKE C:\X\*.sbr C:\Y\*.sbr C:\Z\*.sbr /o c:\whatever_directory\combined.bsc` to build the combined *`.bsc`* file.
## See also
-[Additional MSVC Build Tools](c-cpp-build-tools.md)
-[BSCMAKE Reference](bscmake-reference.md)
+[Additional MSVC build tools](c-cpp-build-tools.md)\
+[BSCMAKE reference](bscmake-reference.md)
diff --git a/docs/build/reference/c-compile-without-linking.md b/docs/build/reference/c-compile-without-linking.md
index 4a881375b4..e552d6a30e 100644
--- a/docs/build/reference/c-compile-without-linking.md
+++ b/docs/build/reference/c-compile-without-linking.md
@@ -41,7 +41,7 @@ CL /c FIRST.C SECOND.C THIRD.OBJ
To create an executable file, you must invoke LINK:
```
-LINK firsti.obj second.obj third.obj /OUT:filename.exe
+LINK first.obj second.obj third.obj /OUT:filename.exe
```
## See also
diff --git a/docs/build/reference/c-cpp-prop-page.md b/docs/build/reference/c-cpp-prop-page.md
index a5744b0b89..4f92e38d17 100644
--- a/docs/build/reference/c-cpp-prop-page.md
+++ b/docs/build/reference/c-cpp-prop-page.md
@@ -1,9 +1,9 @@
---
title: "C/C++ Project Properties (Visual Studio)"
description: "Reference guide to the Visual Studio Microsoft C/C++ project Property Pages properties."
-ms.date: 09/03/2020
+ms.date: 6/9/2023
ms.topic: "article"
-ms.assetid: 16375038-4917-4bd0-9a2a-26343c1708b7
+f1_keywords: ["VC.Project.VCCLCompilerTool.AdditionalModuleDirectories", "VC.Project.VCCLCompilerTool.ScanSourceForModuleDependencies"]
---
# C/C++ Property Pages
@@ -13,22 +13,44 @@ The following property pages are found under **Project** > **Properties** > **Co
### Additional Include Directories
-Specifies one or more directories to add to the include path; separate with semi-colons if more than one. Sets [`/I` (Additional include directories)](i-additional-include-directories.md).
+Specifies one or more directories to add to the include path. Separate directories with semi-colons ('`;`') if there's more than one. Sets the [`/I` (Additional include directories)](i-additional-include-directories.md) compiler option.
### Additional #using Directories
-Specifies one or more directories (separate directory names with a semicolon) to be searched to resolve names passed to a #using directive. Sets [`/AI`](ai-specify-metadata-directories.md).
+Specifies one or more directories to search to resolve names passed to a `#using` directive. Separate directories with semi-colons ('`;`') if there's more than one. Sets the [`/AI`](ai-specify-metadata-directories.md) compiler option.
+
+### Additional BMI Directories
+
+Specifies one or more directories to search to resolve names passed to an `import` directive. Separate directories with semi-colons ('`;`') if there's more than one. Sets the **`/ifcSearchDir[path]`** compiler option.
+
+### Additional Module Dependencies
+
+Specifies one or more modules to use to resolve names passed to an `import` directive. Separate directories with semi-colons ('`;`') if there's more than one. Sets the [`/reference`](module-reference.md) compiler option.
+
+### Additional Header Unit Dependencies
+
+Specifies one or more header units to use to resolve names passed to an `import` header directive. Separate directories with semi-colons ('`;`') if there's more than one. Sets the [`/headerUnit`](headerunit.md) compiler option.
+
+### Scan Sources for Module Dependencies
+
+When set to **Yes**, the compiler scans all C++ sources, not just module interface and header unit sources, for module and header units dependencies. The build system builds the full dependencies graph, which ensures that all imported modules and header units are built before compiling the files that depend on them. When combined with **Translate Includes to Imports**, any header file that's specified in a [`header-units.json`](header-unit-json-reference.md) file in the same directory as the header file is compiled into a header unit.
+
+Files that have the extension *`.ixx`*, and files that have their **File properties** > **C/C++** > **Compile As** property set to **Compile as C++ Header Unit (/exportHeader)**, are always scanned.
+
+### Translate Includes to Imports
+
+When set to **Yes**, the compiler treats a `#include` directive as an `import` directive if certain conditions are met: The header file is specified in a *`header-units.json`* file in the same directory, and a compiled header unit (an *`.ifc`* file) is available for the header file. Otherwise, the header file is treated as a normal `#include`. The *`header-units.json`* file is used to build header units for each `#include` without symbol duplication. When combined with **Scan Sources for Module Dependencies**, the compiler automatically finds all of the header files that can be compiled into header units. This property sets the [`/translateInclude`](translateinclude.md) compiler option.
### Debug Information Format
-Specifies the type of debugging information generated by the compiler. This property requires compatible linker settings. Sets [`/Z7`, `/Zi`, `/ZI` (Debug information format)](z7-zi-zi-debug-information-format.md).
+Specifies the type of debugging information generated by the compiler. This property requires compatible linker settings. Sets [`/Z7`, `/Zi`, `/ZI` (Debug information format)](z7-zi-zi-debug-information-format.md) compiler options.
#### Choices
- **None** - Produces no debugging information, so compilation may be faster.
- **C7 compatible** - Select the type of debugging information created for your program and whether this information is kept in object (.obj) files or in a program database (PDB).
- **Program Database** - Produces a program database (PDB) that contains type information and symbolic debugging information for use with the debugger. The symbolic debugging information includes the names and types of variables and functions, and line numbers.
-- **Program Database for Edit And Continue** - Produces a program database, as described above, in a format that supports the [Edit and Continue](/visualstudio/debugger/edit-and-continue) feature.
+- **Program Database for Edit And Continue** - Produces a program database, as described previously, in a format that supports the [Edit and Continue](/visualstudio/debugger/edit-and-continue) feature.
### Support Just My Code Debugging
@@ -90,7 +112,11 @@ Additional Security Development Lifecycle (SDL) recommended checks; includes ena
### Multi-processor Compilation
-Multi-processor Compilation.
+Enable multi-processor compilation. Sets the [`/MP`](mp-build-with-multiple-processes.md) compiler option.
+
+### Enable Address Sanitizer
+
+Compiles and links the program with AddressSanitizer instrumentation. This property currently supports x86 and x64 target builds. Sets the [`/fsanitize`](fsanitize.md) compiler option.
## C/C++ Optimization Properties
@@ -115,7 +141,7 @@ Select the level of [inline function](../../cpp/inline-functions-cpp.md) expansi
- **Default**
- **Disabled** - Disables inline expansion, which is on by default.
- **Only __inline** - Expands only functions marked as **`inline`**, **`__forceinline`**, or **`__inline`**. Or, in a C++ member function, defined within a class declaration.
-- **Any Suitable** - Expands functions marked as **`inline`** or **`__inline`** and any other function that the compiler chooses. (Expansion occurs at the compiler's discretion, often referred to as *auto-inlining*.)
+- **Any Suitable** - Expands functions marked as **`inline`** or **`__inline`** and any other function that the compiler chooses. (Expansion occurs at the compiler's discretion, often referred to as *autoinlining*.)
### Enable Intrinsic Functions
@@ -216,9 +242,9 @@ Specify runtime library for linking. Sets [`/MT`, `/MTd`, `/MD`, `/MDd`](md-mt-l
#### Choices
- **Multi-threaded** - Causes your application to use the multithread, static version of the run-time library.
-- **Multi-threaded Debug** - Defines _DEBUG and _MT. This option also causes the compiler to place the library name *LIBCMTD.lib* into the *`.obj`* file so that the linker will use *LIBCMTD.lib* to resolve external symbols.
+- **Multi-threaded Debug** - Defines `_DEBUG` and `_MT`. This option also causes the compiler to place the library name *`LIBCMTD.lib`* into the *`.obj`* file so that the linker will use *`LIBCMTD.lib`* to resolve external symbols.
- **Multi-threaded DLL** - Causes your application to use the multithread- and DLL-specific version of the run-time library. Defines `_MT` and `_DLL` and causes the compiler to place the library name *MSVCRT.lib* into the *`.obj`* file.
-- **Multi-threaded Debug DLL** - Defines `_DEBUG`, `_MT`, and `_DLL` and causes your application to use the debug multithread- and DLL-specific version of the run-time library. It also causes the compiler to place the library name *MSVCRTD.lib* into the *`.obj`* file.
+- **Multi-threaded Debug DLL** - Defines `_DEBUG`, `_MT`, and `_DLL` and causes your application to use the debug multithread- and DLL-specific version of the run-time library. It also causes the compiler to place the library name *`MSVCRTD.lib`* into the *`.obj`* file.
### Struct Member Alignment
@@ -226,11 +252,11 @@ Specifies 1, 2, 4, or 8-byte boundaries for struct member alignment. Sets [`/Zp`
#### Choices
-- **1 Byte** - Packs structures on 1-byte boundaries. Same as **`/Zp`**.
-- **2 Bytes** - Packs structures on 2-byte boundaries.
-- **4 Bytes** - Packs structures on 4-byte boundaries.
-- **8 Bytes** - Packs structures on 8-byte boundaries (default).
-- **16 Bytes** - Packs structures on 16-byte boundaries.
+- **1 Byte** - Packs structures on one-byte boundaries. Same as **`/Zp`**.
+- **2 Bytes** - Packs structures on two-byte boundaries.
+- **4 Bytes** - Packs structures on four-byte boundaries.
+- **8 Bytes** - Packs structures on eight-byte boundaries (default).
+- **16 Bytes** - Packs structures on sixteen-byte boundaries.
- **Default** - Default alignment settings.
### Security Check
@@ -261,7 +287,7 @@ Allows the compiler to generate parallel code for loops identified using `#pragm
### Enable Enhanced Instruction Set
-Enable use of instructions found on processors that support enhanced instruction sets. For example, the SSE, SSE2, AVX, and AVX2 enhancements to IA-32. And, the AVX and AVX2 enhancements to x64. Currently **`/arch:SSE`** and **`/arch:SSE2`** are only available when building for the x86 architecture. If no option is specified, the compiler will use instructions found on processors that support SSE2. Use of enhanced instructions can be disabled with **`/arch:IA32`**. For more information, see [`/arch (x86)`](arch-x86.md), [`/arch (x64)`](arch-x64.md), and [`/arch (ARM)`](arch-arm.md).
+Enable use of instructions found on processors that support enhanced instruction sets. For example, the SSE, SSE2, AVX, and AVX2 enhancements to IA-32. And, the AVX and AVX2 enhancements to x64. Currently **`/arch:SSE`** and **`/arch:SSE2`** are only available when building for the x86 architecture. If no option is specified, the compiler uses instructions found on processors that support SSE2. Use of enhanced instructions can be disabled with **`/arch:IA32`**. For more information, see [`/arch (x86)`](arch-x86.md), [`/arch (x64)`](arch-x64.md), [`/arch (ARM64)`](arch-arm64.md), and [`/arch (ARM)`](arch-arm.md).
#### Choices
@@ -280,7 +306,7 @@ Sets the floating point model. Sets [`/fp:precise`, `/fp:strict`, `/fp:fast`](fp
- **Precise** - Default. Improves the consistency of floating-point tests for equality and inequality.
- **Strict** - The strictest floating-point model. **`/fp:strict`** causes **`fp_contract`** to be OFF and **`fenv_access`** to be ON. **`/fp:except`** is implied and can be disabled by explicitly specifying **`/fp:except-`**. When used with **`/fp:except-`**, **`/fp:strict`** enforces strict floating-point semantics but without respect for exceptional events.
-- **Fast** - Creates the fastest code in the majority of cases.
+- **Fast** - Creates the fastest code in most cases.
### Enable Floating Point Exceptions
@@ -305,11 +331,7 @@ Spectre mitigations for CVE 2017-5753. Sets [`/Qspectre`](qspectre.md).
Suppresses or enables language extensions. Sets [`/Za`](za-ze-disable-language-extensions.md).
-### Conformance mode
-
-Enables or suppresses conformance mode. Sets [`/permissive-`](permissive-standards-conformance.md).
-
-### Treat wchar_t As Built in Type
+### Treat WChar_t As Built in Type
When specified, the type **`wchar_t`** becomes a native type that maps to **`__wchar_t`** in the same way that **`short`** maps to **`__int16`**. [`/Zc:wchar_t`](zc-wchar-t-wchar-t-is-native-type.md) is on by default.
@@ -333,9 +355,9 @@ Adds code for checking C++ object types at run time (*runtime type information*,
Enables OpenMP 2.0 language extensions. Sets [`/openmp`](openmp-enable-openmp-2-0-support.md).
-### C++ Language Standard
+### C++ Language Standard
-Determines the C++ language standard the compiler enables. The default value doesn't set a standard option, so the compiler uses its default C++14 setting. If you select a specific value, the corresponding [`/std`](std-specify-language-standard-version.md) compiler option is set.md).
+Determines the C++ language standard that the compiler enables. The default value doesn't set a standard option, so the compiler uses its default C++14 setting. If you select a specific value, the corresponding [`/std`](std-specify-language-standard-version.md) compiler option is set.md).
#### Choices
@@ -345,10 +367,28 @@ Determines the C++ language standard the compiler enables. The default value doe
- **ISO C++20 Standard (/std:c++20)**
- **Preview - Features from the Latest C++ Working Draft (/std:c++latest)**
-### Enable C++ Modules (experimental)
+### C Language Standard
+
+Determines the C language standard that the compiler enables. The default value doesn't set a standard option, so the compiler uses its default legacy MSVC setting. If you select a specific value, the corresponding [`/std`](std-specify-language-standard-version.md) compiler option is set.md).
+
+#### Choices
+
+- **Default (Legacy MSVC)**
+- **ISO C11 Standard (/std:c11)**
+- **ISO C17 (2018) Standard (/std:c17)**
+
+### Conformance mode
+
+Enables or suppresses conformance mode. Sets [`/permissive-`](permissive-standards-conformance.md).
+
+### Enable Experimental C++ Standard Library Modules
Experimental support for the C++ Modules TS and Standard Library modules.
+### Build ISO C++23 Standard Library Modules
+
+Starting in Visual Studio 17.6, when this property is enabled and [C++ Language Standard](#cpplang) is set to `/std:c++latest`, Visual C++ projects automatically find and build ISO C++23 Standard Library modules. This enables you to `import std` or `import std.compat` in your C++ code.
+
## C/C++ Precompiled Headers Properties
### Create/Use Precompiled Header
@@ -421,6 +461,28 @@ Specifies level of browse information in *`.bsc`* file. Sets [`/FR`](fr-fr-creat
Specifies optional name for browser information file. Sets [`/FR`\](fr-fr-create-dot-sbr-file.md).
+## External Includes
+
+### Treat Files Included with Angle Brackets as External
+
+Specifies whether to treat files included with angle brackets as external. Set this property to **Yes** to set the [`/external:anglebrackets`](external-external-headers-diagnostics.md) compiler option.
+
+### External Header Warning Level
+
+Select how strict you want the compiler to be about code errors in external headers. This property sets the [`/external:Wn`](external-external-headers-diagnostics.md) compiler option. If this value is set to **Inherit Project Warning Level** or the default, other **`/external`** options are ignored.
+
+### Template Diagnostics in External Headers
+
+Specifies whether to evaluate the warning level across a template instantiation chain. Set this property to **Yes** to set the [`/external:templates-`](external-external-headers-diagnostics.md) compiler option.
+
+### Disable Code Analysis for External Headers
+
+Disables code analysis for external headers. Sets the [`/analyze:external-`](analyze-code-analysis.md) compiler option.
+
+### Analysis Ruleset for External Headers
+
+Specifies a code analysis ruleset override for external headers. If not specified, the Code Analysis setting is used. Sets the [`/analyze:external:ruleset path`](analyze-code-analysis.md) compiler option.
+
## C/C++ Advanced Properties
### Calling Convention
@@ -436,13 +498,16 @@ Select the default calling convention for your application (can be overridden by
### Compile As
-Select compile language option for *`.c`* and *`.cpp`* files. Sets [`/TC`, `/TP`](tc-tp-tc-tp-specify-source-file-type.md).
+Select compile language option for source files. Sets [`/TC`, `/TP`](tc-tp-tc-tp-specify-source-file-type.md), [/interface](./interface.md), [`/internalPartition`](./internal-partition.md), or [`/exportHeader`](./module-exportheader.md) options.
#### Choices
- **Default** - Default.
-- **Compile as C Code** - Compile as C Code.
-- **Compile as C++ Code** - Compile as C++ Code.
+- **Compile as C Code ([`/TC`](./tc-tp-tc-tp-specify-source-file-type.md))** - Compile specified source files as C code. By default, files with a *`.c`* extension are compiled as C.
+- **Compile as C++ Code ([`/TP`](./tc-tp-tc-tp-specify-source-file-type.md))** - Compile specified source files as C++ code. By default, all source files that don't have a *`.c`*, *`.ixx`*, *`.cppm`*, *`.h`*, or no extension are compiled as C++.
+- **Compile as C++ Module Code ([`/interface`](./interface.md))** - Compile specified source files as C++ module code. By default, files with a *`.ixx`* or *`.cppm`* extension are compiled as C++ module code.
+- **Compile as C++ Module Internal Partition ([`/internalPartition`](./internal-partition.md))** - Compile specified source files as C++ module internal partition.
+- **Compile as C++ Header Unit ([`/exportHeader`](./module-exportheader.md))** - Compile specified source files as C++ header unit. By default, files with a *`.h`* extension or no extension are compiled as header units.
### Disable Specific Warnings
diff --git a/docs/build/reference/cetcompat.md b/docs/build/reference/cetcompat.md
index 3eb8eecd94..d5c8870b4c 100644
--- a/docs/build/reference/cetcompat.md
+++ b/docs/build/reference/cetcompat.md
@@ -2,12 +2,12 @@
description: "Learn more about: /CETCOMPAT (CET Shadow Stack compatible)"
title: "/CETCOMPAT (CET Shadow Stack compatible)"
ms.date: 09/22/2021
-f1_keywords: ["/CETCOMPAT"]
+f1_keywords: ["VC.Project.VCLinkerTool.CETCompat", "/CETCOMPAT"]
helpviewer_keywords: ["/CETCOMPAT linker option", "/CETCOMPAT"]
---
-# /CETCOMPAT (CET Shadow Stack compatible)
+# `/CETCOMPAT` (CET Shadow Stack compatible)
-Specifies whether to mark an executable image as compatible with Control-flow Enforcement Technology (CET) Shadow Stack.
+Specifies whether the linker marks an executable image as compatible with Control-flow Enforcement Technology (CET) Shadow Stack.
## Syntax
@@ -21,7 +21,7 @@ Specifies that the executable shouldn't be marked compatible with CET Shadow Sta
## Remarks
-Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature. It provides capabilities to defend against return-oriented programming (ROP) based malware attacks. For more information, see [A Technical Look at Intel’s Control-flow Enforcement Technology](https://software.intel.com/content/www/us/en/develop/articles/technical-look-control-flow-enforcement-technology.html).
+Control-flow Enforcement Technology (CET) Shadow Stack is a computer processor feature. It provides capabilities to defend against return-oriented programming (ROP) based malware attacks. For more information, see [A Technical Look at Intel's Control-flow Enforcement Technology](https://software.intel.com/content/www/us/en/develop/articles/technical-look-control-flow-enforcement-technology.html).
The **`/CETCOMPAT`** linker option tells the linker to mark the binary as CET Shadow Stack-compatible. **`/CETCOMPAT:NO`** marks the binary as not compatible with CET Shadow Stack. If both options are specified on the command line, the last one specified is used. This switch is currently only applicable to x86 and x64 architectures.
@@ -31,7 +31,7 @@ The **`/CETCOMPAT`** option is available beginning in Visual Studio 2019.
Starting in Visual Studio 2019 version 16.7:
-1. Open the **Property Pages** dialog box for the project. For more information, see [Working with Project Properties](../working-with-project-properties.md).
+1. Open the **Property Pages** dialog box for the project. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
1. Select the **Configuration Properties** > **Linker** > **Advanced** property page.
@@ -41,7 +41,7 @@ Starting in Visual Studio 2019 version 16.7:
In previous versions of Visual Studio 2019:
-1. Open the **Property Pages** dialog box for the project. For more information, see [Working with Project Properties](../working-with-project-properties.md).
+1. Open the **Property Pages** dialog box for the project. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
diff --git a/docs/build/reference/clr-restrictions.md b/docs/build/reference/clr-restrictions.md
index 13ab850c9f..7f929098e7 100644
--- a/docs/build/reference/clr-restrictions.md
+++ b/docs/build/reference/clr-restrictions.md
@@ -1,74 +1,74 @@
---
description: "Learn more about: /clr Restrictions"
title: "/clr Restrictions"
-ms.date: "11/04/2016"
+ms.date: 03/02/2022
helpviewer_keywords: ["/clr compiler option [C++], restrictions"]
ms.assetid: 385f6462-2c68-46d6-810e-469553ead447
---
-# /clr Restrictions
+# `/clr` Restrictions
-Note the following restrictions on the use of **/clr**:
+Note the following restrictions on the use of **`/clr`**:
-- In a structured exception handler, there are restrictions on using `_alloca` when compiling with **/clr**. For more information, see [_alloca](../../c-runtime-library/reference/alloca.md).
+- In a structured exception handler, there are restrictions on using `_alloca` when compiling with **`/clr`**. For more information, see [`_alloca`](../../c-runtime-library/reference/alloca.md).
-- The use of run-time error checks is not valid with **/clr**. For more information, see [How to: Use Native Run-Time Checks](/visualstudio/debugger/how-to-use-native-run-time-checks).
+- The use of run-time error checks isn't valid with **`/clr`**. For more information, see [How to: Use native run-time checks](/visualstudio/debugger/how-to-use-native-run-time-checks).
-- When **/clr** is used to compile a program that only uses standard C++ syntax, the following guidelines apply to the use of inline assembly:
+- When **`/clr`** is used to compile a program that only uses standard C++ syntax, the following guidelines apply to the use of inline assembly:
- - Inline assembly code that assumes knowledge of the native stack layout, calling conventions outside of the current function, or other low-level information about the computer may fail if that knowledge is applied to the stack frame for a managed function. Functions containing inline assembly code are generated as unmanaged functions, as if they were placed in a separate module that was compiled without **/clr**.
+ - Inline assembly code that assumes knowledge of the native stack layout, calling conventions outside of the current function, or other low-level information about the computer may fail if that knowledge is applied to the stack frame for a managed function. Functions containing inline assembly code are generated as unmanaged functions, as if they were placed in a separate module that was compiled without **`/clr`**.
- - Inline assembly code in functions that pass copy-constructed function parameters is not supported.
+ - Inline assembly code in functions that pass copy-constructed function parameters isn't supported.
-- The [vprintf Functions](../../c-runtime-library/vprintf-functions.md) cannot be called from a program compiled with **/clr**.
+- The [`vprintf` Functions](../../c-runtime-library/vprintf-functions.md) can't be called from a program compiled with **`/clr`**.
-- The [naked](../../cpp/naked-cpp.md) [__declspec](../../cpp/declspec.md) modifier is ignored under /clr.
+- The [`naked`](../../cpp/naked-cpp.md) [`__declspec`](../../cpp/declspec.md) modifier is ignored under **`/clr`**.
-- The translator function set by [_set_se_translator](../../c-runtime-library/reference/set-se-translator.md) will affect only catches in unmanaged code. See [Exception Handling](../../extensions/exception-handling-cpp-component-extensions.md) for more information.
+- The translator function set by [`_set_se_translator`](../../c-runtime-library/reference/set-se-translator.md) will affect only catches in unmanaged code. For more information, see [Exception handling](../../extensions/exception-handling-cpp-component-extensions.md).
-- The comparison of function pointers is not permitted under **/clr**.
+- The comparison of function pointers isn't permitted under **`/clr`**.
-- The use of functions that are not fully prototyped is not permitted under **/clr**.
+- The use of functions that aren't fully prototyped isn't permitted under **`/clr`**.
-- The following compiler options are not supported with **/clr**:
+- The following compiler options aren't supported with **`/clr`**:
- - **/EHsc** and **/EHs** (**/clr** implies **/EHa** (see [/EH (Exception Handling Model)](eh-exception-handling-model.md))
+ - **`/EHsc`** and **`/EHs`** (**`/clr`** implies **`/EHa`** (see [`/EH` (Exception Handling Model)](eh-exception-handling-model.md))
- - **/fp:strict** and **/fp:except** (see [/fp (Specify Floating-Point Behavior)](fp-specify-floating-point-behavior.md))
+ - **`/fp:strict`** and **`/fp:except`** (see [`/fp` (Specify Floating-Point Behavior)](fp-specify-floating-point-behavior.md))
- - [/Zd](z7-zi-zi-debug-information-format.md)
+ - [`/Zd`](z7-zi-zi-debug-information-format.md)
- - [/Gm](gm-enable-minimal-rebuild.md)
+ - [`/Gm`](gm-enable-minimal-rebuild.md)
- - [/MT](md-mt-ld-use-run-time-library.md)
+ - [`/MT`](md-mt-ld-use-run-time-library.md)
- - [/RTC](rtc-run-time-error-checks.md)
+ - [`/RTC`](rtc-run-time-error-checks.md)
- - [/ZI](z7-zi-zi-debug-information-format.md)
+ - [`/ZI`](z7-zi-zi-debug-information-format.md)
-- The combination of the `_STATIC_CPPLIB` preprocessor definition (`/D_STATIC_CPPLIB`) and the **/clr** compiler option is not supported. This is so because the definition would cause your application to link with the static multithreaded C++ Standard Library, which is not supported. For more information, see the [/MD, /MT, /LD (Use Run-Time Library)](md-mt-ld-use-run-time-library.md) topic.
+- The combination of the `_STATIC_CPPLIB` preprocessor definition (`/D_STATIC_CPPLIB`) and the **`/clr`** compiler option isn't supported. It's because the definition would cause your application to link with the static, multithreaded C++ Standard Library, which isn't supported. For more information, see [`/MD`, `/MT`, `/LD` (Use Run-Time Library)](md-mt-ld-use-run-time-library.md).
-- When using **/Zi** with **/clr**, there are performance implications. For more information, see [/Zi](z7-zi-zi-debug-information-format.md).
+- When you use **`/Zi`** with **`/clr`**, there are performance implications. For more information, see [`/Zi`](z7-zi-zi-debug-information-format.md).
-- Passing a wide character to a .NET Framework output routine without also specifying [/Zc:wchar_t](zc-wchar-t-wchar-t-is-native-type.md) or without casting the character to **`__wchar_t`** will cause the output to appear as an `unsigned short int`. For example:
+- Passing a wide character to a .NET Framework output routine without also specifying [`/Zc:wchar_t`](zc-wchar-t-wchar-t-is-native-type.md) or without casting the character to **`_wchar_t`** will cause the output to appear as an `unsigned short int`. For example:
```cpp
Console::WriteLine(L' ') // Will output 32.
Console::WriteLine((__wchar_t)L' ') // Will output a space.
```
-- [/GS](gs-buffer-security-check.md) is ignored when compiling with **/clr**, unless a function is under `#pragma` [unmanaged](../../preprocessor/managed-unmanaged.md) or if the function must be compiled to native, in which case the compiler will generate warning C4793, which is off by default.
+- [`/GS`](gs-buffer-security-check.md) is ignored when compiling with **`/clr`**, unless a function is under [`#pragma unmanaged`](../../preprocessor/managed-unmanaged.md) or if the function must be compiled as native code, in which case the compiler will generate warning C4793, which is off by default.
-- See [/ENTRY](entry-entry-point-symbol.md) for function signature requirements of a managed application.
+- See [`/ENTRY`](entry-entry-point-symbol.md) for function signature requirements of a managed application.
-- Applications compiled with **/openmp** and **/clr** can only be run in a single appdomain process. See [/openmp (Enable OpenMP 2.0 Support)](openmp-enable-openmp-2-0-support.md) for more information.
+- Applications compiled with **`/openmp`** and **`/clr`** can only be run in a single appdomain process. For more information, see [`/openmp` (Enable OpenMP 2.0 Support)](openmp-enable-openmp-2-0-support.md).
-- Functions that take a variable number of arguments (varargs) will be generated as native functions. Any managed data types in the variable argument position will be marshaled to native types. Note that types are actually wide-character strings, but they are marshaled to single-byte character strings. So if a printf specifier is %S (wchar_t*), it will marshal to a %s string instead.
+- Functions that take a variable number of arguments (varargs) will be generated as native functions. Any managed data types in the variable argument position will be marshaled to native types. Any types are actually wide-character strings, but they're marshaled to single-byte character strings. So if a `printf` specifier is `%S` (`wchar_t*`), it will marshal to a `%s` string instead.
-- When using the va_arg macro, you may get unexpected results when compiling with **/clr:pure**. For more information, see [va_arg, va_copy, va_end, va_start](../../c-runtime-library/reference/va-arg-va-copy-va-end-va-start.md). The **/clr:pure** and **/clr:safe** compiler options are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017 and later. Code that must be "pure" or "safe" should be ported to C#.
+- When using the `va_arg` macro, you may get unexpected results when compiling with **`/clr:pure`**. For more information, see [`va_arg`, `va_copy`, `va_end`, `va_start`](../../c-runtime-library/reference/va-arg-va-copy-va-end-va-start.md). The **`/clr:pure`** and **`/clr:safe`** compiler options are deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017 and later. Code that must be "pure" or "safe" should be ported to C#.
-- You should not call, from managed code, any functions that walk the stack to get parameter information (function arguments); the P/Invoke layer causes that information to be further down the stack. For example, do not compile proxy/stub with **/clr**.
+- You shouldn't call any functions that walk the stack to get parameter information (function arguments) from managed code. The P/Invoke layer causes that information to be further down the stack. For example, don't compile proxy/stub with **`/clr`**.
-- Functions will be compiled to managed code whenever possible, but not all C++ constructs can be translated to managed code. This determination is made on a function-by-function basis. If any part of a function cannot be converted to managed code, the entire function will be converted to native code instead. The following cases prevent the compiler from generating managed code.
+- Functions will be compiled to managed code whenever possible, but not all C++ constructs can be translated to managed code. This determination is made on a function-by-function basis. If any part of a function can't be converted to managed code, the entire function will be converted to native code instead. The following cases prevent the compiler from generating managed code.
- Compiler-generated thunks or helper functions. Native thunks are generated for any function call through a function pointer, including virtual function calls.
@@ -76,10 +76,10 @@ Note the following restrictions on the use of **/clr**:
- Functions that use certain intrinsic routines to directly manipulate machine resources. For example, the use of `__enable` and `__disable`, `_ReturnAddress` and `_AddressOfReturnAddress`, or multimedia intrinsics will all result in native code.
- - Functions that follow the `#pragma unmanaged` directive. (Note that the inverse, `#pragma managed`, is also supported.)
+ - Functions that follow the `#pragma unmanaged` directive. (The inverse, `#pragma managed`, is also supported.)
- A function that contains references to aligned types, that is, types declared using `__declspec(align(...))`.
## See also
-- [/clr (Common Language Runtime Compilation)](clr-common-language-runtime-compilation.md)
+- [/clr (Common Language Runtime compilation)](clr-common-language-runtime-compilation.md)
diff --git a/docs/build/reference/clrsupportlasterror-preserve-last-error-code-for-pinvoke-calls.md b/docs/build/reference/clrsupportlasterror-preserve-last-error-code-for-pinvoke-calls.md
index ef9e5e1e0d..7ab680d3cf 100644
--- a/docs/build/reference/clrsupportlasterror-preserve-last-error-code-for-pinvoke-calls.md
+++ b/docs/build/reference/clrsupportlasterror-preserve-last-error-code-for-pinvoke-calls.md
@@ -1,39 +1,39 @@
---
description: "Learn more about: /CLRSUPPORTLASTERROR (Preserve Last Error Code for PInvoke Calls)"
title: "/CLRSUPPORTLASTERROR (Preserve Last Error Code for PInvoke Calls)"
-ms.date: "11/04/2016"
-f1_keywords: ["/CLRSUPPORTLASTERROR"]
+ms.date: 09/19/2022
+f1_keywords: ["VC.Project.VCLinkerTool.CLRSupportLastError", "/CLRSUPPORTLASTERROR"]
helpviewer_keywords: ["/CLRSUPPORTLASTERROR linker option", "-CLRSUPPORTLASTERROR linker option"]
ms.assetid: b7057990-4154-4b1d-9fc9-6236f7be7575
---
-# /CLRSUPPORTLASTERROR (Preserve Last Error Code for PInvoke Calls)
+# `/CLRSUPPORTLASTERROR` (Preserve Last Error Code for PInvoke Calls)
-**/CLRSUPPORTLASTERROR**, which is on by default, preserves the last error code of functions called through the P/Invoke mechanism, which allows you to call native functions in DLLS, from code compiled with **/clr**.
+**`/CLRSUPPORTLASTERROR`**, which is on by default, preserves the last error code of functions called through the P/Invoke mechanism, which allows you to call native functions in DLLS, from code compiled with **`/clr`**.
## Syntax
-```
-/CLRSUPPORTLASTERROR{:NO | SYSTEMDLL}
-```
+> **`/CLRSUPPORTLASTERROR`**\
+> **`/CLRSUPPORTLASTERROR:NO`**\
+> **`/CLRSUPPORTLASTERROR:SYSTEMDLL`**
## Remarks
-Preserving the last error code implies a decrease in performance. If you do not want to incur the performance impact of preserving the last error code, link with **/CLRSUPPORTLASTERROR:NO**.
+Preserving the last error code implies a decrease in performance. If you don't want to incur the performance cost of preserving the last error code, link by using **`/CLRSUPPORTLASTERROR:NO`**.
-You can minimize the performance impact by linking with **/CLRSUPPORTLASTERROR:SYSTEMDLL**, which only preserves the last error code for functions in system DLLs.
+You can minimize the performance penalty by linking with **`/CLRSUPPORTLASTERROR:SYSTEMDLL`**, which only preserves the last error code for functions in system DLLs.
> [!NOTE]
-> Preserving the last error is not supported for unmanaged functions that are consumed by CLR code, in the same module.
+> Preserving the last error isn't supported for unmanaged functions that are consumed by CLR code in the same module.
-- For more information, see [/clr (Common Language Runtime Compilation)](clr-common-language-runtime-compilation.md).
+- For more information, see [`/clr` (Common Language Runtime Compilation)](clr-common-language-runtime-compilation.md).
### To set this linker option in the Visual Studio development environment
-1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+1. Open the **Property Pages** dialog box for the project. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
-1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
+1. Select the **Configuration Properties** > **Linker** > **Advanced** property page.
-1. Enter the option into the **Additional Options** box.
+1. Modify the **Preserve Last Error Code for PInvoke Calls** property. Choose **OK** or **Apply** to save your changes.
### To set this linker option programmatically
@@ -56,7 +56,7 @@ __declspec(dllexport) double MySqrt(__int64 n) {
}
```
-The following sample consumes the DLL, demonstrating how to use **/CLRSUPPORTLASTERROR**.
+The following sample consumes the DLL, demonstrating how to use **`/CLRSUPPORTLASTERROR`**.
```cpp
// CLRSUPPORTLASTERROR_client.cpp
@@ -109,5 +109,5 @@ GetLastError for system call succeeded (183).
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/clrunmanagedcodecheck-add-suppressunmanagedcodesecurityattribute.md b/docs/build/reference/clrunmanagedcodecheck-add-suppressunmanagedcodesecurityattribute.md
index fe8ce160d2..ffc60a41e9 100644
--- a/docs/build/reference/clrunmanagedcodecheck-add-suppressunmanagedcodesecurityattribute.md
+++ b/docs/build/reference/clrunmanagedcodecheck-add-suppressunmanagedcodesecurityattribute.md
@@ -1,37 +1,38 @@
---
description: "Learn more about: /CLRUNMANAGEDCODECHECK (Remove SuppressUnmanagedCodeSecurityAttribute)"
title: "/CLRUNMANAGEDCODECHECK (Remove SuppressUnmanagedCodeSecurityAttribute)"
-ms.date: "05/16/2019"
+ms.date: 09/19/2022
ms.topic: "reference"
-f1_keywords: ["/CLRUNMANAGEDCODECHECK"]
+f1_keywords: ["VC.Project.VCLinkerTool.CLRUnmanagedCodeCheck", "/CLRUNMANAGEDCODECHECK"]
helpviewer_keywords: ["-CLRUNMANAGEDCODECHECK linker option", "/CLRUNMANAGEDCODECHECK linker option"]
ms.assetid: 73abc426-dab0-45e2-be85-0f9a14206cc2
-author: "corob-msft"
-ms.author: "corob"
+author: "tylermsft"
+ms.author: "twhitney"
---
-# /CLRUNMANAGEDCODECHECK (Remove SuppressUnmanagedCodeSecurityAttribute)
+# `/CLRUNMANAGEDCODECHECK` (Remove SuppressUnmanagedCodeSecurityAttribute)
-**/CLRUNMANAGEDCODECHECK** specifies that the linker does not apply to linker-generated `PInvoke` calls from managed code into native DLLs.
+**`/CLRUNMANAGEDCODECHECK`** specifies that the linker doesn't apply to linker-generated `PInvoke` calls from managed code into native DLLs.
## Syntax
-> **/CLRUNMANAGEDCODECHECK**[**:NO**]
+> **`/CLRUNMANAGEDCODECHECK`**\
+> **`/CLRUNMANAGEDCODECHECK:NO`**
## Remarks
-By default, the linker applies the **SuppressUnmanagedCodeSecurityAttribute** to linker-generated `PInvoke` calls. When **/CLRUNMANAGEDCODECHECK** is in effect, **SuppressUnmanagedCodeSecurityAttribute** is removed. To explicitly apply the **SuppressUnmanagedCodeSecurityAttribute** to linker-generated `PInvoke` calls, you can use **/CLRUNMANAGEDCODECHECK:NO**.
+By default, the linker applies the `SuppressUnmanagedCodeSecurityAttribute` attribute to linker-generated `PInvoke` calls. When **`/CLRUNMANAGEDCODECHECK`** is in effect, `SuppressUnmanagedCodeSecurityAttribute` is removed. To explicitly apply the `SuppressUnmanagedCodeSecurityAttribute` attribute to linker-generated `PInvoke` calls, you can use **`/CLRUNMANAGEDCODECHECK:NO`**.
-The linker only adds the attribute to objects that are compiled using **/clr** or **/clr:pure**. However, the **/clr:pure** compiler option is deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017 and later.
+The linker only adds the attribute to objects that are compiled using **`/clr`** or **`/clr:pure`**. However, the **`/clr:pure`** compiler option is deprecated in Visual Studio 2015 and unsupported in Visual Studio 2017 and later.
-A `PInvoke` call is generated by the linker when the linker cannot find a managed symbol to satisfy a reference from a managed caller but can find a native symbol to satisfy that reference. For more information about `PInvoke`, see [Calling Native Functions from Managed Code](../../dotnet/calling-native-functions-from-managed-code.md).
+A `PInvoke` call is generated by the linker when the linker can't find a managed symbol to satisfy a reference from a managed caller but can find a native symbol to satisfy that reference. For more information about `PInvoke`, see [Calling Native Functions from Managed Code](../../dotnet/calling-native-functions-from-managed-code.md).
-Note that if you use in your code, you should explicitly set **/CLRUNMANAGEDCODECHECK** to remove the **SuppressUnmanagedCodeSecurity** attribute. It is a potential security vulnerability if an image contains both the **SuppressUnmanagedCodeSecurity** and **AllowPartiallyTrustedCallers** attributes.
+If you use in your code, you should explicitly set **`/CLRUNMANAGEDCODECHECK`** to remove the `SuppressUnmanagedCodeSecurity` attribute. It's a potential security vulnerability if an image contains both the `SuppressUnmanagedCodeSecurity` and `AllowPartiallyTrustedCallers` attributes.
-See [Secure Coding Guidelines for Unmanaged Code](/previous-versions/dotnet/framework/windows-identity-foundation/secure-coding-guidelines-for-unmanaged-code) for more information about the implications of using **SuppressUnmanagedCodeSecurityAttribute**.
+For more information about the implications of using `SuppressUnmanagedCodeSecurityAttribute`, see [Secure Coding Guidelines for Unmanaged Code](/previous-versions/dotnet/framework/windows-identity-foundation/secure-coding-guidelines-for-unmanaged-code).
### To set this linker option in the Visual Studio development environment
-1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+1. Open the **Property Pages** dialog box for the project. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
1. Select the **Configuration Properties** > **Linker** > **Advanced** property page.
@@ -43,5 +44,5 @@ See [Secure Coding Guidelines for Unmanaged Code](/previous-versions/dotnet/fram
## See also
-- [MSVC linker reference](linking.md)
-- [MSVC Linker Options](linker-options.md)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/command-line-property-pages.md b/docs/build/reference/command-line-property-pages.md
index 9f7efcc20a..3e5ab9a2c5 100644
--- a/docs/build/reference/command-line-property-pages.md
+++ b/docs/build/reference/command-line-property-pages.md
@@ -1,20 +1,33 @@
---
-description: "Learn more about: Command Line Property Pages"
-title: "Command Line Property Pages"
-ms.date: "11/04/2016"
+description: "Learn more about: Command line property pages"
+title: "Command line property pages"
+ms.date: 09/21/2022
f1_keywords: ["vc.project.AdditionalOptionsPage", "vc.project.CommandLinePage"]
helpviewer_keywords: ["Command Line property pages"]
ms.assetid: e1721b6c-8b39-4b44-a41e-69b5bb470cc9
---
-# Command Line Property Pages
+# Command line property pages
-Most property page folders contain a **Command Line** property page. This page displays which properties are set in the folder. The **Command Line** property page also contains an **Additional Options** box where you can specify properties that are valid for the tool but for which there is no property in the folder.
+Most property page folders that correspond with a command-line tool contain a **Command Line** property page. For information on how to access the **Command Line** property pages, see [Set compiler and build properties](../working-with-project-properties.md).
-Any command that you enter in the edit box will be passed through to the tool for the folder. No verification or checks will be done on the input, nor will there be any dependency checking.
+## Command Line property page
-For information on how to access the **Command Line** property pages, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+### All Options
+
+The **All Options** display-only control shows the tool command line created by the properties set in the folder.
+
+### Additional Options
+
+This property's edit control lets you specify other command-line options that are valid for the tool but that don't have a corresponding property.
+
+The options that you enter in the edit box are passed through to the tool for the folder after the options listed in **All Options**. No verification or validity checks are done on the options you enter, and there's no dependency checking.
## See also
-[C++ project property page reference](property-pages-visual-cpp.md)
-[.Lib Files as Linker Input](dot-lib-files-as-linker-input.md)
+[Windows C++ project property page reference](property-pages-visual-cpp.md)\
+[Linux C++ property page reference](../../linux/prop-pages-linux.md)\
+[Linker property pages](./linker-property-pages.md)\
+[Manifest tool property pages](manifest-tool-property-pages.md)\
+[MIDL property pages](midl-property-pages.md)\
+[NMake property page](nmake-property-page.md)\
+[XML document generator tool property pages](xml-document-generator-tool-property-pages.md)
diff --git a/docs/build/reference/commands-in-a-makefile.md b/docs/build/reference/commands-in-a-makefile.md
index 05a0f36f14..9929e2f05b 100644
--- a/docs/build/reference/commands-in-a-makefile.md
+++ b/docs/build/reference/commands-in-a-makefile.md
@@ -18,7 +18,7 @@ A command preceded by a semicolon (**`;`**) can appear on a dependency line or i
project.obj : project.c project.h ; cl /c project.c
```
-## Command modifiers
+## Command modifiers
You can specify one or more command modifiers preceding a command, optionally separated by spaces or tabs. As with commands, modifiers must be indented.
@@ -28,7 +28,7 @@ You can specify one or more command modifiers preceding a command, optionally se
| **`-`**\[*number*] *command* | Turns off error checking for *command*. By default, NMAKE halts when a command returns a nonzero exit code. If *-number* is used, NMAKE stops if the exit code exceeds *number*. Spaces or tabs can't appear between the dash and *number.* At least one space or tab must appear between *number* and *command*. Use **`/I`** to turn off error checking for the entire makefile; use **`.IGNORE`** to turn off error checking for part of the makefile. |
| **`!`** *command* | Executes *command* for each dependent file if *command* uses **`$**`** (all dependent files in the dependency) or **`$?`** (all dependent files in the dependency with a later timestamp than the target). |
-## Filename-parts syntax
+## Filename-parts syntax
Filename-parts syntax in commands represents components of the first dependent filename (which may be an implied dependent). Filename components are the file's drive, path, base name, and extension as specified, not as it exists on disk. Use **`%s`** to represent the complete filename. Use **`%|`**\[*parts*]**`F`** (a vertical bar character follows the percent symbol) to represent parts of the filename, where *parts* can be zero or more of the following letters, in any order.
diff --git a/docs/build/reference/common-macros-for-build-commands-and-properties.md b/docs/build/reference/common-macros-for-build-commands-and-properties.md
index 6cee9dc83c..dfe8c6a5c0 100644
--- a/docs/build/reference/common-macros-for-build-commands-and-properties.md
+++ b/docs/build/reference/common-macros-for-build-commands-and-properties.md
@@ -1,77 +1,87 @@
---
description: "Learn more about: Common macros for MSBuild commands and properties"
title: "Common macros for MSBuild commands and properties"
-ms.date: "08/02/2019"
+ms.date: 01/12/2024
helpviewer_keywords: ["$(FrameworkSDKDir) macro", "ProjectName macro $(ProjectName)", "DevEnvDir macro $(DevEnvDir)", "$(DevEnvDir) macro", "TargetPath macro $(TargetPath)", "VSInstallDir macro $(VSInstallDir)", "$(InputFileName) macro", "$(SolutionFileName) macro", "macros [C++], build macros", "InputFileName macro $(InputFileName)", "$(VCInstallDir) macro", "$(IntDir) macro", "$(ConfigurationName) macro", "SolutionDir macro $(SolutionDir)", "$(TargetPath) macro", "$(Inherit) macro", "$(SolutionPath) macro", "WebDeployRoot macro $(WebDeployRoot)", "WebDeployPath macro $(WebDeployPath)", "StopEvaluating macro $(StopEvaluating)", "$(RootNamespace) macro", "$(WebDeployRoot) macro", "ProjectPath macro $(ProjectPath)", "$(ProjectPath) macro", "$(InputDir) macro", "SolutionName macro $(SolutionName)", "ProjectExt macro $(ProjectExt)", "$(TargetExt) macro", "$(ProjectFileName) macro", "TargetName macro $(TargetName)", "$(References) macro", "References macro $(References)", "TargetExt macro $(TargetExt)", "ProjectDir macro $(ProjectDir)", "$(TargetDir) macro", "SolutionExt macro $(SolutionExt)", "$(SolutionDir) macro", "ProjectFileName macro $(ProjectFileName)", "VCInstallDir macro $(VCInstallDir)", "$(InputExt) macro", "$(TargetFileName) macro", "$(SolutionExt) macro", "PlatformName macro $(PlatformName)", "IntDir macro $(IntDir)", "$(FrameworkVersion) macro", "$(ProjectDir) macro", "build macros [C++]", "InputPath macro $(InputPath)", "$(VSInstallDir) macro", "$(WebDeployPath) macro", "TargetFileName macro $(TargetFileName)", "NoInherit macro $(NoInherit)", "ConfigurationName macro $(ConfigurationName)", "$(ProjectExt) macro", "TargetDir macro $(TargetDir)", "InputName macro $(InputName)", "$(ProjectName) macro", "FrameworkSDKDir macro $(FrameworkSDKDir)", "$(ParentName) macro", "InputExt macro $(InputExt)", "$(SafeRootNamespace) macro", "InputDir macro $(InputDir)", "$(FxCopDir) macro", "$(RemoteMachine) macro", "Inherit macro $(Inherit)", "FrameworkVersion macro $(FrameworkVersion)", "$(StopEvaluating) macro", "$(OutDir) macro", "FrameworkDir macro $(FrameworkDir)", "SolutionFileName macro $(SolutionFileName)", "$(NoInherit) macro", "RemoteMachine macro $(RemoteMachine)", "properties [C++], build property macros", "$(TargetName) macro", "$(SolutionName) macro", "$(InputPath) macro", "ParentName macro $(ParentName)", "OutDir macro $(OutDir)", "SafeRootNamespace macro $(SafeRootNamespace)", "FxCopDir macro $(FxCopDir)", "$(InputName) macro", "RootNamespace macro $(RootNamespace)", "builds [C++], macros", "$(FrameworkDir) macro", "$(PlatformName) macro", "$(PlatformShortName) macro","SolutionPath macro $(SolutionPath)"]
-ms.assetid: 239bd708-2ea9-4687-b264-043f1febf98b
---
# Common macros for MSBuild commands and properties
-Depending on your installation options, Visual Studio can make hundreds of macros available to you in a Visual Studio project (based on MSBuild). They correspond to the MSBuild properties that are set by default, or in .props or .targets files, or in your project settings. You can use these macros anywhere in a project's **Property Pages** dialog box where strings are accepted. These macros aren't case-sensitive.
+Depending on your installation options, Visual Studio can make hundreds of macros available to you in an MSBuild-based *`.vcxproj`* Visual Studio project. The macros correspond to the MSBuild properties that are set by default, or in *`.props`* or *`.targets`* files, or in your project settings. You can use these macros anywhere in a project's **Property Pages** dialog box where strings are accepted. These macros aren't case-sensitive.
## View the current properties and macros
-To display all of the currently available macros, in the **Property Pages** dialog, under **VC++ Directories**, choose the drop-down arrow at the end of a property row. Click on **Edit** and then in the edit dialog box, choose the **Macros** button. The current set of properties and macros visible to Visual Studio is listed along with the current value for each. For more information, see the **Specifying User-Defined Values** section of [C++ project property page reference](property-pages-visual-cpp.md).
+To display all of the currently available macros, open the project property pages from the main menu by selecting **Project** > **Properties**. In the **Property Pages** dialog, choose an entry that has a macro in it. You can recognize a macro by the dollar sign and parenthesis that surround its name.
-
+For example, in the left pane, select **Configuration Properties** > **VC++ Directories**, and then in the right pane, select **Include directories**. The value for **Include directories** is `$(VC_IncludePath);$(WindowsSDK_IncludePath);`.
+
+The dollar sign and parenthesis surrounding these two values indicates that they're macros. The expansion of those two macros sets the include directories to search.
+
+Select **Include Directories** and a dropdown appears at the end of the row. Select the dropdown button, then select **Edit**. In the **Include Directories** dialog box that appears, select the **Macros>>** button.
+
+That expands the dialog to show the current set of properties and macros visible to Visual Studio, along with the current value for each. For more information, see the **Specifying User-Defined Values** section of [C++ project property page reference](property-pages-visual-cpp.md).
+
+:::image type="complex" source="../media/vcppdir_libdir_macros.png" alt-text="Screenshot of the Visual Studio Include Directories dialog after choosing the Macros button.":::
+On the right is a list of Visual Studio macros such as $(AllowLocalNetworkLoopback). The left pane shows the evaluated value of the include directory property. The bottom pane shows which macros were expanded, if any, to produce the include directory property value. Because the Include Directories macro is a combination of two other macros, $(VC_IncludePath) and $(WindowsSDK_IncludePath), the bottom pane, labeled Inherited values, lists those two macros.
+:::image-end:::
## List of common macros
-This table describes a commonly used subset of the available macros; there are many more not listed here. Go to the **Macros** dialog to see all of the properties and their current values in your project. For details on how MSBuild property definitions are created and used as macros in .props, .targets, and .vcxproj files, see [MSBuild Properties](/visualstudio/msbuild/msbuild-properties).
-
-|Macro|Description|
-|-----------|-----------------|
-|**$(Configuration)**|The name of the current project configuration, for example, "Debug".|
-|**$(DevEnvDir)**|The installation directory of Visual Studio (defined as drive + path); includes the trailing backslash '\\'.|
-|**$(FrameworkDir)**|The directory into which the .NET Framework was installed.|
-|**$(FrameworkSDKDir)**|The directory into which you installed the .NET Framework. The .NET Framework could have been installed as part of Visual Studio or separately.|
-|**$(FrameworkVersion)**|The version of the .NET Framework used by Visual Studio. Combined with **$(FrameworkDir)**, the full path to the version of the .NET Framework use by Visual Studio.|
-|**$(FxCopDir)**|The path to the fxcop.cmd file. The fxcop.cmd file is not installed with all Visual Studio editions.|
-|**$(IntDir)**|Path to the directory specified for intermediate files. If it's a relative path, intermediate files go to this path appended to the project directory. This path should have a trailing slash. It resolves to the value for the **Intermediate Directory** property. Don't use **$(OutDir)** to define this property.|
-|**$(OutDir)**|Path to the output file directory. If it's a relative path, output files go to this path appended to the project directory. This path should have a trailing slash. It resolves to the value for the **Output Directory** property. Don't use **$(IntDir)** to define this property.|
-|**$(Platform)**|The name of current project platform, for example, "Win32".|
-|**$(PlatformShortName)**|The short name of current architecture, for example, "x86" or "x64".|
-|**$(ProjectDir)**|The directory of the project (defined as drive + path); includes the trailing backslash '\\'.|
-|**$(ProjectExt)**|The file extension of the project. It includes the '.' before the file extension.|
-|**$(ProjectFileName)**|The file name of the project (defined as base name + file extension).|
-|**$(ProjectName)**|The base name of the project.|
-|**$(ProjectPath)**|The absolute path name of the project (defined as drive + path + base name + file extension).|
-|**$(PublishDir)**|The output location for the publish target; includes the trailing backslash '\\'. Defaults to the **$(OutDir)app.publish\\** folder.|
-|**$(RemoteMachine)**|Set to the value of the **Remote Machine** property on the Debug property page. See [Changing Project Settings for a C/C++ Debug Configuration](/visualstudio/debugger/project-settings-for-a-cpp-debug-configuration) for more information.|
-|**$(RootNameSpace)**|The namespace, if any, containing the application.|
-|**$(SolutionDir)**|The directory of the solution (defined as drive + path); includes the trailing backslash '\\'. Defined only when building a solution in the IDE.|
-|**$(SolutionExt)**|The file extension of the solution. It includes the '.' before the file extension. Defined only when building a solution in the IDE.|
-|**$(SolutionFileName)**|The file name of the solution (defined as base name + file extension). Defined only when building a solution in the IDE.|
-|**$(SolutionName)**|The base name of the solution. Defined only when building a solution in the IDE.|
-|**$(SolutionPath)**|The absolute path name of the solution (defined as drive + path + base name + file extension). Defined only when building a solution in the IDE.|
-|**$(TargetDir)**|The directory of the primary output file for the build (defined as drive + path); includes the trailing backslash '\\'.|
-|**$(TargetExt)**|The file extension of the primary output file for the build. It includes the '.' before the file extension.|
-|**$(TargetFileName)**|The file name of the primary output file for the build (defined as base name + file extension).|
-|**$(TargetName)**|The base name of the primary output file for the build.|
-|**$(TargetPath)**|The absolute path name of the primary output file for the build (defined as drive + path + base name + file extension).|
-|**$(VCInstallDir)**|The directory that contains the C++ content of your Visual Studio installation. This property contains the version of the targeted Microsoft C++ (MSVC) toolset, which might be different that the host Visual Studio. For example, when building with `$(PlatformToolset) = v140`, **$(VCInstallDir)** contains the path to the Visual Studio 2015 installation.|
-|**$(VSInstallDir)**|The directory into which you installed Visual Studio. This property contains the version of the targeted Visual Studio toolset, which might be different that the host Visual Studio. For example, when building with `$(PlatformToolset) = v110`, **$(VSInstallDir)** contains the path to the Visual Studio 2012 installation.|
-|**$(WebDeployPath)**|The relative path from the web deployment root to where the project outputs belong.|
-|**$(WebDeployRoot)**|The absolute path to the location of **\**. For example, c:\inetpub\wwwroot.|
+This table describes a commonly used subset of the available macros; there are many more not listed here. Go to the **Macros** dialog to see all of the properties and their current values in your project. For details on how MSBuild property definitions are created and used as macros in *`.props`*, *`.targets`*, and *`.vcxproj`* files, see [MSBuild Properties](/visualstudio/msbuild/msbuild-properties).
+
+| Macro | Description |
+|--|--|
+| **`$(Configuration)`** | The name of the current project configuration, for example, "Debug". |
+| **`$(DevEnvDir)`** | The installation directory of Visual Studio (defined as drive + path); includes the trailing backslash (\\). |
+| **`$(FrameworkDir)`** | The directory into which the .NET Framework was installed. |
+| **`$(FrameworkSDKDir)`** | The directory into which you installed the .NET Framework. The .NET Framework may have been installed as part of Visual Studio or separately. |
+| **`$(FrameworkVersion)`** | The version of the .NET Framework used by Visual Studio. Combined with **`$(FrameworkDir)`**, the full path to the version of the .NET Framework use by Visual Studio. |
+| **`$(FxCopDir)`** | The path to the *`fxcop.cmd`* file. The *`fxcop.cmd`* file isn't installed in all Visual Studio editions. |
+| **`$(IntDir)`** | Path to the directory specified for intermediate files. If it's a relative path, intermediate files go to this path appended to the project directory. This path should have a trailing backslash (\\). It resolves to the value for the **Intermediate Directory** property. Don't use **`$(OutDir)`** to define this property. |
+| **`$(OutDir)`** | Path to the output file directory. If it's a relative path, output files go to this path appended to the project directory. This path should have a trailing backslash (\\). It resolves to the value for the **Output Directory** property. Don't use **`$(IntDir)`** to define this property. |
+| **`$(Platform)`** | The name of current project platform, for example, "Win32". |
+| **`$(PlatformShortName)`** | The short name of current architecture, for example, "x86" or "x64". |
+| **`$(ProjectDir)`** | The directory of the project (defined as drive + path); includes the trailing backslash (\\). |
+| **`$(ProjectExt)`** | The file extension of the project. It includes the '.' before the file extension. |
+| **`$(ProjectFileName)`** | The file name of the project (defined as base name + file extension). |
+| **`$(ProjectName)`** | The base name of the project. |
+| **`$(ProjectPath)`** | The absolute path name of the project (defined as drive + path + base name + file extension). |
+| **`$(PublishDir)`** | The output location for the publish target; includes the trailing backslash (\\). Defaults to the **`$(OutDir)app.publish\`** folder. |
+| **`$(RemoteMachine)`** | Set to the value of the **Remote Machine** property on the Debug property page. For more information, see [Changing Project Settings for a C/C++ Debug Configuration](/visualstudio/debugger/project-settings-for-a-cpp-debug-configuration). |
+| **`$(RootNameSpace)`** | The namespace, if any, containing the application. |
+| **`$(SolutionDir)`** | The directory of the solution (defined as drive + path); includes the trailing backslash (\\). Defined only when building a solution in the IDE. |
+| **`$(SolutionExt)`** | The file extension of the solution. It includes the '.' before the file extension. Defined only when building a solution in the IDE. |
+| **`$(SolutionFileName)`** | The file name of the solution (defined as base name + file extension). Defined only when building a solution in the IDE. |
+| **`$(SolutionName)`** | The base name of the solution. Defined only when building a solution in the IDE. |
+| **`$(SolutionPath)`** | The absolute path name of the solution (defined as drive + path + base name + file extension). Defined only when building a solution in the IDE. |
+| **`$(TargetDir)`** | The directory of the primary output file for the build (defined as drive + path); includes the trailing backslash (\\). |
+| **`$(TargetExt)`** | The file extension of the primary output file for the build. It includes the '.' before the file extension. |
+| **`$(TargetFileName)`** | The file name of the primary output file for the build (defined as base name + file extension). |
+| **`$(TargetName)`** | The base name of the primary output file for the build. |
+| **`$(TargetPath)`** | The absolute path name of the primary output file for the build (defined as drive + path + base name + file extension). |
+| **`$(VCInstallDir)`** | The directory that contains the C++ content of your Visual Studio installation. This property contains the version of the targeted Microsoft C++ (MSVC) toolset, which might be different that the host Visual Studio. For example, when building with `$(PlatformToolset) = v140`, **`$(VCInstallDir)`** contains the path to the Visual Studio 2015 installation. |
+| **`$(VSInstallDir)`** | The directory into which you installed Visual Studio. This property contains the version of the targeted Visual Studio toolset, which might be different that the host Visual Studio. For example, when building with `$(PlatformToolset) = v110`, **`$(VSInstallDir)`** contains the path to the Visual Studio 2012 installation. |
+| **`$(WebDeployPath)`** | The relative path from the web deployment root to where the project outputs belong. |
+| **`$(WebDeployRoot)`** | The absolute path to the location of **``**. For example, *`c:\inetpub\wwwroot`*. |
## Obsolete macros
-The build system for C++ was significantly changed between Visual Studio 2008 and Visual Studio 2010. Many macros used in earlier project types have been changed to new ones. These macros are no longer used or have been replaced by one or more equivalent properties or [item metadata macro](/visualstudio/msbuild/itemmetadata-element-msbuild) (**%(**_name_**)**) values. Macros that are marked "migrated" can be updated by the project migration tool. If the project that contains the macro is migrated from Visual Studio 2008 or earlier to Visual Studio 2010, Visual Studio converts the macro to the equivalent current macro. Later versions of Visual Studio can't convert projects from Visual Studio 2008 and earlier to the new project type. You must convert these projects in two steps; first convert them to Visual Studio 2010, and then convert the result to your newer version of Visual Studio. For more information, see [Overview of potential upgrade issues](../../porting/overview-of-potential-upgrade-issues-visual-cpp.md).
+The build system for C++ was changed significantly between Visual Studio 2008 and Visual Studio 2010. Many macros used in earlier project types changed to new ones. These macros are no longer used or are replaced by one or more equivalent properties or [item metadata macro](/visualstudio/msbuild/itemmetadata-element-msbuild) (**`%(item-name)`**) values. The migration tool can update macros marked "migrated". If a project containing the macro is migrated from Visual Studio 2008 or earlier to Visual Studio 2010, Visual Studio converts the macro to the equivalent current macro. Later versions of Visual Studio can't convert projects from Visual Studio 2008 and earlier to the new project type. You must convert these projects in two steps; first convert them to Visual Studio 2010, and then convert the result to your newer version of Visual Studio. For more information, see [Overview of potential upgrade issues](../../porting/overview-of-potential-upgrade-issues-visual-cpp.md).
-|Macro|Description|
-|-----------|-----------------|
-|**$(InputDir)**|(Migrated.) The directory of the input file (defined as drive + path); includes the trailing backslash '\\'. If the project is the input, then this macro is equivalent to **$(ProjectDir)**.|
-|**$(InputExt)**|(Migrated.) The file extension of the input file. It includes the '.' before the file extension. If the project is the input, then this macro is equivalent to **$(ProjectExt)**. For source files, this is **%(Extension)**.|
-|**$(InputFileName)**|(Migrated.) The file name of the input file (defined as base name + file extension). If the project is the input, then this macro is equivalent to **$(ProjectFileName)**. For source files, this is **%(Identity)**.|
-|**$(InputName)**|(Migrated.) The base name of the input file. If the project is the input, then this macro is equivalent to **$(ProjectName)**. For source files, this is **%(Filename)**.|
-|**$(InputPath)**|(Migrated.) The absolute path name of the input file (defined as drive + path + base name + file extension). If the project is the input, then this macro is equivalent to **$(ProjectPath)**. For source files, this is **%(FullPath)**.|
-|**$(ParentName)**|Name of the item containing this project item. This will be the parent folder name, or project name.|
-|**$(SafeInputName)**|The name of the file as a valid class name, minus file extension. This property does not have an exact equivalent.|
-|**$(SafeParentName)**|The name of the immediate parent in valid name format. For example, a form is the parent of a .resx file. This property does not have an exact equivalent.|
-|**$(SafeRootNamespace)**|The namespace name in which the project wizards will add code. This namespace name will only contain characters that would be permitted in a valid C++ identifier. This property does not have an exact equivalent.|
+| Macro | Description |
+|--|--|
+| **`$(InputDir)`** | (Migrated.) The directory of the input file (defined as drive + path); includes the trailing backslash (\\). If the project is the input, then this macro is equivalent to **`$(ProjectDir)`**. |
+| **`$(InputExt)`** | (Migrated.) The file extension of the input file. It includes the '.' before the file extension. If the project is the input, then this macro is equivalent to **`$(ProjectExt)`**. For source files, it's equivalent to **`%(Extension)`**. |
+| **`$(InputFileName)`** | (Migrated.) The file name of the input file (defined as base name + file extension). If the project is the input, then this macro is equivalent to **`$(ProjectFileName)`**. For source files, it's equivalent to **`%(Identity)`**. |
+| **`$(InputName)`** | (Migrated.) The base name of the input file. If the project is the input, then this macro is equivalent to **`$(ProjectName)`**. For source files, it's equivalent to **`%(Filename)`**. |
+| **`$(InputPath)`** | (Migrated.) The absolute path name of the input file (defined as drive + path + base name + file extension). If the project is the input, then this macro is equivalent to **`$(ProjectPath)`**. For source files, it's equivalent to **`%(FullPath)`**. |
+| **`$(ParentName)`** | Name of the item containing this project item. This macro is the parent folder name, or project name. |
+| **`$(SafeInputName)`** | The name of the file as a valid class name, minus file extension. This property doesn't have an exact equivalent. |
+| **`$(SafeParentName)`** | The name of the immediate parent in valid name format. For example, a form is the parent of a *`.resx`* file. This property doesn't have an exact equivalent. |
+| **`$(SafeRootNamespace)`** | The namespace name where the project wizards should add code. This namespace name only contains characters that would be permitted in a valid C++ identifier. This property doesn't have an exact equivalent. |
## See also
[Visual Studio Projects - C++](../creating-and-managing-visual-cpp-projects.md)\
[Visual C++ porting and upgrading guide](../../porting/visual-cpp-porting-and-upgrading-guide.md)\
-[Overview of potential upgrade issues](../../porting/overview-of-potential-upgrade-issues-visual-cpp.md)
+[Overview of potential upgrade issues](../../porting/overview-of-potential-upgrade-issues-visual-cpp.md)\
+[MSBuild well-known item metadata](/visualstudio/msbuild/msbuild-well-known-item-metadata)
diff --git a/docs/build/reference/compiler-command-line-syntax.md b/docs/build/reference/compiler-command-line-syntax.md
index 8cea8f4ff5..0f56baaed5 100644
--- a/docs/build/reference/compiler-command-line-syntax.md
+++ b/docs/build/reference/compiler-command-line-syntax.md
@@ -17,10 +17,10 @@ The following table describes input to the CL command.
|Entry|Meaning|
|-----------|-------------|
-|*option*|One or more [CL options](compiler-options.md). Note that all options apply to all specified source files. Options are specified by either a forward slash (/) or a dash (-). If an option takes an argument, the option's description documents whether a space is allowed between the option and the arguments. Option names (except for the /HELP option) are case sensitive. See [Order of CL Options](order-of-cl-options.md) for more information.|
-|`file`|The name of one or more source files, .obj files, or libraries. CL compiles source files and passes the names of the .obj files and libraries to the linker. See [CL Filename Syntax](cl-filename-syntax.md) for more information.|
+|*option*|One or more [CL options](compiler-options.md). All options apply to all specified source files. Specify options using either a forward slash (/) or a dash (-). Generally, there can't be a space between the option and argument. The option's description states when a space is allowed. Options are case-sensitive--except for `/HELP`. For more information, see [Order of CL Options](order-of-cl-options.md).|
+|`file`|The name of one or more source files, .obj files, or libraries. CL compiles source files and passes the names of the .obj files and libraries to the linker. For more information, see [CL Filename Syntax](cl-filename-syntax.md).|
|*lib*|One or more library names. CL passes these names to the linker.|
-|*command-file*|A file that contains multiple options and filenames. See [CL Command Files](cl-command-files.md) for more information.|
+|*command-file*|A file that contains multiple options and filenames. For more information, see [CL Command Files](cl-command-files.md).|
|*link-opt*|One or more [MSVC Linker Options](linker-options.md). CL passes these options to the linker.|
You can specify any number of options, filenames, and library names, as long as the number of characters on the command line does not exceed 1024, the limit dictated by the operating system.
diff --git a/docs/build/reference/compiler-option-warning-level.md b/docs/build/reference/compiler-option-warning-level.md
index 4b89c26f11..251396f31f 100644
--- a/docs/build/reference/compiler-option-warning-level.md
+++ b/docs/build/reference/compiler-option-warning-level.md
@@ -1,8 +1,8 @@
---
title: "/w, /W0, /W1, /W2, /W3, /W4, /w1, /w2, /w3, /w4, /Wall, /wd, /we, /wo, /Wv, /WX (Warning level)"
description: "Reference for the Microsoft C/C++ compiler options: /w, /W0, /W1, /W2, /W3, /W4, /w1, /w2, /w3, /w4, /Wall, /wd, /we, /wo, /Wv, and /WX."
-ms.date: "01/31/2020"
-f1_keywords: ["VC.Project.VCCLCompilerTool.DisableSpecificWarnings", "VC.Project.VCCLCompilerTool.WarningLevel", "VC.Project.VCCLWCECompilerTool.DisableSpecificWarnings", "VC.Project.VCCLCompilerTool.WarnAsError", "VC.Project.VCCLWCECompilerTool.WarnAsError", "/wx", "VC.Project.VCCLWCECompilerTool.WarningLevel", "/wall", "VC.Project.VCCLCompilerTool.TreatSpecificWarningsAsErrors", "/Wv", "/w0", "/w1", "/w2", "/w3", "/w4", "/wd", "/we", "/wo"]
+ms.date: 02/17/2022
+f1_keywords: ["VC.Project.VCCLCompilerTool.DisableSpecificWarnings", "VC.Project.VCCLCompilerTool.WarningLevel", "VC.Project.VCCLWCECompilerTool.DisableSpecificWarnings", "VC.Project.VCCLCompilerTool.WarnAsError", "VC.Project.VCCLWCECompilerTool.WarnAsError", "VC.Project.VCCLCompilerTool.WarningVersion", "/wx", "VC.Project.VCCLWCECompilerTool.WarningLevel", "/wall", "VC.Project.VCCLCompilerTool.TreatSpecificWarningsAsErrors", "/Wv", "/w0", "/w1", "/w2", "/w3", "/w4", "/wd", "/we", "/wo"]
helpviewer_keywords: ["/W1 compiler option [C++]", "w compiler option [C++]", "-wo compiler option [C++]", "Warning Level compiler option", "W1 compiler option [C++]", "-we compiler option [C++]", "/WX compiler option [C++]", "-wd compiler option [C++]", "WX compiler option [C++]", "wo compiler option [C++]", "Wall compiler option [C++]", "/w compiler option", "W2 compiler option [C++]", "-W2 compiler option [C++]", "wd compiler option [C++]", "/we compiler option [C++]", "we compiler option [C++]", "-W1 compiler option [C++]", "-W4 compiler option [C++]", "-Wall compiler option [C++]", "/Wall compiler option [C++]", "-W0 compiler option [C++]", "W0 compiler option [C++]", "-WX compiler option [C++]", "/wo compiler option [C++]", "W4 compiler option [C++]", "W3 compiler option [C++]", "/wd compiler option [C++]", "warnings, as errors compiler option", "/W3 compiler option [C++]", "/W0 compiler option [C++]", "/W4 compiler option [C++]", "-W3 compiler option [C++]", "-w compiler option [C++]", "/W2 compiler option [C++]", "/Wv compiler option [C++]"]
---
# /w, /W0, /W1, /W2, /W3, /W4, /w1, /w2, /w3, /w4, /Wall, /wd, /we, /wo, /Wv, /WX (Warning level)
diff --git a/docs/build/reference/compiler-options-listed-alphabetically.md b/docs/build/reference/compiler-options-listed-alphabetically.md
index 8a8a2ff7bc..686023b214 100644
--- a/docs/build/reference/compiler-options-listed-alphabetically.md
+++ b/docs/build/reference/compiler-options-listed-alphabetically.md
@@ -1,7 +1,7 @@
---
title: "Compiler options listed alphabetically"
description: "Reference listing in alphabetical order of the Microsoft C/C++ compiler command-line options."
-ms.date: 12/15/2021
+ms.date: 2/5/2025
helpviewer_keywords: ["compiler options, C++"]
---
# Compiler options listed alphabetically
@@ -16,7 +16,8 @@ This table contains an alphabetical list of compiler options. For a list of comp
| [`/?`](help-compiler-command-line-help.md) | Lists the compiler options. |
| [`/AI`](ai-specify-metadata-directories.md) | Specifies a directory to search to resolve file references passed to the [`#using`](../../preprocessor/hash-using-directive-cpp.md) directive. |
| [`/analyze`](analyze-code-analysis.md) | Enables code analysis. |
-| [`/arch:`](arch-x86.md) | Minimum CPU architecture requirements. IA32, SSE, and SSE2 are x86 only. |
+| [`/arch`](arch-minimum-cpu-architecture.md) | Minimum CPU architecture requirements. |
+| `/arm64EC` | Generate code compatible with the arm64EC ABI. |
| [`/await`](await-enable-coroutine-support.md) | Enable coroutines (resumable functions) extensions. |
| [`/await:strict`](await-enable-coroutine-support.md) | Enable standard C++20 coroutine support with earlier language versions. |
| [`/bigobj`](bigobj-increase-number-of-sections-in-dot-obj-file.md) | Increases the number of addressable sections in an .obj file. |
@@ -36,6 +37,7 @@ This table contains an alphabetical list of compiler options. For a list of comp
| [`/constexpr:depth`](constexpr-control-constexpr-evaluation.md) | Recursion depth limit for `constexpr` evaluation (default: 512). |
| [`/constexpr:steps`](constexpr-control-constexpr-evaluation.md) | Terminate `constexpr` evaluation after N steps (default: 100000) |
| [`/D{=|#}`](d-preprocessor-definitions.md) | Defines constants and macros. |
+| [`/dynamicdeopt`](dynamic-deopt.md) | Enable [C++ Dynamic Debugging (Preview)](/visualstudio/debugger/cpp-dynamic-debugging) and step in anywhere with on-demand function deoptimization. |
| [`/diagnostics`](diagnostics-compiler-diagnostic-options.md) | Diagnostics format: prints column information. |
| [`/diagnostics:caret[-]`](diagnostics-compiler-diagnostic-options.md) | Diagnostics format: prints column and the indicated line of source. |
| [`/diagnostics:classic`](diagnostics-compiler-diagnostic-options.md) | Use legacy diagnostics format. |
@@ -46,8 +48,9 @@ This table contains an alphabetical list of compiler options. For a list of comp
| [`/EHr`](eh-exception-handling-model.md) | Always generate `noexcept` runtime termination checks. |
| [`/EHs`](eh-exception-handling-model.md) | Enable C++ exception handling (no SEH exceptions). |
| [`/EP`](ep-preprocess-to-stdout-without-hash-line-directives.md) | Copies preprocessor output to standard output. |
-| [`/errorReport`](errorreport-report-internal-compiler-errors.md) | Deprecated. Error reporting is controlled by [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings. |
+| [`/errorReport`](errorreport-report-internal-compiler-errors.md) | Deprecated. [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings control error reporting. |
| [`/execution-charset`](execution-charset-set-execution-character-set.md) | Set execution character set. |
+| [`/experimental:log`](experimental-log.md) | Enables experimental structured SARIF output. |
| [`/experimental:module`](experimental-module.md) | Enables experimental module support. |
| [`/exportHeader`](module-exportheader.md) | Create the header units files (*`.ifc`*) specified by the input arguments. |
| [`/external:anglebrackets`](external-external-headers-diagnostics.md) | Treat all headers included via `<>` as external. |
@@ -63,6 +66,8 @@ This table contains an alphabetical list of compiler options. For a list of comp
| [`/FC`](fc-full-path-of-source-code-file-in-diagnostics.md) | Displays the full path of source code files passed to *cl.exe* in diagnostic text. |
| [`/Fd`](fd-program-database-file-name.md) | Renames program database file. |
| [`/Fe`](fe-name-exe-file.md) | Renames the executable file. |
+| [`/feature`](feature-arm64.md) | Enable architecture features.17.10 |
+| [`/forceInterlockedFunctions`](force-interlocked-functions.md) | Dynamically selects between Armv8.0 load, store exclusive instructions or Armv8.1 LSE atomic instructions based on target CPU.17.14 |
| [`/FI`](fi-name-forced-include-file.md) | Preprocesses the specified include file. |
| [`/Fi`](fi-preprocess-output-file-name.md) | Specifies the preprocessed output file name. |
| [`/Fm`](fm-name-mapfile.md) | Creates a mapfile. |
@@ -80,7 +85,7 @@ This table contains an alphabetical list of compiler options. For a list of comp
| [`/fsanitize`](fsanitize.md) | Enables compilation of sanitizer instrumentation such as AddressSanitizer. |
| [`/fsanitize-coverage`](fsanitize-coverage.md) | Enables compilation of code coverage instrumentation for libraries such as LibFuzzer. |
| `/Ft` | Location of the header files generated for `#import`. |
-| [`/FU`](fu-name-forced-hash-using-file.md) | Forces the use of a file name, as if it had been passed to the [`#using`](../../preprocessor/hash-using-directive-cpp.md) directive. |
+| [`/FU`](fu-name-forced-hash-using-file.md) | Forces the use of a file name, as if it were passed to the [`#using`](../../preprocessor/hash-using-directive-cpp.md) directive. |
| [`/Fx`](fx-merge-injected-code.md) | Merges injected code with the source file. |
| [`/GA`](ga-optimize-for-windows-application.md) | Optimizes for Windows applications. |
| [`/Gd`](gd-gr-gv-gz-calling-convention.md) | Uses the **`__cdecl`** calling convention. (x86 only) |
@@ -111,9 +116,13 @@ This table contains an alphabetical list of compiler options. For a list of comp
| [`/homeparams`](homeparams-copy-register-parameters-to-stack.md) | Forces parameters passed in registers to be written to their locations on the stack upon function entry. This compiler option is only for the x64 compilers (native and cross compile). |
| [`/hotpatch`](hotpatch-create-hotpatchable-image.md) | Creates a hotpatchable image. |
| [`/I`](i-additional-include-directories.md) | Searches a directory for include files. |
+| [`/ifcOutput`](ifc-output.md) | Specify output file name or directory for built *`.ifc`* files. |
+| [`/interface`](interface.md) | Treat the input file as a module interface unit. |
+| [`/internalPartition`](internal-partition.md) | Treat the input file as an internal partition unit. |
| [`/J`](j-default-char-type-is-unsigned.md) | Changes the default **`char`** type. |
+| [`/jumptablerdata`](jump-table-rdata.md) | Put switch case statement jump tables in the `.rdata` section. |
| [`/JMC`](jmc.md) | Supports native C++ Just My Code debugging. |
-| [`/kernel`](kernel-create-kernel-mode-binary.md) | The compiler and linker will create a binary that can be executed in the Windows kernel. |
+| [`/kernel`](kernel-create-kernel-mode-binary.md) | The compiler and linker create a binary that can be executed in the Windows kernel. |
| [`/LD`](md-mt-ld-use-run-time-library.md) | Creates a dynamic-link library. |
| [`/LDd`](md-mt-ld-use-run-time-library.md) | Creates a debug dynamic-link library. |
| [`/link`](link-pass-options-to-linker.md) | Passes the specified option to LINK. |
@@ -159,7 +168,8 @@ This table contains an alphabetical list of compiler options. For a list of comp
| [`/RTCc`](rtc-run-time-error-checks.md) | Convert to smaller type checks at run-time. |
| [`/RTCs`](rtc-run-time-error-checks.md) | Enable stack frame runtime checks. |
| [`/RTCu`](rtc-run-time-error-checks.md) | Enables uninitialized local usage checks. |
-| [`/sdl`](sdl-enable-additional-security-checks.md) | Enable additional security features and warnings. |
+| [`/scanDependencies`](scandependencies.md) | List module dependencies in C++ Standard JSON form. |
+| [`/sdl`](sdl-enable-additional-security-checks.md) | Enable more security features and warnings. |
| [`/showIncludes`](showincludes-list-include-files.md) | Displays a list of all include files during compilation. |
| [`/source-charset`](source-charset-set-source-character-set.md) | Set source character set. |
| [`/sourceDependencies`](sourcedependencies.md) | List all source-level dependencies. |
@@ -170,6 +180,7 @@ This table contains an alphabetical list of compiler options. For a list of comp
| [`/std:c++latest`](std-specify-language-standard-version.md) | The latest draft C++ standard preview features. |
| [`/std:c11`](std-specify-language-standard-version.md) | C11 standard ISO/IEC 9899:2011. |
| [`/std:c17`](std-specify-language-standard-version.md) | C17 standard ISO/IEC 9899:2018. |
+| [`/std:clatest`](std-specify-language-standard-version.md) | The latest draft C standard preview features. |
| [`/TC`](tc-tp-tc-tp-specify-source-file-type.md) | Specifies all source files are C. |
| [`/Tc`](tc-tp-tc-tp-specify-source-file-type.md) | Specifies a C source file. |
| [`/TP`](tc-tp-tc-tp-specify-source-file-type.md) | Specifies all source files are C++. |
@@ -181,6 +192,7 @@ This table contains an alphabetical list of compiler options. For a list of comp
| [`/V`](v-version-number.md) | Deprecated. Sets the version string. |
| [`/validate-charset`](validate-charset-validate-for-compatible-characters.md) | Validate UTF-8 files for only compatible characters. |
| [`/vd{0|1|2}`](vd-disable-construction-displacements.md) | Suppresses or enables hidden `vtordisp` class members. |
+| [`/vlen`](vlen.md) | Specifies vector length. |
| [`/vmb`](vmb-vmg-representation-method.md) | Uses best base for pointers to members. |
| [`/vmg`](vmb-vmg-representation-method.md) | Uses full generality for pointers to members. |
| [`/vmm`](vmm-vms-vmv-general-purpose-representation.md) | Declares multiple inheritance. |
@@ -188,7 +200,7 @@ This table contains an alphabetical list of compiler options. For a list of comp
| [`/vmv`](vmm-vms-vmv-general-purpose-representation.md) | Declares virtual inheritance. |
| [`/volatile:iso`](volatile-volatile-keyword-interpretation.md) | Acquire/release semantics not guaranteed on volatile accesses. |
| [`/volatile:ms`](volatile-volatile-keyword-interpretation.md) | Acquire/release semantics guaranteed on volatile accesses. |
-| `/volatileMetadata` | Generate metadata on volatile memory accesses. |
+| [`/volatileMetadata`](volatile.md) | Generate metadata on volatile memory accesses. |
| [`/w`](compiler-option-warning-level.md) | Disable all warnings. |
| [`/W0`, `/W1`, `/W2`, `/W3`, `/W4`](compiler-option-warning-level.md) | Set output warning level. |
| [`/w1`, `/w2`, `/w3`, `/w4`](compiler-option-warning-level.md) | Set warning level for the specified warning. |
@@ -208,30 +220,35 @@ This table contains an alphabetical list of compiler options. For a list of comp
| [`/Z7`](z7-zi-zi-debug-information-format.md) | Generates C 7.0-compatible debugging information. |
| [`/Za`](za-ze-disable-language-extensions.md) | Disables some C89 language extensions in C code. |
| [`/Zc:__cplusplus[-]`](zc-cplusplus.md) | Enable the `__cplusplus` macro to report the supported standard (off by default). |
+| [`/Zc:__STDC__`](zc-stdc.md) | Enable the `__STDC__` macro to report the C standard is supported (off by default). |
| [`/Zc:alignedNew[-]`](zc-alignednew.md) | Enable C++17 over-aligned dynamic allocation (on by default in C++17). |
| [`/Zc:auto[-]`](zc-auto-deduce-variable-type.md) | Enforce the new Standard C++ meaning for **`auto`** (on by default). |
| [`/Zc:char8_t[-]`](zc-char8-t.md) | Enable or disable C++20 native `u8` literal support as `const char8_t` (off by default, except under **`/std:c++20`**). |
+| [`/Zc:enumTypes[-]`](zc-enumtypes.md) | Enable Standard C++ rules for `enum` type deduction (off by default). |
| [`/Zc:externC[-]`](zc-externc.md) | Enforce Standard C++ rules for `extern "C"` functions (implied by **`/permissive-`**). |
| [`/Zc:externConstexpr[-]`](zc-externconstexpr.md) | Enable external linkage for **`constexpr`** variables (off by default). |
| [`/Zc:forScope[-]`](zc-forscope-force-conformance-in-for-loop-scope.md) | Enforce Standard C++ **`for`** scoping rules (on by default). |
+| [`/Zc:gotoScope`](zc-gotoscope.md) | Enforce Standard C++ **`goto`** rules around local variable initialization (implied by **`/permissive-`**). |
| [`/Zc:hiddenFriend[-]`](zc-hiddenfriend.md) | Enforce Standard C++ hidden friend rules (implied by **`/permissive-`**) |
| [`/Zc:implicitNoexcept[-]`](zc-implicitnoexcept-implicit-exception-specifiers.md) | Enable implicit **`noexcept`** on required functions (on by default). |
| [`/Zc:inline[-]`](zc-inline-remove-unreferenced-comdat.md) | Remove unreferenced functions or data if they're COMDAT or have internal linkage only (off by default). |
| [`/Zc:lambda[-]`](zc-lambda.md) | Enable new lambda processor for conformance-mode syntactic checks in generic lambdas. |
| [`/Zc:noexceptTypes[-]`](zc-noexcepttypes.md) | Enforce C++17 **`noexcept`** rules (on by default in C++17 or later). |
+| [`/Zc:nrvo[-]`](zc-nrvo.md) | Enable optional copy and move elisions (on by default under **`/O2`**, **`/permissive-`**, or **`/std:c++20`** or later). |
| [`/Zc:preprocessor[-]`](zc-preprocessor.md) | Use the new conforming preprocessor (off by default, except in C11/C17). |
| [`/Zc:referenceBinding[-]`](zc-referencebinding-enforce-reference-binding-rules.md) | A UDT temporary won't bind to a non-const lvalue reference (off by default). |
| [`/Zc:rvalueCast[-]`](zc-rvaluecast-enforce-type-conversion-rules.md) | Enforce Standard C++ explicit type conversion rules (off by default). |
| [`/Zc:sizedDealloc[-]`](zc-sizeddealloc-enable-global-sized-dealloc-functions.md) | Enable C++14 global sized deallocation functions (on by default). |
| [`/Zc:strictStrings[-]`](zc-strictstrings-disable-string-literal-type-conversion.md) | Disable string-literal to `char*` or `wchar_t*` conversion (off by default). |
+| [`/Zc:templateScope[-]`](zc-templatescope.md) | Enforce Standard C++ template parameter shadowing rules (off by default). |
| [`/Zc:ternary[-]`](zc-ternary.md) | Enforce conditional operator rules on operand types (off by default). |
| [`/Zc:threadSafeInit[-]`](zc-threadsafeinit-thread-safe-local-static-initialization.md) | Enable thread-safe local static initialization (on by default). |
| [`/Zc:throwingNew[-]`](zc-throwingnew-assume-operator-new-throws.md) | Assume **`operator new`** throws on failure (off by default). |
-| `/Zc:tlsGuards[-]` | Generate runtime checks for TLS variable initialization (on by default). |
+| [`/Zc:tlsGuards[-]`](zc-tlsguards.md) | Generate runtime checks for TLS variable initialization (on by default). |
| [`/Zc:trigraphs`](zc-trigraphs-trigraphs-substitution.md) | Enable trigraphs (obsolete, off by default). |
-| [`/Zc:twoPhase[-]`](zc-twophase.md) | Use non-conforming template parsing behavior (conforming by default). |
+| [`/Zc:twoPhase[-]`](zc-twophase.md) | Use nonconforming template parsing behavior (conforming by default). |
| [`/Zc:wchar_t[-]`](zc-wchar-t-wchar-t-is-native-type.md) | **`wchar_t`** is a native type, not a typedef (on by default). |
-| `/Zc:zeroSizeArrayNew[-]` | Call member `new`/`delete` for 0-size arrays of objects (on by default). |
+| [`/Zc:zeroSizeArrayNew[-]`](zc-zerosizearraynew.md) | Call member `new`/`delete` for zero-size arrays of objects (on by default). |
| [`/Ze`](za-ze-disable-language-extensions.md) | Deprecated. Enables C89 language extensions. |
| [`/Zf`](zf.md) | Improves PDB generation time in parallel builds. |
| [`/ZH:[MD5|SHA1|SHA_256]`](zh.md) | Specifies MD5, SHA-1, or SHA-256 for checksums in debug info. |
@@ -240,10 +257,13 @@ This table contains an alphabetical list of compiler options. For a list of comp
| [`/Zl`](zl-omit-default-library-name.md) | Removes the default library name from the *`.obj`* file. |
| [`/Zm`](zm-specify-precompiled-header-memory-allocation-limit.md) | Specifies the precompiled header memory allocation limit. |
| [`/Zo[-]`](zo-enhance-optimized-debugging.md) | Generate richer debugging information for optimized code. |
-| [`/Zp[n]`](zp-struct-member-alignment.md) *n* | Packs structure members. |
+| [`/Zp[n]`](zp-struct-member-alignment.md) | Packs structure members. |
| [`/Zs`](zs-syntax-check-only.md) | Checks syntax only. |
| [`/ZW`](zw-windows-runtime-compilation.md) | Produces an output file to run on the Windows Runtime. |
+17.10 This option is available starting in Visual Studio 2022 version 17.10.\
+17.14 This option is available starting in Visual Studio 2022 version 17.14.
+
## See also
[MSVC compiler options](compiler-options.md)\
diff --git a/docs/build/reference/compiler-options-listed-by-category.md b/docs/build/reference/compiler-options-listed-by-category.md
index 2a4c903bd4..2fbfbc1357 100644
--- a/docs/build/reference/compiler-options-listed-by-category.md
+++ b/docs/build/reference/compiler-options-listed-by-category.md
@@ -1,9 +1,8 @@
---
title: "Compiler Options Listed by Category"
description: "Reference listing by category of the Microsoft C/C++ compiler command-line options."
-ms.date: 12/15/2021
+ms.date: 2/5/2025
helpviewer_keywords: ["compiler options, C++"]
-ms.assetid: c4750dcf-dba0-4229-99b6-45cdecc11729
---
# Compiler options listed by category
@@ -13,6 +12,7 @@ This article contains a categorical list of compiler options. For an alphabetica
| Option | Purpose |
|--|--|
+| [`/dynamicdeopt`](dynamic-deopt.md) | Enable [C++ Dynamic Debugging (Preview)](/visualstudio/debugger/cpp-dynamic-debugging) to debug optimized code as if it had been compiled deoptimized. |
| [`/favor:`](favor-optimize-for-architecture-specifics.md) | Produces code that is optimized for a specified architecture, or for a range of architectures. |
| [`/O1`](o1-o2-minimize-size-maximize-speed.md) | Creates small code. |
| [`/O2`](o1-o2-minimize-size-maximize-speed.md) | Creates fast code. |
@@ -29,7 +29,7 @@ This article contains a categorical list of compiler options. For an alphabetica
| Option | Purpose |
|--|--|
-| [`/arch:`](arch-x86.md) | Minimum CPU architecture requirements. IA32, SSE, and SSE2 are x86 only. |
+| [`/arch`](arch-minimum-cpu-architecture.md) | Minimum CPU architecture requirements. |
| [`/clr`](clr-common-language-runtime-compilation.md) | Produces an output file to run on the common language runtime. |
| [`/clr:implicitKeepAlive-`](clr-common-language-runtime-compilation.md) | Turn off implicit emission of `System::GC::KeepAlive(this)`. |
| [`/clr:initialAppDomain`](clr-common-language-runtime-compilation.md) | Enable initial AppDomain behavior of Visual C++ 2002. |
@@ -43,6 +43,8 @@ This article contains a categorical list of compiler options. For an alphabetica
| [`/EHc`](eh-exception-handling-model.md) | `extern "C"` defaults to `nothrow`. |
| [`/EHr`](eh-exception-handling-model.md) | Always generate `noexcept` runtime termination checks. |
| [`/EHs`](eh-exception-handling-model.md) | Enable C++ exception handling (no SEH exceptions). |
+| [`/feature`](feature-arm64.md) | Enable architecture features.17.10 |
+| [`/forceInterlockedFunctions`](force-interlocked-functions.md) | Dynamically selects between Armv8.0 load, store exclusive instructions or Armv8.1 LSE atomic instructions based on target CPU.17.14 |
| [`/fp:contract`](fp-specify-floating-point-behavior.md) | Consider floating-point contractions when generating code. |
| [`/fp:except[-]`](fp-specify-floating-point-behavior.md) | Consider floating-point exceptions when generating code. |
| [`/fp:fast`](fp-specify-floating-point-behavior.md) | "fast" floating-point model; results are less predictable. |
@@ -76,6 +78,7 @@ This article contains a categorical list of compiler options. For an alphabetica
| [`/GZ`](gz-enable-stack-frame-run-time-error-checking.md) | Deprecated. Enables fast checks. (Same as [`/RTC1`](rtc-run-time-error-checks.md)) |
| [`/homeparams`](homeparams-copy-register-parameters-to-stack.md) | Forces parameters passed in registers to be written to their locations on the stack upon function entry. This compiler option is only for the x64 compilers (native and cross compile). |
| [`/hotpatch`](hotpatch-create-hotpatchable-image.md) | Creates a hotpatchable image. |
+| [`/jumptablerdata`](jump-table-rdata.md) | Put switch case statement jump tables in the `.rdata` section. |
| [`/Qfast_transcendentals`](qfast-transcendentals-force-fast-transcendentals.md) | Generates fast transcendentals. |
| [`/QIfist`](qifist-suppress-ftol.md) | Deprecated. Suppresses the call of the helper function `_ftol` when a conversion from a floating-point type to an integral type is required. (x86 only) |
| [`/Qimprecise_fwaits`](qimprecise-fwaits-remove-fwaits-inside-try-blocks.md) | Removes `fwait` commands inside **`try`** blocks. |
@@ -91,6 +94,7 @@ This article contains a categorical list of compiler options. For an alphabetica
| [`/RTCc`](rtc-run-time-error-checks.md) | Convert to smaller type checks at run-time. |
| [`/RTCs`](rtc-run-time-error-checks.md) | Enable stack frame runtime checks. |
| [`/RTCu`](rtc-run-time-error-checks.md) | Enables uninitialized local usage checks. |
+| [`/vlen`](vlen.md) | Specifies vector length. |
| [`/volatile:iso`](volatile-volatile-keyword-interpretation.md) | Acquire/release semantics not guaranteed on volatile accesses. |
| [`/volatile:ms`](volatile-volatile-keyword-interpretation.md) | Acquire/release semantics guaranteed on volatile accesses. |
@@ -130,14 +134,18 @@ This article contains a categorical list of compiler options. For an alphabetica
| [`/u`](u-u-undefine-symbols.md) | Removes all predefined macros. |
| [`/X`](x-ignore-standard-include-paths.md) | Ignores the standard include directory. |
-## Header units
+## Header units/modules
| Option | Purpose |
|--|--|
| [`/exportHeader`](module-exportheader.md) | Create the header units files (*`.ifc`*) specified by the input arguments. |
-| [`/headerUnit`](headerunit.md) | Specify where to find the header unit file (`.ifc`) for the specified header. |
+| [`/headerUnit`](headerunit.md) | Specify where to find the header unit file (*`.ifc`*) for the specified header. |
| [`/headerName`](headername.md) | Build a header unit from the specified header. |
+| [`/ifcOutput`](ifc-output.md) | Specify the output file name or directory for built *`.ifc`* files. |
+| [`/interface`](interface.md) | Treat the input file as a module interface unit. |
+| [`/internalPartition`](internal-partition.md) | Treat the input file as an internal partition unit. |
| [`/reference`](module-reference.md) | Use named module IFC. |
+| [`/scanDependencies`](scandependencies.md) | List module and header unit dependencies in C++ Standard JSON form. |
| [`/sourceDependencies`](sourcedependencies.md) | List all source-level dependencies. |
| [`/sourceDependencies:directives`](sourcedependencies-directives.md) | List module and header unit dependencies. |
| [`/translateInclude`](translateinclude.md) | Treat `#include` as `import`. |
@@ -161,6 +169,7 @@ This article contains a categorical list of compiler options. For an alphabetica
| [`/std:c++latest`](std-specify-language-standard-version.md) | The latest draft C++ standard preview features. |
| [`/std:c11`](std-specify-language-standard-version.md) | C11 standard ISO/IEC 9899:2011. |
| [`/std:c17`](std-specify-language-standard-version.md) | C17 standard ISO/IEC 9899:2018. |
+| [`/std:clatest`](std-specify-language-standard-version.md) | The latest draft C standard preview features. |
| [`/vd{0|1|2}`](vd-disable-construction-displacements.md) | Suppresses or enables hidden `vtordisp` class members. |
| [`/vmb`](vmb-vmg-representation-method.md) | Uses best base for pointers to members. |
| [`/vmg`](vmb-vmg-representation-method.md) | Uses full generality for pointers to members. |
@@ -169,39 +178,44 @@ This article contains a categorical list of compiler options. For an alphabetica
| [`/vmv`](vmm-vms-vmv-general-purpose-representation.md) | Declares virtual inheritance. |
| [`/Z7`](z7-zi-zi-debug-information-format.md) | Generates C 7.0-compatible debugging information. |
| [`/Za`](za-ze-disable-language-extensions.md) | Disables some C89 language extensions in C code. |
+| [`/Zc:__cplusplus[-]`](zc-cplusplus.md) | Enable the `__cplusplus` macro to report the supported standard (off by default). |
+| [`/Zc:__STDC__`](zc-stdc.md) | Enable the `__STDC__` macro to report the C standard is supported (off by default). |
| [`/Zc:alignedNew[-]`](zc-alignednew.md) | Enable C++17 over-aligned dynamic allocation (on by default in C++17). |
| [`/Zc:auto[-]`](zc-auto-deduce-variable-type.md) | Enforce the new Standard C++ meaning for **`auto`** (on by default). |
| [`/Zc:char8_t[-]`](zc-char8-t.md) | Enable or disable C++20 native `u8` literal support as `const char8_t` (off by default, except under **`/std:c++20`**). |
-| [`/Zc:__cplusplus[-]`](zc-cplusplus.md) | Enable the `__cplusplus` macro to report the supported standard (off by default). |
+| [`/Zc:enumTypes[-]`](zc-enumtypes.md) | Enable Standard C++ rules for inferred `enum` base types (Off b y default, not implied by **`/permissive-`**). |
| [`/Zc:externC[-]`](zc-externc.md) | Enforce Standard C++ rules for `extern "C"` functions (implied by **`/permissive-`**). |
| [`/Zc:externConstexpr[-]`](zc-externconstexpr.md) | Enable external linkage for **`constexpr`** variables (off by default). |
| [`/Zc:forScope[-]`](zc-forscope-force-conformance-in-for-loop-scope.md) | Enforce Standard C++ **`for`** scoping rules (on by default). |
+| [`/Zc:gotoScope`](zc-gotoscope.md) | Enforce Standard C++ **`goto`** rules around local variable initialization (implied by **`/permissive-`**). |
| [`/Zc:hiddenFriend[-]`](zc-hiddenfriend.md) | Enforce Standard C++ hidden friend rules (implied by **`/permissive-`**) |
| [`/Zc:implicitNoexcept[-]`](zc-implicitnoexcept-implicit-exception-specifiers.md) | Enable implicit **`noexcept`** on required functions (on by default). |
| [`/Zc:inline[-]`](zc-inline-remove-unreferenced-comdat.md) | Remove unreferenced functions or data if they're COMDAT or have internal linkage only (off by default). |
| [`/Zc:lambda[-]`](zc-lambda.md) | Enable new lambda processor for conformance-mode syntactic checks in generic lambdas. |
| [`/Zc:noexceptTypes[-]`](zc-noexcepttypes.md) | Enforce C++17 **`noexcept`** rules (on by default in C++17 or later). |
+| [`/Zc:nrvo[-]`](zc-nrvo.md) | Enable optional copy and move elisions (on by default under **`/O2`**, **`/permissive-`**, or **`/std:c++20`** or later). |
| [`/Zc:preprocessor[-]`](zc-preprocessor.md) | Use the new conforming preprocessor (off by default, except in C11/C17). |
| [`/Zc:referenceBinding[-]`](zc-referencebinding-enforce-reference-binding-rules.md) | A UDT temporary won't bind to a non-const lvalue reference (off by default). |
| [`/Zc:rvalueCast[-]`](zc-rvaluecast-enforce-type-conversion-rules.md) | Enforce Standard C++ explicit type conversion rules (off by default). |
| [`/Zc:sizedDealloc[-]`](zc-sizeddealloc-enable-global-sized-dealloc-functions.md) | Enable C++14 global sized deallocation functions (on by default). |
| [`/Zc:strictStrings[-]`](zc-strictstrings-disable-string-literal-type-conversion.md) | Disable string-literal to `char*` or `wchar_t*` conversion (off by default). |
+| [`/Zc:templateScope[-]`](zc-templatescope.md) | Enforce Standard C++ template parameter shadowing rules (off by default). |
| [`/Zc:ternary[-]`](zc-ternary.md) | Enforce conditional operator rules on operand types (off by default). |
| [`/Zc:threadSafeInit[-]`](zc-threadsafeinit-thread-safe-local-static-initialization.md) | Enable thread-safe local static initialization (on by default). |
| [`/Zc:throwingNew[-]`](zc-throwingnew-assume-operator-new-throws.md) | Assume **`operator new`** throws on failure (off by default). |
+| [`/Zc:tlsGuards[-]`](zc-tlsguards.md) | Generate runtime checks for TLS variable initialization (on by default). |
| [`/Zc:trigraphs`](zc-trigraphs-trigraphs-substitution.md) | Enable trigraphs (obsolete, off by default). |
-| `/Zc:tlsGuards[-]` | Generate runtime checks for TLS variable initialization (on by default). |
-| [`/Zc:twoPhase[-]`](zc-twophase.md) | Use non-conforming template parsing behavior (conforming by default). |
+| [`/Zc:twoPhase[-]`](zc-twophase.md) | Use nonconforming template parsing behavior (conforming by default). |
| [`/Zc:wchar_t[-]`](zc-wchar-t-wchar-t-is-native-type.md) | **`wchar_t`** is a native type, not a typedef (on by default). |
-| `/Zc:zeroSizeArrayNew[-]` | Call member `new`/`delete` for 0-size arrays of objects (on by default). |
+| [`/Zc:zeroSizeArrayNew[-]`](zc-zerosizearraynew.md) | Call member `new`/`delete` for 0-size arrays of objects (on by default). |
| [`/Ze`](za-ze-disable-language-extensions.md) | Deprecated. Enables C89 language extensions. |
| [`/Zf`](zf.md) | Improves PDB generation time in parallel builds. |
-| [`/ZH:[MD5|SHA1|SHA_256]`](zh.md) | Specifies MD5, SHA-1, or SHA-256 for checksums in debug info. |
+| [`/ZH`:[MD5|SHA1|SHA_256]](zh.md) | Specifies MD5, SHA-1, or SHA-256 for checksums in debug info. |
| [`/ZI`](z7-zi-zi-debug-information-format.md) | Includes debug information in a program database compatible with Edit and Continue. (x86 only) |
| [`/Zi`](z7-zi-zi-debug-information-format.md) | Generates complete debugging information. |
| [`/Zl`](zl-omit-default-library-name.md) | Removes the default library name from the *`.obj`* file. |
| [`/Zo[-]`](zo-enhance-optimized-debugging.md) | Generate richer debugging information for optimized code. |
-| [`/Zp[n]`](zp-struct-member-alignment.md) *n* | Packs structure members. |
+| [`/Zp[n]`](zp-struct-member-alignment.md) | Packs structure members. |
| [`/Zs`](zs-syntax-check-only.md) | Checks syntax only. |
| [`/ZW`](zw-windows-runtime-compilation.md) | Produces an output file to run on the Windows Runtime. |
@@ -229,7 +243,7 @@ This article contains a categorical list of compiler options. For an alphabetica
| [`/bigobj`](bigobj-increase-number-of-sections-in-dot-obj-file.md) | Increases the number of addressable sections in an .obj file. |
| [`/c`](c-compile-without-linking.md) | Compiles without linking. |
| [`/cgthreads`](cgthreads-code-generation-threads.md) | Specifies number of *cl.exe* threads to use for optimization and code generation. |
-| [`/errorReport`](errorreport-report-internal-compiler-errors.md) | Deprecated. Error reporting is controlled by [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings. |
+| [`/errorReport`](errorreport-report-internal-compiler-errors.md) | Deprecated. [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings control error reporting. |
| [`/execution-charset`](execution-charset-set-execution-character-set.md) | Set execution character set. |
| `/fastfail` | Enable fast-fail mode. |
| [`/FC`](fc-full-path-of-source-code-file-in-diagnostics.md) | Displays the full path of source code files passed to *cl.exe* in diagnostic text. |
@@ -238,7 +252,7 @@ This article contains a categorical list of compiler options. For an alphabetica
| [`/HELP`](help-compiler-command-line-help.md) | Lists the compiler options. |
| [`/J`](j-default-char-type-is-unsigned.md) | Changes the default **`char`** type. |
| [`/JMC`](jmc.md) | Supports native C++ Just My Code debugging. |
-| [`/kernel`](kernel-create-kernel-mode-binary.md) | The compiler and linker will create a binary that can be executed in the Windows kernel. |
+| [`/kernel`](kernel-create-kernel-mode-binary.md) | The compiler and linker create a binary that can be executed in the Windows kernel. |
| [`/MP`](mp-build-with-multiple-processes.md) | Builds multiple source files concurrently. |
| [`/nologo`](nologo-suppress-startup-banner-c-cpp.md) | Suppresses display of sign-on banner. |
| `/presetPadding` | Zero initialize padding for stack based class types. |
@@ -251,7 +265,7 @@ This article contains a categorical list of compiler options. For an alphabetica
| [`/utf-8`](utf-8-set-source-and-executable-character-sets-to-utf-8.md) | Set source and execution character sets to UTF-8. |
| [`/V`](v-version-number.md) | Deprecated. Sets the version string. |
| [`/validate-charset`](validate-charset-validate-for-compatible-characters.md) | Validate UTF-8 files for only compatible characters. |
-| `/volatileMetadata` | Generate metadata on volatile memory accesses. |
+| [`/volatileMetadata`](volatile.md) | Generate metadata on volatile memory accesses. |
| [`/Yc`](yc-create-precompiled-header-file.md) | Create *`.PCH`* file. |
| [`/Yd`](yd-place-debug-information-in-object-file.md) | Deprecated. Places complete debugging information in all object files. Use [`/Zi`](z7-zi-zi-debug-information-format.md) instead. |
| [`/Yl`](yl-inject-pch-reference-for-debug-library.md) | Injects a PCH reference when creating a debug library. |
@@ -272,7 +286,7 @@ This article contains a categorical list of compiler options. For an alphabetica
| [`/external:templates[-]`](external-external-headers-diagnostics.md) | Evaluate warning level across template instantiation chain. |
| [`/external:W`](external-external-headers-diagnostics.md) | Set warning level for external headers. |
| [`/options:strict`](options-strict.md) | Unrecognized compiler options are errors. |
-| [`/sdl`](sdl-enable-additional-security-checks.md) | Enable additional security features and warnings. |
+| [`/sdl`](sdl-enable-additional-security-checks.md) | Enable more security features and warnings. |
| [`/w`](compiler-option-warning-level.md) | Disable all warnings. |
| [`/W0`, `/W1`, `/W2`, `/W3`, `/W4`](compiler-option-warning-level.md) | Set output warning level. |
| [`/w1`, `/w2`, `/w3`, `/w4`](compiler-option-warning-level.md) | Set warning level for the specified warning. |
@@ -290,6 +304,7 @@ Experimental options may only be supported by certain versions of the compiler.
| Option | Purpose |
|--|--|
+| [`/experimental:log`](experimental-log.md) | Enables experimental structured SARIF output. |
| [`/experimental:module`](experimental-module.md) | Enables experimental module support. |
## Deprecated and removed compiler options
@@ -314,6 +329,9 @@ Experimental options may only be supported by certain versions of the compiler.
| [`/Ze`](za-ze-disable-language-extensions.md) | Deprecated. Enables language extensions. |
| [`/Zg`](zg-generate-function-prototypes.md) | Removed in Visual Studio 2015. Generates function prototypes. |
+17.10 This option is available starting in Visual Studio 2022 version 17.10.\
+17.14 This option is available starting in Visual Studio 2022 version 17.14.
+
## See also
[C/C++ building reference](c-cpp-building-reference.md)\
diff --git a/docs/build/reference/compiling-a-c-cpp-program.md b/docs/build/reference/compiling-a-c-cpp-program.md
index 5bb1e6e938..04b7733c86 100644
--- a/docs/build/reference/compiling-a-c-cpp-program.md
+++ b/docs/build/reference/compiling-a-c-cpp-program.md
@@ -11,7 +11,7 @@ C and C++ compiler options can be set either in the Visual Studio IDE or on the
## In Visual Studio
-You can set compiler options for each project in its Visual Studio **Property Pages** dialog box. In the left pane, select **Configuration Properties**, **C/C++** and then choose the compiler option category. The topic for each compiler option describes how it can be set and where it is found in the development environment. See [MSVC Compiler Options](compiler-options.md) for a complete list.
+You can set compiler options for each project in its Visual Studio **Property Pages** dialog box. In the left pane, select **Configuration Properties**, **C/C++** and then choose the compiler option category. The topic for each compiler option describes how it can be set and where it is found in the development environment. For more information and a complete list of options, see [MSVC compiler options](compiler-options.md).
## From the command line
diff --git a/docs/build/reference/constexpr-control-constexpr-evaluation.md b/docs/build/reference/constexpr-control-constexpr-evaluation.md
index 6bee6fa00a..9052345e64 100644
--- a/docs/build/reference/constexpr-control-constexpr-evaluation.md
+++ b/docs/build/reference/constexpr-control-constexpr-evaluation.md
@@ -1,45 +1,42 @@
---
description: "Learn more about: /constexpr (Control constexpr evaluation)"
title: "/constexpr (Control constexpr evaluation)"
-ms.date: "08/15/2017"
+ms.date: 04/14/2025
f1_keywords: ["/constexpr", "-constexpr"]
helpviewer_keywords: ["/constexpr control constexpr evaluation [C++]", "-constexpr control constexpr evaluation [C++]", "constexpr control constexpr evaluation [C++]"]
-ms.assetid: 76d56784-f5ad-401d-841d-09d1059e8b8c
---
# /constexpr (Control constexpr evaluation)
-Use the **/constexpr** compiler options to control parameters for **`constexpr`** evaluation at compile time.
+Use the **`/constexpr`** compiler options to control parameters for **`constexpr`** evaluation at compile time.
## Syntax
-> **/constexpr:depth**N\
-> **/constexpr:backtrace**N\
-> **/constexpr:steps**N
+> `/constexpr:depth`N\
+> `/constexpr:backtrace`N\
+> `/constexpr:steps`N
## Arguments
-**depth**N
+**`depth`**N\
Limit the depth of recursive **`constexpr`** function invocation to *N* levels. The default is 512.
-**backtrace**N
+**`backtrace`**N\
Show up to *N* **`constexpr`** evaluations in diagnostics. The default is 10.
-**steps**N
-Terminate **`constexpr`** evaluation after *N* steps. The default is 100,000.
+**`steps`**N\
+Terminate **`constexpr`** evaluation after *N* steps. The default is 100,000. A step refers to an individual computation taken towards evaluating the constant expression. Increasing the maximum number of steps might cause compilation to take longer in cases where compilation would otherwise fail.
## Remarks
-The **/constexpr** compiler options control compile-time evaluation of **`constexpr`** expressions. Evaluation steps, recursion levels, and backtrace depth are controlled to prevent the compiler from spending too much time on **`constexpr`** evaluation. For more information on the **`constexpr`** language element, see [constexpr (C++)](../../cpp/constexpr-cpp.md).
+The **`/constexpr`** compiler options control compile-time evaluation of **`constexpr`** expressions. Evaluation steps, recursion levels, and backtrace depth are controlled to prevent the compiler from spending too much time on **`constexpr`** evaluation. For more information on the **`constexpr`** language element, see [`constexpr` (C++)](../../cpp/constexpr-cpp.md).
-The **/constexpr** options are available beginning in Visual Studio 2015.
+The **`/constexpr`** flag is available beginning in Visual Studio 2015.
### To set this compiler option in the Visual Studio development environment
1. Open your project's **Property Pages** dialog box.
-
1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
-
-1. Enter any **/constexpr** compiler options in the **Additional Options** box. Choose **OK** or **Apply** to save your changes.
+1. Enter **/constexpr** compiler options in the **Additional Options** box. Choose **OK** to save your changes.
### To set this compiler option programmatically
@@ -47,5 +44,5 @@ The **/constexpr** options are available beginning in Visual Studio 2015.
## See also
-[MSVC Compiler Options](compiler-options.md)
+[MSVC Compiler Options](compiler-options.md)\
[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
diff --git a/docs/build/reference/contents-of-a-makefile.md b/docs/build/reference/contents-of-a-makefile.md
index 943a29c916..8883cd8cc7 100644
--- a/docs/build/reference/contents-of-a-makefile.md
+++ b/docs/build/reference/contents-of-a-makefile.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: NMAKE makefile contents and features"
title: "NMAKE makefile contents and features"
+description: "Learn more about: NMAKE makefile contents and features"
ms.date: 09/30/2021
helpviewer_keywords: ["makefiles", "makefiles, contents", "NMAKE program, special characters", "makefiles, special characters", "special characters, in NMAKE macros", "macros, special characters", "NMAKE program, long filenames", "makefiles, comments", "NMAKE program, wildcards", "wildcards, expanding"]
---
@@ -24,11 +24,11 @@ For a sample, see [Sample makefile](sample-makefile.md).
NMAKE supports other features, such as wildcards, long filenames, comments, and escapes for special characters.
-## Wildcards and NMAKE
+## Wildcards and NMAKE
NMAKE expands filename wildcards (**`*`** and **`?`**) in dependency lines. A wildcard specified in a command is passed to the command; NMAKE doesn't expand it.
-## Long filenames in a makefile
+## Long filenames in a makefile
Enclose long filenames in double quotation marks, as follows:
@@ -36,7 +36,7 @@ Enclose long filenames in double quotation marks, as follows:
all : "VeryLongFileName.exe"
```
-## Comments in a makefile
+## Comments in a makefile
Precede a comment with a number sign (**`#`**). NMAKE ignores text from the number sign to the next newline character.
@@ -66,7 +66,7 @@ To specify a literal number sign, precede it with a caret (**`^`**), as follows:
DEF = ^#define #Macro for a C preprocessing directive
```
-## Special characters in a makefile
+## Special characters in a makefile
To use an NMAKE special character as a literal character, place a caret (**`^`**) in front of it as an escape. NMAKE ignores carets that precede other characters. The special characters are:
diff --git a/docs/build/reference/creating-a-makefile-project.md b/docs/build/reference/creating-a-makefile-project.md
index 3b351c0c02..1f88156dfd 100644
--- a/docs/build/reference/creating-a-makefile-project.md
+++ b/docs/build/reference/creating-a-makefile-project.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Create a makefile project"
title: "Create a C++ makefile project in Visual Studio"
+description: "Learn more about: Create a makefile project"
ms.date: 09/30/2021
f1_keywords: ["vc.appwiz.makefile.project"]
helpviewer_keywords: ["Makefile projects [C++]"]
@@ -16,7 +16,7 @@ If you have an existing makefile project, you have these choices if you want to
- **Visual Studio 2017 and later**: Use the **Open Folder** feature to edit and build a makefile project as-is without any involvement of the MSBuild system. For more information, see [Open Folder projects for C++](../open-folder-projects-cpp.md).
- **Visual Studio 2019 and later**: Create a UNIX makefile project for Linux.
-## To create a makefile project with the makefile project template
+## To create a makefile project with the makefile project template
In Visual Studio 2017 and later, the Makefile project template is available when the C++ Desktop Development workload is installed.
@@ -50,7 +50,7 @@ The output file that you specify in the project has no effect on the name that t
::: moniker-end
-You can view and edit the project's properties in its property page. See [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md) for information about displaying the property page.
+You can view and edit the project's properties in its property page. For more information about displaying the property page, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
## Makefile project wizard
diff --git a/docs/build/reference/creating-an-dot-sbr-file.md b/docs/build/reference/creating-an-dot-sbr-file.md
index 47312c2da9..37096da3b1 100644
--- a/docs/build/reference/creating-an-dot-sbr-file.md
+++ b/docs/build/reference/creating-an-dot-sbr-file.md
@@ -1,9 +1,8 @@
---
-description: "Learn more about: Creating an .Sbr File"
title: "Creating an .Sbr File"
+description: "Learn more about: Creating an .Sbr File"
ms.date: "11/04/2016"
helpviewer_keywords: ["SBR files", "BSCMAKE, input files", ".sbr files", "source browser files", "local symbols in browse information", "symbols"]
-ms.assetid: bdb4b93c-a88a-441a-84fd-01087d03be25
---
# Creating an .Sbr File
@@ -14,7 +13,7 @@ The input files for BSCMAKE are .sbr files. The compiler creates an .sbr file fo
To create an .sbr file with all possible information, specify [/FR](fr-fr-create-dot-sbr-file.md).
-To create an .sbr file that doesn't contain local symbols, specify [/Fr](fr-fr-create-dot-sbr-file.md). If the .sbr files contain local symbols, you can still omit them from the .bsc file by using BSCMAKE's [/El option](bscmake-options.md)`.`
+To create an .sbr file that doesn't contain local symbols, specify [/Fr](fr-fr-create-dot-sbr-file.md). If the .sbr files contain local symbols, you can still omit them from the .bsc file by using BSCMAKE's [/El option](bscmake-options.md).
You can create an .sbr file without performing a full compile. For example, you can specify the /Zs option to the compiler to perform a syntax check and still generate an .sbr file if you specify /FR or /Fr.
diff --git a/docs/build/reference/debug-generate-debug-info.md b/docs/build/reference/debug-generate-debug-info.md
old mode 100755
new mode 100644
index 7bc0fcc21b..85a515deba
--- a/docs/build/reference/debug-generate-debug-info.md
+++ b/docs/build/reference/debug-generate-debug-info.md
@@ -1,52 +1,52 @@
---
-description: "Learn more about: /DEBUG (Generate Debug Info)"
+description: "Learn more about: /DEBUG (Generate debug info)"
title: "/DEBUG (Generate Debug Info)"
-ms.date: "05/16/2019"
+ms.date: 10/26/2023
f1_keywords: ["VC.Project.VCLinkerTool.GenerateDebugInformation", "/debug"]
helpviewer_keywords: ["DEBUG linker option", "/DEBUG linker option", "-DEBUG linker option", "PDB files", "debugging [C++], debug information files", "generate debug info linker option", "pdb files, generating debug info", ".pdb files, generating debug info", "debugging [C++], linker option", "program databases [C++]"]
ms.assetid: 1af389ae-3f8b-4d76-a087-1cdf861e9103
---
-# /DEBUG (Generate Debug Info)
+# `/DEBUG` (Generate debug info)
-```
-/DEBUG[:{FASTLINK|FULL|NONE}]
-```
+The **`/DEBUG`** linker option creates a debugging information file for the executable.
+
+## Syntax
+
+> **`/DEBUG`**\[**`:`**{**`FASTLINK`**|**`FULL`**|**`NONE`**}]
## Remarks
-The **/DEBUG** option creates debugging information for the executable.
+The **`/DEBUG`** option puts the debugging information from linked object and library files into a program database (PDB) file. It updates the PDB during subsequent builds of the program.
-The linker puts the debugging information into a program database (PDB) file. It updates the PDB during subsequent builds of the program.
+An executable (an EXE or DLL file) created for debugging contains the name and path of the corresponding PDB. The debugger reads the embedded name and uses the PDB when you debug the program. The linker uses the base name of the program and the extension *`.pdb`* to name the program database, and embeds the path where it was created. To override this default, set the [`/PDB`](pdb-use-program-database.md) option and specify a different file name.
-An executable (.exe file or DLL) created for debugging contains the name and path of the corresponding PDB. The debugger reads the embedded name and uses the PDB when you debug the program. The linker uses the base name of the program and the extension .pdb to name the program database, and embeds the path where it was created. To override this default, set [/PDB](pdb-use-program-database.md) and specify a different file name.
+The **`/DEBUG:FASTLINK`** option is available in Visual Studio 2017 and later. This option generates a limited PDB that indexes into the debug information in the object files and libraries used to build the executable instead of making a full copy. You can only use this limited PDB to debug from the computer where the binary and its libraries were built. If you deploy the binary elsewhere, you may debug it remotely from the build computer, but not directly on the test computer. Since Visual Studio 2019, **`/DEBUG:FULL`** linking times have improved significantly, and **`/DEBUG:FASTLINK`** isn't always faster than **`/DEBUG:FULL`**. Since **`/DEBUG:FASTLINK`** no longer provides large build time improvements and results in a slower debugging experience versus **`/DEBUG:FULL`**, this option is no longer recommended.
-The **/DEBUG:FASTLINK** option is available in Visual Studio 2017 and later. This option leaves private symbol information in the individual compilation products used to build the executable. It generates a limited PDB that indexes into the debug information in the object files and libraries used to build the executable instead of making a full copy. This option can link from two to four times as fast as full PDB generation, and is recommended when you are debugging locally and have the build products available. This limited PDB can't be used for debugging when the required build products are not available, such as when the executable is deployed on another computer. In a developer command prompt, you can use the mspdbcmf.exe tool to generate a full PDB from this limited PDB. In Visual Studio, use the Project or Build menu items for generating a full PDB file to create a full PDB for the project or solution.
+A **`/DEBUG:FASTLINK`** PDB can be converted to a full PDB that you can deploy to a test machine for local debugging. In Visual Studio, use the **Property Pages** dialog as described below to create a full PDB for the project or solution. In a developer command prompt, you can use the `mspdbcmf.exe` tool to create a full PDB.
-The **/DEBUG:FULL** option moves all private symbol information from individual compilation products (object files and libraries) into a single PDB, and can be the most time-consuming part of the link. However, the full PDB can be used to debug the executable when no other build products are available, such as when the executable is deployed.
+The **`/DEBUG:FULL`** option moves all private symbol information from individual compilation products (object files and libraries) into a single PDB, and can be the most time-consuming part of the link. However, the full PDB can be used to debug the executable when no other build products are available, such as when the executable is deployed.
-The **/DEBUG:NONE** option does not generate a PDB.
+The **`/DEBUG:NONE`** option doesn't generate a PDB.
-When you specify **/DEBUG** with no additional options, the linker defaults to **/DEBUG:FULL** for command line and makefile builds, for release builds in the Visual Studio IDE, and for both debug and release builds in Visual Studio 2015 and earlier versions. Beginning in Visual Studio 2017, the build system in the IDE defaults to **/DEBUG:FASTLINK** when you specify the **/DEBUG** option for debug builds. Other defaults are unchanged to maintain backward compatibility.
+Specifying **`/DEBUG`** with no extra arguments is equivalent to specifying **`/DEBUG:FULL`**.
-The compiler's [C7 Compatible](z7-zi-zi-debug-information-format.md) (/Z7) option causes the compiler to leave the debugging information in the .obj files. You can also use the [Program Database](z7-zi-zi-debug-information-format.md) (/Zi) compiler option to store the debugging information in a PDB for the .obj file. The linker looks for the object's PDB first in the absolute path written in the .obj file, and then in the directory that contains the .obj file. You cannot specify an object's PDB file name or location to the linker.
+The compiler's [`/Z7`](z7-zi-zi-debug-information-format.md) (C7 Compatible) option causes the compiler to leave the debugging information in the object (OBJ) files. You can also use the [`/Zi`](z7-zi-zi-debug-information-format.md) (Program Database) compiler option to store the debugging information in a PDB for the OBJ file. The linker looks for the object's PDB first in the absolute path written in the OBJ file, and then in the directory that contains the OBJ file. You can't specify an object's PDB file name or location to the linker.
-[/INCREMENTAL](incremental-link-incrementally.md) is implied when /DEBUG is specified.
+[`/INCREMENTAL`](incremental-link-incrementally.md) is implied when **`/DEBUG`** is specified.
-/DEBUG changes the defaults for the [/OPT](opt-optimizations.md) option from REF to NOREF and from ICF to NOICF, so if you want the original defaults, you must explicitly specify /OPT:REF or /OPT:ICF.
+**`/DEBUG`** changes the defaults for the [`/OPT`](opt-optimizations.md) option from **`REF`** to **`NOREF`** and from **`ICF`** to **`NOICF`**, so if you want the original defaults, you must explicitly specify **`/OPT:REF`** or **`/OPT:ICF`** after the **`/DEBUG`** option.
-It is not possible to create an .exe or .dll that contains debug information. Debug information is always placed in a .obj or .pdb file.
+It isn't possible to create an EXE or DLL that contains debug information. Debug information is always placed in an OBJ or PDB file.
### To set this linker option in the Visual Studio development environment
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
-1. Click the **Linker** folder.
-
-1. Click the **Debugging** property page.
+1. Select the **Linker** > **Debugging** property page.
-1. Modify the **Generate Debug Info** property to enable PDB generation. This enables /DEBUG:FASTLINK by default in Visual Studio 2017 and later.
+1. Modify the **Generate Debug Info** property to enable or disable PDB generation. This property enables **`/DEBUG:FASTLINK`** by default in Visual Studio 2017 and later.
-1. Modify the **Generate Full Program Database File** property to enable /DEBUG:FULL for full PDB generation for every incremental build.
+1. Modify the **Generate Full Program Database File** property to enable **`/DEBUG:FULL`** for full PDB generation for every incremental build.
### To set this linker option programmatically
@@ -54,5 +54,5 @@ It is not possible to create an .exe or .dll that contains debug information. De
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/decorated-names.md b/docs/build/reference/decorated-names.md
index 70a2e2d05d..6370302c0d 100644
--- a/docs/build/reference/decorated-names.md
+++ b/docs/build/reference/decorated-names.md
@@ -1,22 +1,22 @@
---
-description: "Learn more about: Decorated Names"
-title: "Decorated Names"
-ms.date: "09/05/2018"
+description: "Learn more about: Decorated names"
+title: "Decorated names"
+ms.date: 06/08/2022
helpviewer_keywords: ["decorated names, definition", "name decoration [C++]", "names [C++], decorated"]
ms.assetid: a4e9ae8e-b239-4454-b401-4102793cb344
---
-# Decorated Names
+# Decorated names
Functions, data, and objects in C and C++ programs are represented internally by their decorated names. A *decorated name* is an encoded string created by the compiler during compilation of an object, data, or function definition. It records calling conventions, types, function parameters and other information together with the name. This name decoration, also known as *name mangling*, helps the linker find the correct functions and objects when linking an executable.
The decorated naming conventions have changed in various versions of Visual Studio, and can also be different on different target architectures. To link correctly with source files created by using Visual Studio, C and C++ DLLs and libraries should be compiled by using the same compiler toolset, flags, and target architecture.
> [!NOTE]
-> Libraries built with Visual Studio 2015 can be consumed by applications built with Visual Studio 2017 or Visual Studio 2019.
+> Libraries built by Visual Studio 2015 or later can be consumed by applications built with later versions of Visual Studio through Visual Studio 2022. For more information, see [C++ binary compatibility between Visual Studio versions](../../porting/binary-compat-2015-2017.md).
## Using decorated names
-Normally, you don't have to know the decorated name to write code that compiles and links successfully. Decorated names are an implementation detail internal to the compiler and linker. The tools can usually handle the name in its undecorated form. However, a decorated name is sometimes required when you specify a function name to the linker and other tools. For example, to match overloaded C++ functions, members of namespaces, class constructors, destructors and special member functions, you must specify the decorated name. For details about the option flags and other situations that require decorated names, see the documentation for the tools and options that you are using.
+Normally, you don't have to know the decorated name to write code that compiles and links successfully. Decorated names are an implementation detail internal to the compiler and linker. The tools can usually handle the name in its undecorated form. However, a decorated name is sometimes required when you specify a function name to the linker and other tools. For example, to match overloaded C++ functions, members of namespaces, class constructors, destructors and special member functions, you must specify the decorated name. For details about the option flags and other situations that require decorated names, see the documentation for the tools and options that you're using.
If you change the function name, class, calling convention, return type, or any parameter, the decorated name also changes. In this case, you must get the new decorated name and use it everywhere the decorated name is specified.
@@ -28,9 +28,9 @@ A decorated name for a C++ function contains the following information:
- The function name.
-- The class that the function is a member of, if it is a member function. This may include the class that encloses the class that contains the function, and so on.
+- The class that the function is a member of, if it's a member function. The decoration may include the class that encloses the class that contains the function, and so on.
-- The namespace the function belongs to, if it is part of a namespace.
+- The namespace the function belongs to, if it's part of a namespace.
- The types of the function parameters.
@@ -38,47 +38,51 @@ A decorated name for a C++ function contains the following information:
- The return type of the function.
+- An optional target-specific element. In ARM64EC objects, a **`$$h`** tag is inserted into the name.
+
The function and class names are encoded in the decorated name. The rest of the decorated name is a code that has internal meaning only for the compiler and the linker. The following are examples of undecorated and decorated C++ names.
-|Undecorated name|Decorated name|
-|----------------------|--------------------|
-|`int a(char){int i=3;return i;};`|`?a@@YAHD@Z`|
-|`void __stdcall b::c(float){};`|`?c@b@@AAGXM@Z`|
+| Undecorated name | Decorated name |
+|--|--|
+| `int a(char){int i=3;return i;};` | `?a@@YAHD@Z` |
+| `void __stdcall b::c(float){};` | `?c@b@@AAGXM@Z` |
## Format of a C decorated name
-The form of decoration for a C function depends on the calling convention used in its declaration, as shown in the following table. This is also the decoration format that is used when C++ code is declared to have `extern "C"` linkage. The default calling convention is **`__cdecl`**. Note that in a 64-bit environment, functions are not decorated.
+The form of decoration for a C function depends on the calling convention used in its declaration, as shown in the following table. It's also the decoration format that's used when C++ code is declared to have `extern "C"` linkage. The default calling convention is **`__cdecl`**. In a 64-bit environment, C or `extern "C"` functions are only decorated when using the `__vectorcall` calling convention.
+
+| Calling convention | Decoration |
+|--|--|
+| **`__cdecl`** | Leading underscore (**`_`**) |
+| **`__stdcall`** | Leading underscore (**`_`**) and a trailing at sign (**`@`**) followed by the number of bytes in the parameter list in decimal |
+| **`__fastcall`** | Leading and trailing at signs (**`@`**) followed by a decimal number representing the number of bytes in the parameter list |
+| **`__vectorcall`** | Two trailing at signs (**`@@`**) followed by a decimal number of bytes in the parameter list |
-|Calling convention|Decoration|
-|------------------------|----------------|
-|**`__cdecl`**|Leading underscore (**`_`**)|
-|**`__stdcall`**|Leading underscore (**`_`**) and a trailing at sign (**`@`**) followed by the number of bytes in the parameter list in decimal|
-|**`__fastcall`**|Leading and trailing at signs (**`@`**) followed by a decimal number representing the number of bytes in the parameter list|
-|**`__vectorcall`**|Two trailing at signs (**`@@`**) followed by a decimal number of bytes in the parameter list|
+For ARM64EC functions with C linkage (whether compiled as C or by using `extern "C"`), a **`#`** is prepended to the decorated name.
-## Viewing decorated names
+## View decorated names
You can get the decorated form of a symbol name after you compile the source file that contains the data, object, or function definition or prototype. To examine decorated names in your program, you can use one of the following methods:
-#### To use a listing to view decorated names
+### To use a listing to view decorated names
-1. Generate a listing by compiling the source file that contains the data, object, or function definition or prototype with the [Listing File Type](fa-fa-listing-file.md) compiler option set to Assembly with Source Code (**/FAs**).
+1. Generate a listing by compiling the source file that contains the data, object, or function definition or prototype with the [`/FA` (Listing file type)](fa-fa-listing-file.md) compiler option set to assembly with source code (**`/FAs`**).
- For example, enter `cl /c /FAs example.cpp` at a developer command prompt to generate a listing file, example.asm.
+ For example, enter `cl /c /FAs example.cpp` at a developer command prompt to generate a listing file, *`example.asm`*.
-2. In the resulting listing file, find the line that starts with PUBLIC and ends a semicolon followed by the undecorated data or function name. The symbol between PUBLIC and the semicolon is the decorated name.
+1. In the resulting listing file, find the line that starts with `PUBLIC` and ends a semicolon (**`;`**) followed by the undecorated data or function name. The symbol between `PUBLIC` and the semicolon is the decorated name.
-#### To use DUMPBIN to view decorated names
+### To use DUMPBIN to view decorated names
-1. To see the exported symbols in an .obj or .lib file, enter `dumpbin /exports ` at a developer command prompt.
+1. To see the exported symbols in an OBJ or LIB file, enter `dumpbin /exports ` at a developer command prompt.
-2. To find the decorated form of a symbol, look for the undecorated name in parentheses. The decorated name is on the same line, before the undecorated name.
+1. To find the decorated form of a symbol, look for the undecorated name in parentheses. The decorated name is on the same line, before the undecorated name.
## Viewing undecorated names
You can use undname.exe to convert a decorated name to its undecorated form. This example shows how it works:
-```
+```cmd
C:\>undname ?func1@a@@AAEXH@Z
Microsoft (R) C++ Name Undecorator
Copyright (C) Microsoft Corporation. All rights reserved.
@@ -89,5 +93,5 @@ is :- "private: void __thiscall a::func1(int)"
## See also
-[Additional MSVC Build Tools](c-cpp-build-tools.md)
-[Using extern to Specify Linkage](../../cpp/extern-cpp.md)
+[Additional MSVC build tools](c-cpp-build-tools.md)\
+[Using `extern` to specify linkage](../../cpp/extern-cpp.md)
diff --git a/docs/build/reference/def-specify-module-definition-file.md b/docs/build/reference/def-specify-module-definition-file.md
index ad5e6a38fa..42e938c3ff 100644
--- a/docs/build/reference/def-specify-module-definition-file.md
+++ b/docs/build/reference/def-specify-module-definition-file.md
@@ -1,37 +1,34 @@
---
-description: "Learn more about: /DEF (Specify Module-Definition File)"
-title: "/DEF (Specify Module-Definition File)"
-ms.date: "11/04/2016"
+description: "Learn more about: /DEF (Specify module-definition file)"
+title: "/DEF (Specify module-definition file)"
+ms.date: 03/27/2025
f1_keywords: ["VC.Project.VCLinkerTool.ModuleDefinitionFile", "/def"]
helpviewer_keywords: ["module definition files, specifying", "DEF linker option", "-DEF linker option", "module definition files", "/DEF linker option"]
-ms.assetid: 6497fa68-65f0-48ca-8f66-b87166fc631a
---
-# /DEF (Specify Module-Definition File)
+# `/DEF` (Specify module-definition file)
-```
-/DEF:filename
-```
+Specifies a module-definition file to the linker.
-## Arguments
+## Syntax
-*filename*
-The name of a module-definition file (.def) to be passed to the linker.
+> **`/DEF:`***`filename`*
-## Remarks
+## Arguments
-The /DEF option passes a module-definition file (.def) to the linker. Only one .def file can be specified to LINK. For details about .def files, see [Module-Definition Files](module-definition-dot-def-files.md).
+*`filename`*\
+The name of a module-definition file (*`.def`*) to be passed to the linker. When expanded, the fully qualified filename must not exceed `MAX_PATH` (260 characters).
-### To set this linker option in the Visual Studio development environment
-
-1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+## Remarks
-1. Click the **Linker** folder.
+The **`/DEF`** linker option passes a module-definition file (*`.def`*) to the linker. Only one *`.def`* file can be specified to LINK. For details about *`.def`* files, see [Module-definition files](module-definition-dot-def-files.md).
-1. Click the **Input** property page.
+To specify a *`.def`* file from within the development environment, add it to the project along with your other source files and then specify the file in the project's **Property Pages** dialog.
-1. Modify the **Module Definition File** property.
+### To set this linker option in the Visual Studio development environment
-To specify a .def file from within the development environment, you should add it to the project along with other files and then specify the file to the /DEF option.
+1. Open the project's **Property Pages** dialog box. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
+1. Select the **Configuration Properties** > **Linker** > **Input** property page.
+1. Modify the **Module Definition File** property. Choose **OK** or **Apply** to save your changes.
### To set this linker option programmatically
@@ -39,5 +36,5 @@ To specify a .def file from within the development environment, you should add i
## See also
-[MSVC linker reference](linking.md)
+[MSVC linker reference](linking.md)\
[MSVC Linker Options](linker-options.md)
diff --git a/docs/build/reference/defining-an-nmake-macro.md b/docs/build/reference/defining-an-nmake-macro.md
index e503302651..dd09538893 100644
--- a/docs/build/reference/defining-an-nmake-macro.md
+++ b/docs/build/reference/defining-an-nmake-macro.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Defining an NMAKE Macro"
title: "Define an NMAKE Macro"
+description: "Learn more about: Defining an NMAKE Macro"
ms.date: 09/30/2021
helpviewer_keywords: ["macros, NMAKE", "defining NMAKE macros", "NMAKE macros, defining", "defining macros", "NMAKE program, defining macros", "NMAKE program, undefined macros", "Null macros in NMAKE", "macros, null and undefined", "undefined macros and NMAKE", "NMAKE program, null macros", "special characters, in NMAKE macros"]
---
@@ -16,7 +16,7 @@ The *macro_name* is a case-sensitive combination of letters, digits, and undersc
The *string* can be any sequence of zero or more characters. A *null* string contains zero characters or only spaces or tabs. The *string* can contain a macro invocation.
-## Special characters in macros
+## Special characters in macros
A number sign (**`#`**) after a definition specifies a comment. To specify a literal number sign in a macro, use a caret (**`^`**) to escape it, as in **`^#`**.
@@ -31,11 +31,11 @@ CMDS = cls^
dir
```
-## Null and undefined macros
+## Null and undefined macros
Both null and undefined macros expand to null strings, but a macro defined as a null string is considered defined in preprocessing expressions. To define a macro as a null string, specify no characters except spaces or tabs after the equal sign (**`=`**) in a command line or command file, and enclose the null string or definition in double quotation marks (**`" "`**). To undefine a macro, use **`!UNDEF`**. For more information, see [Makefile preprocessing directives](makefile-preprocessing.md#makefile-preprocessing-directives).
-## Where to define macros
+## Where to define macros
Define macros in a command line, command file, makefile, or the *`Tools.ini`* file.
@@ -43,7 +43,7 @@ In a makefile or the *`Tools.ini`* file, each macro definition must appear on a
In a command line or command file, spaces and tabs delimit arguments and can't surround the equal sign. If *string* has embedded spaces or tabs, enclose either the string itself or the entire macro in double quotation marks (**`" "`**).
-## Precedence in macro definitions
+## Precedence in macro definitions
If a macro has multiple definitions, NMAKE uses the highest-precedence definition. The following list shows the order of precedence, from highest to lowest:
diff --git a/docs/build/reference/delay-delay-load-import-settings.md b/docs/build/reference/delay-delay-load-import-settings.md
index 07856d7724..a1054d65b8 100644
--- a/docs/build/reference/delay-delay-load-import-settings.md
+++ b/docs/build/reference/delay-delay-load-import-settings.md
@@ -1,8 +1,8 @@
---
description: "Learn more about: /DELAY (Delay load import settings)"
title: "/DELAY (Delay load import settings)"
-ms.date: 01/28/2021
-f1_keywords: ["/delay", "VC.Project.VCLinkerTool.DelayNoBind", "VC.Project.VCLinkerTool.SupportUnloadOfDelayLoadedDLL", "VC.Project.VCLinkerTool.DelayUnload"]
+ms.date: 09/19/2022
+f1_keywords: ["/delay", "VC.Project.VCLinkerTool.DelayNoBind", "VC.Project.VCLinkerTool.SupportUnloadOfDelayLoadedDLL", "VC.Project.VCLinkerTool.DelayUnload", "VC.Project.VCLinkerTool.SupportNobindOfDelayLoadedDLL"]
helpviewer_keywords: ["delayed loading of DLLs, /DELAY option", "DELAY linker option", "/DELAY linker option", "-DELAY linker option"]
---
# `/DELAY` (Delay load import settings)
@@ -32,15 +32,15 @@ To specify DLLs to delay load, use the [`/DELAYLOAD`](delayload-delay-load-impor
### To set this linker option in the Visual Studio development environment
-1. Open the project's **Property Pages** dialog box. For information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+1. Open the **Property Pages** dialog box for the project. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
1. Select the **Configuration Properties** > **Linker** > **Advanced** property page.
-1. Modify the **Delay Loaded DLL** property. Choose **OK** to save your changes.
+1. Modify the **Unload delay loaded DLL** property or the **Unbind delay loaded DLL** property. Choose **OK** or **Apply** to save your changes.
### To set this linker option programmatically
-- See .
+- See .
## See also
diff --git a/docs/build/reference/description-blocks.md b/docs/build/reference/description-blocks.md
index 6175063ce7..3f45702146 100644
--- a/docs/build/reference/description-blocks.md
+++ b/docs/build/reference/description-blocks.md
@@ -156,7 +156,7 @@ In this example, UPDATE is a pseudotarget.
```makefile
UPDATE : *.*
-!COPY $** c:\product\release
+COPY $** c:\product\release
```
When UPDATE is evaluated, NMAKE copies all files in the current directory to the specified drive and directory.
diff --git a/docs/build/reference/dot-ilk-files-as-linker-input.md b/docs/build/reference/dot-ilk-files-as-linker-input.md
index e53baf1be6..5e5e761ff8 100644
--- a/docs/build/reference/dot-ilk-files-as-linker-input.md
+++ b/docs/build/reference/dot-ilk-files-as-linker-input.md
@@ -1,15 +1,19 @@
---
-description: "Learn more about: .Ilk Files as Linker Input"
-title: ".Ilk Files as Linker Input"
-ms.date: "11/04/2016"
-helpviewer_keywords: ["ILK files", ".ilk files"]
+description: "Learn more about: .ilk files as linker input"
+title: ".ilk files as linker input"
+ms.date: 09/07/2022
+helpviewer_keywords: [".ilk files", ".ilk files"]
ms.assetid: 7324c104-9e5d-423d-b268-b59f92607bf2
---
-# .Ilk Files as Linker Input
+# `.ilk` files as linker input
-When linking incrementally, LINK updates the .ilk status file that it created during the first incremental link. This file has the same base name as the .exe file or the .dll file, and it has the extension .ilk. During subsequent incremental links, LINK updates the .ilk file. If the .ilk file is missing, LINK performs a full link and creates a new .ilk file. If the .ilk file is unusable, LINK performs a nonincremental link. For details about incremental linking, see the [Link Incrementally (/INCREMENTAL)](incremental-link-incrementally.md) option.
+The linker creates and uses a *`.ilk`* database file for incremental link information.
+
+## Remarks
+
+When linking incrementally, LINK updates the *`.ilk`* status file that it created during the first incremental link. This file has the same base name as the target EXE or DLL file, and it has the extension *`.ilk`*. During subsequent incremental links, LINK updates the *`.ilk`* file. If the *`.ilk`* file is missing, LINK performs a full link and creates a new *`.ilk`* file. If the *`.ilk`* file is unusable, LINK performs a non-incremental link. For more information about incremental linking, see the [`/INCREMENTAL` (Link incrementally)](incremental-link-incrementally.md) linker option. For information about how to specify the name and location of the file, see [`/ILK` (Name incremental database file)](./ilk-name-incremental-database-file.md).
## See also
-[LINK Input Files](link-input-files.md)
-[MSVC Linker Options](linker-options.md)
+[LINK input files](link-input-files.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/dot-lib-files-as-linker-input.md b/docs/build/reference/dot-lib-files-as-linker-input.md
index dc12e4a0bb..875c8694c9 100644
--- a/docs/build/reference/dot-lib-files-as-linker-input.md
+++ b/docs/build/reference/dot-lib-files-as-linker-input.md
@@ -1,32 +1,36 @@
---
-description: "Learn more about: .Lib Files as Linker Input"
-title: ".Lib Files as Linker Input"
-ms.date: "11/04/2016"
+description: "Learn more about: .lib files as linker input"
+title: ".lib files as linker input"
+ms.date: 09/09/2022
f1_keywords: ["VC.Project.VCLinkerTool.AdditionalDependencies"]
helpviewer_keywords: ["OMF libraries", "linking [C++], OMF libraries", "import libraries, linker files", "libraries [C++], .lib files as linker input", "COFF files, import libraries", "default libraries [C++], linker output", "default libraries [C++]", "defaults [C++], libraries", ".lib files"]
ms.assetid: dc5d2b1c-2487-41fa-aa71-ad1e0647958b
---
-# .Lib Files as Linker Input
+# `.lib` files as linker input
-LINK accepts COFF standard libraries and COFF import libraries, both of which usually have the extension .lib. Standard libraries contain objects and are created by the LIB tool. Import libraries contain information about exports in other programs and are created either by LINK when it builds a program that contains exports or by the LIB tool. For information on using LIB to create standard or import libraries, see [LIB Reference](lib-reference.md). For details on using LINK to create an import library, see the [/DLL](dll-build-a-dll.md) option.
+LINK accepts COFF standard libraries and COFF import libraries, both of which usually have the extension *`.lib`*. Standard libraries contain objects and are created by the LIB tool. Import libraries contain information about exports in other programs and are created either by LINK when it builds a program that contains exports or by the LIB tool. For information on using LIB to create standard or import libraries, see [LIB Reference](lib-reference.md). For details on using LINK to create an import library, see the [`/DLL`](dll-build-a-dll.md) option.
-A library is specified to LINK as either a file name argument or a default library. LINK resolves external references by searching first in libraries specified on the command line, then in default libraries specified with the [/DEFAULTLIB](defaultlib-specify-default-library.md) option, and then in default libraries named in .obj files. If a path is specified with the library name, LINK looks for the library in that directory. If no path is specified, LINK looks first in the directory that LINK is running from, and then in any directories specified in the LIB environment variable.
+A library is specified to LINK as either a file name argument or a default library. LINK resolves external references by searching first in libraries specified on the command line, then in default libraries specified with the [`/DEFAULTLIB`](defaultlib-specify-default-library.md) option, and then in default libraries named in *`.obj`* files. If a path is specified with the library name, LINK looks for the library in that directory. If no path is specified, LINK looks first in the directory that LINK is running from, and then in any directories specified in the `LIB` environment variable.
-## To add .lib files as linker input in the development environment
+## To add `.lib` files as linker input in the development environment
-1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+1. Open the project's **Property Pages** dialog box. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
-1. Choose the **Input** property page in the **Linker** folder.
+1. Choose the **Configuration Properties** > **Linker** > **Input** property page.
-1. Modify the **Additional Dependencies** property to add the .lib files.
+1. Modify the **Additional Dependencies** property to add the *`.lib`* files.
-## To programmatically add .lib files as linker input
+1. Choose **OK** or **Apply** to save your changes.
-- See [AdditionalDependencies](/dotnet/api/microsoft.visualstudio.vcprojectengine.vclinkertool.additionaldependencies).
+## To programmatically add `.lib` files as linker input
+
+- See .
## Example
-The following sample shows how to build and use a .lib file. First, build a .lib file:
+The following sample shows how to build and use a *`.lib`* file.
+
+First, build the *`.lib`* file:
```cpp
// lib_link_input_1.cpp
@@ -36,7 +40,7 @@ __declspec(dllexport) int Test() {
}
```
-And then, compile this sample by using the .lib file you just created:
+And then, compile this sample by using the *`.lib`* file you just created:
```cpp
// lib_link_input_2.cpp
@@ -54,5 +58,5 @@ int main() {
## See also
-[LINK Input Files](link-input-files.md)
-[MSVC Linker Options](linker-options.md)
+[LINK input files](link-input-files.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/dumpbin-options.md b/docs/build/reference/dumpbin-options.md
index 2bedc34b9e..71bd3a9c66 100644
--- a/docs/build/reference/dumpbin-options.md
+++ b/docs/build/reference/dumpbin-options.md
@@ -1,9 +1,8 @@
---
title: "DUMPBIN options"
description: "Reference guide to the Microsoft DUMPBIN utility command-line options."
-ms.date: "02/09/2020"
+ms.date: 02/09/2020
helpviewer_keywords: ["DUMPBIN program, options"]
-ms.assetid: 563b696e-7599-4480-94b9-014776289ec8
---
# DUMPBIN options
@@ -49,7 +48,7 @@ DUMPBIN has the following options:
- [/PDBPATH\[:VERBOSE\]](pdbpath.md)
-- [/RANGEE:vaMin\[,vaMax\]](range.md)
+- [/RANGE:vaMin\[,vaMax\]](range.md)
- [/RAWDATA\[:{NONE\|1\|2\|4\|8}\[,#\]\]](rawdata.md)
diff --git a/docs/build/reference/dynamic-deopt-linker.md b/docs/build/reference/dynamic-deopt-linker.md
new file mode 100644
index 0000000000..6d4602acfc
--- /dev/null
+++ b/docs/build/reference/dynamic-deopt-linker.md
@@ -0,0 +1,53 @@
+---
+title: "/DYNAMICDEOPT (Support C++ Dynamic Debugging) (Preview)"
+description: "Learn more about: /DYNAMICDEOPT (Support C++ Dynamic Debugging)."
+ms.date: 03/14/2025
+f1_keywords: ["VC.Project.VCLinkerTool.GenerateDynamicDeoptInformation", "/dynamicdeopt"]
+helpviewer_keywords: ["DYNAMICDEOPT linker option", "/DYNAMICDEOPT linker option", "-DYNAMICDEOPT linker option", "c++ dynamic debugging"]
+---
+# `/DYNAMICDEOPT` (Support C++ Dynamic Debugging) (Preview)
+
+> [!IMPORTANT]
+> The `/DYNAMICDEOPT` linker switch is currently in PREVIEW.
+> This information relates to a prerelease feature that might be substantially modified before release. Microsoft makes no warranties, expressed or implied, with respect to the information provided here.
+
+The **`/DYNAMICDEOPT`** linker option, when used with the compiler switch [`/dynamicdeopt`](dynamic-deopt.md), enables [C++ Dynamic Debugging (Preview)](/visualstudio/debugger/cpp-dynamic-debugging), which allows you to debug optimized code as if it were compiled deoptimized and step in anywhere with on-demand function deoptimization.
+
+## Syntax
+
+> **`/DYNAMICDEOPT`**\
+> **`/DYNAMICDEOPT:SUFFIX=`**\
+> **`/DYNAMICDEOPT:SYNC`**
+
+## Arguments
+
+*`suffix`*\
+Specify the file extension for the deoptimized output.
+
+With no options and given `test.cpp` as input, the compiler output includes `test.obj`, `test.exe`, and `test.pdb`, as well as `test.alt.obj`, `test.alt.exe`, and `test.alt.pdb`. This switch allows you to change the suffix for the unoptimized binary build artifacts from `.alt` to something else. If you change the suffix, all files must use the new suffix, and it needs to match the name passed to the compiler using [`/dynamicdeopt:suffix` (Preview)](dynamic-deopt.md). You typically don't use this switch unless you need to avoid filename collisions with other files that you have.
+
+*`SYNC`*\
+Builds the deoptimized output after building the optimized output instead of in parallel. By default, the compiler spawns a parallel linker to link the unoptimized binary. This switch makes the second link run serially after the first one. This switch is provided in case this better suits your build environment.
+
+## Remarks
+
+This preview flag, available starting with Visual Studio 2022 Version 17.14 Preview 2, applies only to x64 projects.
+
+IncrediBuild 10.24 supports C++ Dynamic Debugging builds.\
+FastBuild v1.15 supports C++ Dynamic Debugging builds.
+
+### Set this linker option in the Visual Studio development environment
+
+1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+1. Select the **Linker** > **Debugging** property page.
+
+### Set this linker option programmatically
+
+- See .
+
+## See also
+
+[`/dynamicdeopt` (Enable C++ Dynamic Debugging) (Preview)](dynamic-deopt.md)\
+[C++ Dynamic Debugging (Preview)](/visualstudio/debugger/cpp-dynamic-debugging)\
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/dynamic-deopt.md b/docs/build/reference/dynamic-deopt.md
new file mode 100644
index 0000000000..33edd942e3
--- /dev/null
+++ b/docs/build/reference/dynamic-deopt.md
@@ -0,0 +1,78 @@
+---
+title: "/dynamicdeopt (Enable C++ Dynamic Debugging (Preview))"
+description: "Enable the Microsoft C++ compiler option /dynamicdeopt to use C++ Dynamic Debugging."
+ms.date: 04/01/2025
+f1_keywords: ["/dynamicdeopt"]
+helpviewer_keywords: ["-dynamicdeopt compiler option [C++]", "dynamicdeopt compiler option [C++]"]
+---
+# `/dynamicdeopt` (Enable C++ Dynamic Debugging) (Preview)
+
+> [!IMPORTANT]
+> The `/dynamicdeopt` compiler switch is currently in PREVIEW.
+> This information relates to a prerelease feature that might be substantially modified before release. Microsoft makes no warranties, expressed or implied, with respect to the information provided here.
+
+Enable [C++ Dynamic Debugging (Preview)](/visualstudio/debugger/cpp-dynamic-debugging) so you can debug optimized code as if it were compiled deoptimized and step in anywhere with on-demand function deoptimization.
+
+## Syntax
+
+> **`/dynamicdeopt`**\
+> **`/dynamicdeopt:suffix `**\
+> **`/dynamicdeopt:sync`**
+
+## Arguments
+
+*`suffix`*\
+Specify the file extension for the deoptimized output.
+
+With no options and given `test.cpp` as input, your output includes `test.obj`, `test.exe`, and `test.pdb`, as well as `test.alt.obj`, `test.alt.exe`, and `test.alt.pdb`. This switch allows you to change the suffix of the unoptimized binary build artifacts from `.alt` to something else. If you change the suffix, all files must use the new suffix, and it needs to match the name passed to the linker using [`/dynamicdeopt:suffix` (Preview)](dynamic-deopt-linker.md). You typically don't use this switch unless you need to avoid filename collisions with other files that you have.
+
+*`sync`*\
+Builds the deoptimized output after building the optimized output instead of in parallel. By default, the compiler spawns a parallel instance of the code generator. This switch makes them run serially instead. This switch is provided in case this better suits your build environment.
+
+## Remarks
+
+This preview flag, available starting with Visual Studio 2022 Version 17.14 Preview 2, applies only to x64 projects and must be used with the corresponding linker flag, [`/DYNAMICDEOPT`](dynamic-deopt-linker.md).
+
+Compiling with `/dynamicdeopt` generates other binaries that are used for debugging. When you debug an optimized function in an optimized file, the debugger steps into the alternate binary instead. This allows you to debug as if you're debugging unoptimized code while still getting the performance advantages of optimized code.
+
+`/dynamicdeopt` requires:
+
+`/DEBUG` or `/DEBUG:FULL`. If you don't specify `/DEBUG`, or if you specify `/DEBUG:FASTLINK`, the linker gives a fatal error.
+If you specify `/INCREMENTAL`, the compiler generates a warning and automatically turns off `/INCREMENTAL`.
+If you specify `/OPT:ICF`, the compiler generates a warning that the debug experience isn't as good. This is because ICF can cause functions to be removed from the alt file, which means you can't step into them.
+
+IncrediBuild 10.24 supports C++ Dynamic Debugging builds.\
+FastBuild v1.15 supports C++ Dynamic Debugging builds.
+
+`/dynamicdeopt` is incompatible with edit-and-continue and the following compiler switches:
+
+```cpp
+/GL
+/ZI
+/RTC1
+/RTCs
+/RTCc
+/RTCu
+/GH
+/Gh
+/fastcap
+/callcap
+/ZW
+/fsanitize=address
+/fsanitize=kernel-address
+All of the CLR flags
+```
+
+### Set this linker option in the Visual Studio development environment
+
+You can set this switch inside Visual Studio. For more information, see [C++ Dynamic Debugging (Preview)](/visualstudio/debugger/cpp-dynamic-debugging#build-system-integration). There are advantages to setting the switch in Visual Studio because MSBuild automatically suppresses some of the incompatible switches such as `/GL` and `/OPT:ICF`. It also sets the corresponding linker option (`/DYNAMICDEOPT`). You can also set the switch in the command line.
+
+### Set this compiler option programmatically
+
+- See .
+
+## See also
+
+[C++ Dynamic Debugging (Preview)](/visualstudio/debugger/cpp-dynamic-debugging)\
+[MSVC Compiler Options](compiler-options.md)\
+[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
diff --git a/docs/build/reference/dynamicbase-use-address-space-layout-randomization.md b/docs/build/reference/dynamicbase-use-address-space-layout-randomization.md
index a611af178f..b5ca6135c2 100644
--- a/docs/build/reference/dynamicbase-use-address-space-layout-randomization.md
+++ b/docs/build/reference/dynamicbase-use-address-space-layout-randomization.md
@@ -1,24 +1,26 @@
---
description: "Learn more about: /DYNAMICBASE (Use address space layout randomization)"
title: "/DYNAMICBASE (Use address space layout randomization)"
-ms.date: "06/12/2018"
+ms.date: 05/05/2022
f1_keywords: ["VC.Project.VCLinkerTool.RandomizedBaseAddress"]
helpviewer_keywords: ["-DYNAMICBASE linker option", "/DYNAMICBASE linker option", "DYNAMICBASE linker option"]
ms.assetid: 6c0ced8e-fe9c-4b63-b956-eb8a55fbceb2
---
-# /DYNAMICBASE (Use address space layout randomization)
+# `/DYNAMICBASE` (Use address space layout randomization)
-Specifies whether to generate an executable image that can be randomly rebased at load time by using the address space layout randomization (ASLR) feature of Windows that was first available in Windows Vista.
+Specifies whether to generate an executable image that can be randomly rebased at load time by using the address space layout randomization (ASLR) feature of Windows. ASLR was first available in Windows Vista.
## Syntax
-> **/DYNAMICBASE**[**:NO**]
+> **`/DYNAMICBASE`**[**`:NO`**]
## Remarks
-The **/DYNAMICBASE** option modifies the header of an *executable image*, a .dll or .exe file, to indicate whether the application should be randomly rebased at load time, and enables virtual address allocation randomization, which affects the virtual memory location of heaps, stacks, and other operating system allocations. The **/DYNAMICBASE** option applies to both 32-bit and 64-bit images. ASLR is supported on Windows Vista and later operating systems. The option is ignored by earlier operating systems.
+The **`/DYNAMICBASE`** option modifies the header of an *executable image*, a .dll or .exe file, to indicate whether the application should be randomly rebased at load time, and enables virtual address allocation randomization, which affects the virtual memory location of heaps, stacks, and other operating system allocations. The **`/DYNAMICBASE`** option applies to both 32-bit and 64-bit images. ASLR is supported on Windows Vista and later operating systems. The option is ignored by earlier operating systems.
-By default, **/DYNAMICBASE** is enabled. To disable this option, use **/DYNAMICBASE:NO**. The **/DYNAMICBASE** option is required for the [/HIGHENTROPYVA](highentropyva-support-64-bit-aslr.md) option to have an effect.
+By default, **`/DYNAMICBASE`** is enabled. To disable this option, use **`/DYNAMICBASE:NO`**. The **`/DYNAMICBASE`** option is required for the [`/HIGHENTROPYVA`](highentropyva-support-64-bit-aslr.md) option to have an effect.
+
+Because ASLR can't be disabled on ARM, ARM64, or ARM64EC architectures, **`/DYNAMICBASE:NO`** isn't supported for these targets.
### To set this linker option in Visual Studio
@@ -35,6 +37,6 @@ By default, **/DYNAMICBASE** is enabled. To disable this option, use **/DYNAMICB
## See also
- [MSVC linker reference](linking.md)
-- [MSVC Linker Options](linker-options.md)
-- [/HIGHENTROPYVA](highentropyva-support-64-bit-aslr.md)
+- [MSVC linker options](linker-options.md)
+- [`/HIGHENTROPYVA`](highentropyva-support-64-bit-aslr.md)
- [Windows ISV Software Security Defenses](/previous-versions/bb430720(v=msdn.10))
diff --git a/docs/build/reference/dynamicbase.md b/docs/build/reference/dynamicbase.md
index 7d42ad401b..9ccddd3219 100644
--- a/docs/build/reference/dynamicbase.md
+++ b/docs/build/reference/dynamicbase.md
@@ -1,24 +1,26 @@
---
description: "Learn more about: /DYNAMICBASE"
title: "/DYNAMICBASE"
-ms.date: "06/12/2018"
+ms.date: "05/05/2022"
f1_keywords: ["/dynamicbase"]
helpviewer_keywords: ["-DYNAMICBASE editbin option", "DYNAMICBASE editbin option", "/DYNAMICBASE editbin option"]
ms.assetid: edb3df90-7b07-42fb-a94a-f5a4c1d325d6
---
-# /DYNAMICBASE
+# `/DYNAMICBASE`
Specifies whether to generate an executable image that can be randomly rebased at load time by using the address space layout randomization (ASLR) feature of Windows that was first available in Windows Vista.
## Syntax
-> **/DYNAMICBASE**[**:NO**]
+> **`/DYNAMICBASE`**[**`:NO`**]
## Remarks
-The **/DYNAMICBASE** option modifies the header of an *executable image*, a .dll or .exe file, to indicate whether the application should be randomly rebased at load time, and enables virtual address allocation randomization, which affects the virtual memory location of heaps, stacks, and other operating system allocations. The **/DYNAMICBASE** option applies to both 32-bit and 64-bit images. ASLR is supported on Windows Vista and later operating systems. The option is ignored by earlier operating systems.
+The **`/DYNAMICBASE`** option modifies the header of an *executable image*, a .dll or .exe file, to indicate whether the application should be randomly rebased at load time, and enables virtual address allocation randomization, which affects the virtual memory location of heaps, stacks, and other operating system allocations. The **`/DYNAMICBASE`** option applies to both 32-bit and 64-bit images. ASLR is supported on Windows Vista and later operating systems. The option is ignored by earlier operating systems.
-By default, **/DYNAMICBASE** is enabled. To disable this option, use **/DYNAMICBASE:NO**. The **/DYNAMICBASE** option is required for the [/HIGHENTROPYVA](highentropyva-support-64-bit-aslr.md) option to have an effect.
+By default, **`/DYNAMICBASE`** is enabled. To disable this option, use **`/DYNAMICBASE:NO`**. The **`/DYNAMICBASE`** option is required for the [`/HIGHENTROPYVA`](highentropyva-support-64-bit-aslr.md) option to have an effect.
+
+Because ASLR can't be disabled on ARM, ARM64, or ARM64EC architectures, **`/DYNAMICBASE:NO`** isn't supported for these targets.
## See also
diff --git a/docs/build/reference/execution-charset-set-execution-character-set.md b/docs/build/reference/execution-charset-set-execution-character-set.md
index fda1c306f4..2d67217025 100644
--- a/docs/build/reference/execution-charset-set-execution-character-set.md
+++ b/docs/build/reference/execution-charset-set-execution-character-set.md
@@ -1,51 +1,49 @@
---
-description: "Learn more about: /execution-charset (Set Execution Character Set)"
-title: "/execution-charset (Set Execution Character Set)"
-ms.date: "02/06/2019"
+description: "Learn more about: /execution-charset (Set execution character set)"
+title: "/execution-charset (Set execution character set)"
+ms.date: 01/31/2022
f1_keywords: ["execution-charset", "/execution-charset"]
helpviewer_keywords: ["/execution-charset compiler option", "-execution-charset compiler option"]
ms.assetid: 0e02f487-2236-45bc-95f3-5760933a8f96
---
-# /execution-charset (Set Execution Character Set)
+# `/execution-charset` (Set execution character set)
-Lets you specify the execution character set for your executable.
+This option lets you specify the execution character set for your executable.
## Syntax
-```
-/execution-charset:[IANA_name|.CPID]
-```
+> **`/execution-charset:`**[*`IANA_name`* | *`.CPID`*]
## Arguments
-*IANA_name*
+*`IANA_name`*\
The IANA-defined character set name.
-*CPID*
-The code page identifier.
+*`.CPID`*\
+The code page identifier, preceded by a `.` character.
## Remarks
-You can use the **/execution-charset** option to specify an execution character set. The execution character set is the encoding used for the text of your program that is input to the compilation phase after all preprocessing steps. This character set is used for the internal representation of any string or character literals in the compiled code. Set this option to specify the extended execution character set to use when your source files include characters that are not representable in the basic execution character set. You can use either the IANA or ISO character set name, or a dot (.) followed by a 3 to 5 digit decimal code page identifier to specify the character set to use. For a list of supported code page identifiers and character set names, see [Code Page Identifiers](/windows/win32/Intl/code-page-identifiers).
+You can use the **`/execution-charset`** option to specify an execution character set. The execution character set is the encoding used for the text of your program that is input to the compilation phase after all preprocessing steps. This character set is used for the internal representation of any string or character literals in the compiled code. Set this option to specify the extended execution character set to use when your source files include characters that are not representable in the basic execution character set. You can use either the IANA or ISO character set name, or a dot (`.`) followed by 3-5 decimal digits that specify the code page identifier of the character set to use. For a list of supported code page identifiers and character set names, see [Code Page Identifiers](/windows/win32/Intl/code-page-identifiers).
-By default, Visual Studio detects a byte-order mark to determine if the source file is in an encoded Unicode format, for example, UTF-16 or UTF-8. If no byte-order mark is found, it assumes the source file is encoded using the current user code page, unless you have specified a character set name or code page by using the **/source-charset** option or the **/utf-8** option. Visual Studio allows you to save your C++ source code by using any of several character encodings. For information about source and execution character sets, see [Character Sets](../../cpp/character-sets.md) in the language documentation.
+By default, Visual Studio detects a byte-order mark to determine if the source file is in an encoded Unicode format, for example, UTF-16 or UTF-8. If no byte-order mark is found, it assumes that the source file is encoded in the current user code page, unless you used the **`/source-charset`** or **`/utf-8`** option to specify a character set name or code page. Visual Studio allows you to save your C++ source code in any of several character encodings. For information about source and execution character sets, see [Character sets](../../cpp/character-sets.md) in the language documentation.
-If you want to set both the source character set and the execution character set to UTF-8, you can use the **/utf-8** compiler option as a shortcut. It is equivalent to specifying **/source-charset:utf-8 /execution-charset:utf-8** on the command line. Any of these options also enables the **/validate-charset** option by default.
+If you want to set both the source character set and the execution character set to UTF-8, you can use the **`/utf-8`** compiler option as a shortcut. It's equivalent to **`/source-charset:utf-8 /execution-charset:utf-8`** on the command line. Any of these options also enables the **`/validate-charset`** option by default.
### To set this compiler option in the Visual Studio development environment
-1. Open the project **Property Pages** dialog box. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+1. Open the **Property Pages** dialog box for your project. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
-1. In **Additional Options**, add the **/execution-charset** option, and specify your preferred encoding.
+1. In **Additional Options**, add the **`/execution-charset`** option, and specify your preferred encoding.
1. Choose **OK** to save your changes.
## See also
-[MSVC Compiler Options](compiler-options.md)
-[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
-[/source-charset (Set Source Character Set)](source-charset-set-source-character-set.md)
-[/utf-8 (Set Source and Executable character sets to UTF-8)](utf-8-set-source-and-executable-character-sets-to-utf-8.md)
-[/validate-charset (Validate for compatible characters)](validate-charset-validate-for-compatible-characters.md)
+[MSVC compiler options](compiler-options.md)\
+[MSVC compiler command-line syntax](compiler-command-line-syntax.md)\
+[`/source-charset` (Set source character set)](source-charset-set-source-character-set.md)\
+[`/utf-8` (Set source and execution character sets to UTF-8)](utf-8-set-source-and-executable-character-sets-to-utf-8.md)\
+[`/validate-charset` (Validate for compatible characters)](validate-charset-validate-for-compatible-characters.md)
diff --git a/docs/build/reference/experimental-log.md b/docs/build/reference/experimental-log.md
new file mode 100644
index 0000000000..413151fd86
--- /dev/null
+++ b/docs/build/reference/experimental-log.md
@@ -0,0 +1,56 @@
+---
+title: "/experimental:log (Structured SARIF diagnostics)"
+description: "The /experimental:log compiler option outputs experimental structured SARIF output for diagnostics."
+ms.date: 06/05/2025
+f1_keywords: ["/experimental:log"]
+helpviewer_keywords: ["/experimental:log", "SARIF", "structured diagnostics"]
+---
+# `/experimental:log` (Structured SARIF diagnostics)
+
+Output [SARIF](https://sarifweb.azurewebsites.net/) diagnostics to the specified file or directory. For more information, see [Structured SARIF Diagnostics](sarif-output.md).
+
+## Syntax
+
+> **`/experimental:log`** *filename*\
+> **`/experimental:log`** *directoryname\\*
+
+## Arguments
+
+*filename*
+
+The output file for SARIF diagnostics. The compiler automatically adds the `.sarif` extension to *filename*. The space between `/experimental:log` and *filename* is optional. Use double quotes around paths containing spaces. Both relative and absolute paths are supported.
+
+*directoryname\\*
+
+The output directory for SARIF diagnostics (for example, `/experimental:log sarif_output\`). Remember to add the trailing backslash (`\`) to indicate it's a directory. Each source file name forms the base name for each SARIF file saved in the directory. The compiler automatically adds the `.sarif` extension to each file name. The space between `/experimental:log` and *directoryname\\* is optional. Use double quotes around paths containing spaces. Both relative and absolute paths are supported.
+
+## Remarks
+
+This option is available starting in Visual Studio 2022 version 17.8.
+
+Diagnostics are also output as text to the console as usual.
+
+### To set this compiler option in the Visual Studio development environment
+
+1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+1. Select the specific project **Configuration** and **Platform** for which you want to change the property. You can also choose **"All Configurations"** and **"All Platforms"**.
+1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
+1. Modify the **Additional Options** property, and then choose **OK**.
+
+## Examples
+
+The following command produces SARIF information for the compilation of `main.cpp` and saves it in the file `mySarifInfo.sarif`:
+
+```cmd
+cl /experimental:log mySarifInfo main.cpp
+```
+
+The following command produces SARIF information for the entire compilation and saves it in the `sarif_output` directory in the files `main.sarif` and `other.sarif`:
+
+```cmd
+cl /experimental:log sarif_output\ main.cpp other.cpp
+```
+
+## See also
+
+[Structured SARIF Diagnostics](sarif-output.md)
diff --git a/docs/build/reference/experimental-module.md b/docs/build/reference/experimental-module.md
index e8c53e432b..bfbcec74a8 100644
--- a/docs/build/reference/experimental-module.md
+++ b/docs/build/reference/experimental-module.md
@@ -1,13 +1,13 @@
---
title: "/experimental:module (Enable module support)"
description: "Use the /experimental:module compiler option to enable experimental compiler support for named modules."
-ms.date: "04/13/2021"
+ms.date: 02/12/2025
f1_keywords: ["module", "/experimental:module"]
helpviewer_keywords: ["module", "/experimental:module", "Enable module support"]
---
-# `/experimental:module` (Enable module support)
+# `/experimental:module` (Enable experimental module support)
-Enables experimental compiler support for C++ Standard modules. This option is obsolete in Visual Studio version 16.11 and later.
+Enables compiler support for Microsoft's experimental form of C++ Standard modules. This option is obsolete in Visual Studio 2019 version 16.11 and later.
## Syntax
@@ -15,24 +15,46 @@ Enables experimental compiler support for C++ Standard modules. This option is o
## Remarks
-In versions of Visual Studio before Visual Studio 2019 version 16.11, you can enable experimental modules support by use of the **`/experimental:module`** compiler option along with the [`/std:c++latest`](std-specify-language-standard-version.md) option. In Visual Studio 2019 version 16.11, module support is enabled automatically by either **`/std:c++20`** or **`/std:c++latest`**. Use **`/experimental:module-`** to disable module support explicitly.
+ This switch applies to the time before the new, standardized, way of consuming the C++ Standard Library as modules was available. Although you can use this switch to use the older experimental named modules, we recommend that you use the new, standardized, way of consuming the C++ Standard Library as modules described in [Import the C++ standard library using modules](../../cpp/tutorial-import-stl-named-module.md).
-This option is available starting in Visual Studio 2015 Update 1. As of Visual Studio 2019 version 16.2, C++20 Standard modules aren't fully implemented in the Microsoft C++ compiler. Modules support is feature complete in Visual Studio 2019 version 16.10. You can use the modules feature import the Standard Library modules provided by Microsoft. A module and the code that consumes it must be compiled with the same compiler options.
+This compiler switch is available starting in Visual Studio 2015 Update 1. In the VS Installer under the **Individual components** tab, ensure that **C++ Modules for v143 build tools (x64/x86 - experimental)** is selected. You can use the search box with **experimental** to find it. For more information, see [Install C and C++ support in Visual Studio](../vscpp-step-0-installation.md).
-For more information on modules and how to use and create them, see [Overview of modules in C++](../../cpp/modules-cpp.md).
+| Version | Status |
+|---|---|
+| Visual Studio 2015 Update 1 | `/experimental:module` introduced. |
+| Visual Studio 2019 version 16.10 | C++20 modules support is feature complete. |
+| Visual Studio 2019 16.11 and earlier | Enable experimental modules support using **`/experimental:module`** along with [`/std:c++latest`](std-specify-language-standard-version.md). |
+| Visual Studio 2019 version 16.11 and later | Modules support is enabled automatically with **`/std:c++20`** or later, or **`/std:c++latest`**. Use **`/experimental:module-`** to disable experimental module support. |
+
+The experimental library consists of the following named modules:
+
+- `std.regex` provides the content of header ``
+- `std.filesystem` provides the content of header ``
+- `std.memory` provides the content of header ``
+- `std.threading` provides the contents of headers ``, ``, ``, ``, ``, and ``
+- `std.core` provides everything else in the C++ Standard Library
+
+To consume these modules, add an import declaration to the top of the source code file. For example:
+
+```cpp
+import std.core;
+import std.regex;
+```
+
+To consume the experimental Microsoft Standard Library modules, compile your program with the [`/EHsc`](eh-exception-handling-model.md) and [`/MD`](md-mt-ld-use-run-time-library.md) options.
### To set this compiler option in the Visual Studio development environment
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
-
1. Set the **Configuration** drop-down to **All Configurations**.
-
1. Select the **Configuration Properties** > **C/C++** > **Language** property page.
-
1. Modify the **Enable C++ Modules (experimental)** property, and then choose **OK**.
+For more information about how to use and create modules, see [Overview of modules in C++](../../cpp/modules-cpp.md).
+
## See also
+[Import the C++ standard library using modules](../../cpp/tutorial-import-stl-named-module.md)\
[`/headerUnit` (Use header unit IFC)](headerunit.md)\
[`/exportHeader` (Create header units)](module-exportheader.md)\
[`/reference` (Use named module IFC)](module-reference.md)\
diff --git a/docs/build/reference/external-external-headers-diagnostics.md b/docs/build/reference/external-external-headers-diagnostics.md
index 9423c65d7b..30134f5f93 100644
--- a/docs/build/reference/external-external-headers-diagnostics.md
+++ b/docs/build/reference/external-external-headers-diagnostics.md
@@ -1,8 +1,8 @@
---
title: "/external (External headers diagnostics)"
description: "The Microsoft C++ compiler /external headers diagnostic options syntax and usage."
-ms.date: 07/02/2021
-f1_keywords: ["/external", "/external:anglebrackets", "/external:env:", "/external:I", "/external:W0", "/external:W1", "/external:W2", "/external:W3", "/external:W4", "/external:templates-", "/experimental:external"]
+ms.date: 06/29/2022
+f1_keywords: ["/external", "/external:anglebrackets", "/external:env:", "/external:I", "/external:W0", "/external:W1", "/external:W2", "/external:W3", "/external:W4", "/external:templates-", "/experimental:external", "VC.Project.VCCLCompilerTool.ExternalDirectoriesEnv", "VC.Project.VCCLCompilerTool.ExternalIncludeDirectories", "VC.Project.VCCLCompilerTool.ExternalWarningLevel", "VC.Project.VCCLCompilerTool.TreatExternalTemplatesAsInternal"]
helpviewer_keywords: ["/external compiler option [C++]", "-external compiler option [C++]", "external compiler option [C++]"]
---
# `/external` (External headers diagnostics)
@@ -18,7 +18,7 @@ Use external header options (Not required in 16.10 and later):
Specify external headers:
> **`/external:anglebrackets`**\
-> **`/external:env:`**_`var`_\
+> **`/external:env:`***`var`*\
> **`/external:I`** *`path`*
Specify diagnostics behavior:
@@ -40,7 +40,7 @@ Treats all headers included by `#include `, where the *`header`* file is
**`/external:I`** *`path`*\
Defines a root directory that contains external headers. All recursive subdirectories of *`path`* are considered external, but only the *`path`* value is added to the list of directories the compiler searches for include files. The space between **`/external:I`** and *`path`* is optional. Directories that include spaces must be enclosed in double quotes. A directory may be an absolute path or a relative path.
-**`/external:env:`**_`var`_\
+**`/external:env:`***`var`*\
Specifies the name of an environment variable *`var`* that holds a semicolon-separated list of external header directories. It's useful for build systems that rely on environment variables such as `INCLUDE`, which you use to specify the list of external include files. Or, `CAExcludePath`, for files that shouldn't be analyzed by `/analyze`. For example, you can specify `/external:env:INCLUDE` to make every directory in `INCLUDE` an external header directory at once. It's the same as using **`/external:I`** to specify the individual directories, but much less verbose. There should be no space between *`var`* and **`/external:env:`**.
**`/external:Wn`**\
@@ -68,6 +68,8 @@ All the existing mechanisms to enable, disable, and suppress warnings still work
This sample program has two source files, *`program.cpp`* and *`header_file.h`*. The *`header_file.h`* file is in an *`include_dir`* subdirectory of the directory containing the *`program.cpp`* file:
+Source file `include_dir/header_file.h`:
+
```cpp
// External header: include_dir/header_file.h
@@ -79,6 +81,8 @@ struct sample_struct
};
```
+Source file `program.cpp`:
+
```cpp
// User code: program.cpp
#include
@@ -97,7 +101,7 @@ cl /EHsc /I include_dir /W4 program.cpp
As expected, this sample generates a warning:
-```console
+```Output
program.cpp
include_dir\header_file.h(6): warning C4245: 'initializing': conversion from 'int' to 'const T', signed/unsigned mismatch
with
@@ -167,17 +171,41 @@ Some warnings emitted by the compiler's back-end code generation aren't affected
### To set this compiler option in the Visual Studio development environment
+In Visual Studio 2019 version 16.10 and later:
+
+1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+
+1. Select the **Configuration Properties** > **VC++ Directories** property page.
+
+1. Set the **External Include Directories** property to specify the IDE equivalent of the **`/external:I path`** option for each semicolon-delimited path.
+
+1. Select the **Configuration Properties** > **C/C++** > **External Includes** property page.
+
+1. Set properties:
+
+ - Set **Treat Files Included with Angle Brackets as External** to **Yes** to set the **`/external:anglebrackets`** option.
+
+ - **External Header Warning Level** allows you to set the **`/external:Wn`** option. If this value is set to **Inherit Project Warning Level** or the default, other **`/external`** options are ignored.
+
+ - Set **Template Diagnostics in External Headers** to **Yes** to set the **`/external:templates-`** option.
+
+1. Choose **OK** or **Apply** to save your changes.
+
+In versions of Visual Studio before Visual Studio 2019 version 16.10:
+
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
-1. Enter the compiler options[\*](#note_experimental) in the **Additional Options** box.
+1. Enter the **`/experimental:external`** option and other **`/external`** compiler options in the **Additional Options** box.
+
+1. Choose **OK** or **Apply** to save your changes.
### To set this compiler option programmatically
- See .
-\* Add the `/experimental:external` option to enable the external headers options in versions of Visual Studio before Visual Studio 2019 version 16.10.
+\* Add the **`/experimental:external`** option to enable the external headers options in versions of Visual Studio before Visual Studio 2019 version 16.10.
## See also
diff --git a/docs/build/reference/feature-arm64.md b/docs/build/reference/feature-arm64.md
new file mode 100644
index 0000000000..2954b4fed1
--- /dev/null
+++ b/docs/build/reference/feature-arm64.md
@@ -0,0 +1,47 @@
+---
+description: "Learn more about: /feature (ARM64)"
+title: "/feature (ARM64)"
+ms.date: 05/28/2024
+---
+# `/feature` (ARM64)
+
+Enable one or more Arm A-Profile architecture features for an ARM64 extension as specified by **`/arch`** (ARM64). For more information about **`/arch`** (ARM64), see [`/arch` (ARM64)](arch-arm64.md).
+
+## Syntax
+
+> **`/feature:`**[**`+arg2`**]
+
+## Arguments
+To enable one or more features the targeted ARM64 extension supports, specify one or more of the following feature arguments:
+
+| Feature argument | Feature identifier | Optional from | Enabled by default | Description | Supported in version
+|--|--|--|--|--|--|
+|**`lse`** | `FEAT_LSE` | Armv8.0 | Armv8.1 | Large System Extensions. | Visual Studio 2022 17.10
+|**`rcpc`** | `FEAT_LRCPC` | Armv8.2 | Armv8.3 | Load-Acquire RCpc instructions. | Visual Studio 2022 17.10
+|**`rcpc2`** | `FEAT_LRCPC2` | Armv8.2 | Armv8.4 | Load-Acquire RCpc instructions v2. | Visual Studio 2022 17.11
+
+## Remarks
+
+Example usage: to enable `FEAT_LSE`, specify **`/feature:lse`**.
+
+If there are conflicting feature arguments specified by **`/feature`**, the right-most feature is enabled. Enabling a feature the targeted ARM64 extension doesn't support may cause unexpected behavior, especially if a CPU doesn't implement the feature.
+
+Use either **`/feature`** or only **`/arch`** (ARM64) to specify features. For example, to enable `FEAT_LSE` when targeting Armv8.0-A, use both **`/feature:lse`** and **`/arch:armv8.0`**, or specify **`/arch:armv8.0+lse`**. **`/feature`** is a way to specify features without specifying them in **`/arch`** (ARM64).
+
+### To set the `/feature` compiler option in Visual Studio
+
+1. Open the **Property Pages** dialog box for the project. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+
+1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
+
+1. In the **Additional options** box, add *`/feature:lse`* or replace `lse` with the feature to enable. Choose **OK** to save your changes.
+
+### To set this compiler option programmatically
+
+- See .
+
+## See also
+
+[`/arch` (Minimum CPU architecture)](arch-minimum-cpu-architecture.md)\
+[MSVC compiler options](compiler-options.md)\
+[MSVC compiler command-line syntax](compiler-command-line-syntax.md)
diff --git a/docs/build/reference/filealign.md b/docs/build/reference/filealign.md
index 31f8c859d1..1e794ab0e1 100644
--- a/docs/build/reference/filealign.md
+++ b/docs/build/reference/filealign.md
@@ -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
diff --git a/docs/build/reference/fo-object-file-name.md b/docs/build/reference/fo-object-file-name.md
index ea78434297..a0be19b447 100644
--- a/docs/build/reference/fo-object-file-name.md
+++ b/docs/build/reference/fo-object-file-name.md
@@ -1,35 +1,47 @@
---
title: "/Fo (Object file name)"
description: "Reference guide to the Microsoft C++ /Fo (Object file name) compiler option in Visual Studio."
-ms.date: "04/20/2020"
+ms.date: 01/29/2024
f1_keywords: ["/Fo", "VC.Project.VCCLCompilerTool.ObjectFile", "VC.Project.VCCLWCECompilerTool.ObjectFile"]
helpviewer_keywords: ["Fo compiler option [C++]", "object files, naming", "/Fo compiler option [C++]", "-Fo compiler option [C++]"]
-ms.assetid: 0e6d593e-4e7f-4990-9e6e-92e1dcbcf6e6
---
-# /Fo (Object File Name)
+# `/Fo` (Object File Name)
Specifies an object (*`.obj`*) file name or directory to be used instead of the default.
## Syntax
-> **`/Fo`**_pathname_
+> **`/Fo"pathname"`**\
+> **`/Fo:[ ]"pathname"`**
## Remarks
-You can use the **`/Fo`** compiler option to set an output directory for all the object files generated by the CL compiler command. Or, you can use it to rename a single object file.
+You can use the **`/Fo`** compiler option to set an output directory for all the object files generated by the CL compiler command. Or, you can use it to rename a single object file. Don't put a space between the **`/Fo`** option and the *`pathname`* argument.
By default, the object files generated by the compiler are placed in the current directory. They're given the base name of the source file and a *`.obj`* extension.
-To use the **`/Fo`** option to rename an object file, specify the output filename as the *pathname* argument. When you rename an object file, you can use any name and extension you want, but the recommended convention is to use *`.obj`*. The compiler generates command line error D8036 if you specify a filename to **`/Fo`** when you've specified more than one source file to compile.
+To use the **`/Fo`** option to rename an object file, specify the output filename as the *`pathname`* argument. When you rename an object file, you can use any name and extension you want, but the recommended convention is to use an *`.obj`* extension. The compiler generates command line error D8036 if you specify a filename to **`/Fo`** when you've specified more than one source file to compile.
-To use the **`/Fo`** option to set an output directory for all object files created by the CL command, specify the directory as the *pathname* argument. A directory is indicated by a trailing slash in the *pathname* argument. The specified directory must exist; it's not created automatically.
+To use the **`/Fo`** option to set an output directory for all object files created by the CL command, specify the directory as the *`pathname`* argument. A directory is indicated by a trailing slash or backslash in the *`pathname`* argument. Use an escaped backslash (a double backslash), if you're using a quoted path. The directory path can be absolute, or relative to the source directory. The specified directory must exist, or the compiler reports error D8003. The directory isn't created automatically.
## Example
-The following command line creates an object file named *sample.obj* in an existing directory, *\\intermediate*, on drive D.
+This command line demonstrates the format that allows for an optional space between the `/Fo` option and the *`pathname`* argument. It creates an object file named *`test.obj`* in the current directory.
```cmd
-CL /Fo"D:\intermediate\" /EHsc /c sample.cpp
+CL /Fo: "test" /EHsc /c sample1.cpp
+```
+
+The following command line creates object files named *`sample1.obj`* and *`sample2.obj`* in an existing directory, *`D:\intermediate\`*. It uses escaped backslash characters as path segment separators in a quoted path:
+
+```cmd
+CL /Fo"D:\\intermediate\\" /EHsc /c sample1.cpp sample2.cpp
+```
+
+This command line creates object files named *`sample1.obj`* and *`sample2.obj`* in an existing directory, *`output\`*, relative to the source directory.
+
+```cmd
+CL /Fooutput\ /EHsc /c sample1.cpp sample2.cpp
```
## Set the option in Visual Studio or programmatically
@@ -40,7 +52,7 @@ CL /Fo"D:\intermediate\" /EHsc /c sample.cpp
1. Select the **Configuration Properties** > **C/C++** > **Output Files** property page.
-1. Modify the **Object File Name** property to set the output directory. In the IDE, the object file must have an extension of *`.obj`*.
+1. Modify the **Object File Name** property to set the output directory. In the IDE, the object files must have an extension of *`.obj`*.
### To set this compiler option programmatically
@@ -48,7 +60,7 @@ CL /Fo"D:\intermediate\" /EHsc /c sample.cpp
## See also
-[Output-File (/F) Options](output-file-f-options.md)
-[MSVC Compiler Options](compiler-options.md)
-[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
-[Specifying the Pathname](specifying-the-pathname.md)
+[Output-file (`/F`) options](output-file-f-options.md)\
+[MSVC compiler options](compiler-options.md)\
+[MSVC compiler command-line syntax](compiler-command-line-syntax.md)\
+[Specifying the pathname](specifying-the-pathname.md)
diff --git a/docs/build/reference/force-force-file-output.md b/docs/build/reference/force-force-file-output.md
index 1e013395bb..0df90153e1 100644
--- a/docs/build/reference/force-force-file-output.md
+++ b/docs/build/reference/force-force-file-output.md
@@ -1,44 +1,45 @@
---
-description: "Learn more about: /FORCE (Force File Output)"
-title: "/FORCE (Force File Output)"
-ms.date: "07/19/2019"
-f1_keywords: ["VC.Project.VCLinkerTool.ForceLink", "/force"]
+description: "Learn more about: /FORCE (Force file output)"
+title: "/FORCE (Force file output)"
+ms.date: 09/08/2022
+f1_keywords: ["VC.Project.VCLinkerTool.ForceFileOutput", "VC.Project.VCLinkerTool.ForceLink", "/force"]
helpviewer_keywords: ["FORCE linker option", "file output in linker", "/FORCE linker option", "-FORCE linker option"]
ms.assetid: b1e9a218-a5eb-4e60-a4a4-65b4be15e5da
---
-# /FORCE (Force File Output)
+# `/FORCE` (Force file output)
-```
-/FORCE:[MULTIPLE|UNRESOLVED]
-```
+Tells the linker to create an executable even if symbols are undefined or multiply defined.
-## Remarks
+## Syntax
-The /FORCE option tells the linker to create a valid .exe file or DLL even if a symbol is referenced but not defined or is multiply defined.
+> **`/FORCE`**\[**`:MULTIPLE`**\|**`:UNRESOLVED`**]
-The /FORCE option can take an optional argument:
+## Remarks
-- Use /FORCE:MULTIPLE to create an output file whether or not LINK finds more than one definition for a symbol.
+The **`/FORCE`** linker option tells the linker to create an executable image (EXE file or DLL) even if a symbol is referenced but not defined or is defined more than once.
-- Use /FORCE:UNRESOLVED to create an output file whether or not LINK finds an undefined symbol. /FORCE:UNRESOLVED is ignored if the entry point symbol is unresolved.
+> [!IMPORTANT]
+> The **`/FORCE`** option can create an executable that crashes or misbehaves at runtime if it references an undefined symbol or, when a multiply defined symbol has different definitions, if it invokes an unexpected definition in context.
-/FORCE with no arguments implies both multiple and unresolved.
+The **`/FORCE`** option can take an optional argument:
-A file created with this option may not run as expected. The linker will not link incrementally when the /FORCE option is specified.
+- Use **`/FORCE:MULTIPLE`** to create an output file whether or not LINK finds more than one definition for a symbol.
-If a module is compiled with **/clr**, **/FORCE** will not create an image.
+- Use **`/FORCE:UNRESOLVED`** to create an output file whether or not LINK finds an undefined symbol. **`/FORCE:UNRESOLVED`** is ignored if the entry point symbol is unresolved.
-### To set this linker option in the Visual Studio development environment
+**`/FORCE`** with no arguments implies both **`/FORCE:MULTIPLE`** and **`/FORCE:UNRESOLVED`**.
-1. Right-click on the project in **Solution Explorer** and choose **Properties**.
+The linker won't link incrementally when the **`/FORCE`** option is specified.
-1. Click the **Linker** folder.
+If a module is compiled with **`/clr`**, the linker ignores the **`/FORCE`** option.
+
+### To set this linker option in the Visual Studio development environment
-1. Click the **Command Line** property page.
+1. Open the project's **Property Pages** dialog box. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
-1. Type the option into the **Additional Options** box.
+1. Select the **Configuration Properties** > **Linker** > **General** property page.
-For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+1. Modify the **Force File Output** property. Choose **OK** or **Apply** to save your changes.
### To set this linker option programmatically
@@ -46,5 +47,5 @@ For more information, see [Set C++ compiler and build properties in Visual Studi
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/force-interlocked-functions.md b/docs/build/reference/force-interlocked-functions.md
new file mode 100644
index 0000000000..b0fb4df6fa
--- /dev/null
+++ b/docs/build/reference/force-interlocked-functions.md
@@ -0,0 +1,55 @@
+---
+title: "/forceInterlockedFunctions"
+description: "Learn more about /forceInterlockedFunctions"
+ms.date: 03/07/2025
+---
+# `/forceInterlockedFunctions`
+
+Dynamically selects between Armv8.0 load, store exclusive instructions or Armv8.1 Large System Extension (LSE) atomic instructions based on CPU capability at runtime.
+
+## Syntax
+
+> **`/forceInterlockedFunctions`**[**`-`**]
+
+## Remarks
+When possible, this flag avoids using Armv8.0 load and store exclusive instructions, as these instructions can result in livelocks.
+This flag forces the following interlocked intrinsics to be generated as out-of-line functions:
+
+|Operation|8|16|32|64|128|Pointer|
+|-|-------|--------|--------|--------|-------|-------|
+|Add|None|None|Full|Full|None|None|
+|And|Full|Full|Full|Full|None|None|
+|CompareExchange|Full|Full|Full|Full|Full|Full|
+|Decrement|None|Full|Full|Full|None|None|
+|Exchange|Full|Full|Full|Full|None|Full|
+|ExchangeAdd|Full|Full|Full|Full|None|None|
+|Increment|None|Full|Full|Full|None|None|
+|Or|Full|Full|Full|Full|None|None|
+|Xor|Full|Full|Full|Full|None|None|
+|bittestandreset|None|None|Full|Full|None|None|
+|bittestandset|None|None|Full|Full|None|None|
+
+Key:
+
+- **Full**: supports plain, `_acq`, `_rel`, and `_nf` forms.
+
+- **None**: Not supported
+
+For more information about interlocked intrinsics, see the "Interlocked intrinsics" section in [Arm64 Intrinsics](../../intrinsics/arm64-intrinsics.md).
+
+### To set the `/forceInterlockedFunctions` compiler option in Visual Studio
+
+1. Open the **Property Pages** dialog box for the project. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+
+1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
+
+1. In the **Additional options** box, add *`/forceInterlockedFunctions`* to enable. Choose **OK** to save your changes.
+
+### To set this compiler option programmatically
+
+- See .
+
+## See also
+[Arm64 Intrinsics](../../intrinsics/arm64-intrinsics.md)\
+[MSVC compiler options](compiler-options.md)\
+[MSVC compiler command-line syntax](compiler-command-line-syntax.md)
diff --git a/docs/build/reference/fr-fr-create-dot-sbr-file.md b/docs/build/reference/fr-fr-create-dot-sbr-file.md
index 18ee204b7f..4090865e8f 100644
--- a/docs/build/reference/fr-fr-create-dot-sbr-file.md
+++ b/docs/build/reference/fr-fr-create-dot-sbr-file.md
@@ -1,39 +1,40 @@
---
-description: "Learn more about: /FR, /Fr (Create .Sbr File)"
-title: "/FR, /Fr (Create .Sbr File)"
-ms.date: "11/04/2016"
+description: "Learn more about: /FR, /Fr (Name SBR file)"
+title: "/FR, /Fr (Name SBR file)"
+ms.date: 08/30/2022
f1_keywords: ["VC.Project.VCCLWCECompilerTool.BrowseInformation", "VC.Project.VCCLCompilerTool.BrowseInformation", "/fr", "VC.Project.VCCLCompilerTool.BrowseInformationFile", "VC.Project.VCCLWCECompilerTool.BrowseInformationFile"]
helpviewer_keywords: ["/FR compiler option [C++]", "-FR compiler option [C++]", "FR compiler option [C++]", "symbolic browser information"]
ms.assetid: 3fd8f88b-3924-4feb-9393-287036a28896
---
-# /FR, /Fr (Create .Sbr File)
+# `/FR`, `/Fr` (Name SBR file)
-Creates .sbr files.
+Creates *`.sbr`* (source browser) files, used by [Code maps](/visualstudio/modeling/code-maps-for-cpp), BSCMAKE, and some third-party code browsing tools.
## Syntax
-```
-/FR[pathname[\filename]]
-/Fr[pathname[\filename]]
-```
+> **`/FR`**\[*`pathname`*\[*`\filename`*]]\
+> **`/Fr`**\[*`pathname`*\[*`\filename`*]]
-## Remarks
+### Arguments
+
+*`pathname`*\
+The optional destination directory for the generated *`.sbr`* files. If this value isn't specified, the files are created in the default output directory. For more information, see [Specifying the pathname](specifying-the-pathname.md).
-> [!WARNING]
-> Although BSCMAKE is still installed with Visual Studio, it is no longer used by the IDE. Since Visual Studio 2008, browse and symbol information is stored automatically in a SQL Server .sdf file in the solution folder.
+*`filename`*\
+An optional filename for the generated *`.sbr`* file. If this value isn't specified, the compiler uses the base name of the source file with a *`.sbr`* extension. For more information, see [Specifying the pathname](specifying-the-pathname.md).
-During the build process, the Microsoft Browse Information File Maintenance Utility (BSCMAKE) uses these files to create a .BSC file, which is used to display browse information.
+## Remarks
-**/FR** creates an .sbr file with complete symbolic information.
+**`/FR`** creates an *`.sbr`* file with complete symbolic information.
-**/Fr** creates an .sbr file without information on local variables.
+**`/Fr`** creates an *`.sbr`* file without information on local variables. **`/Fr`** is deprecated; use **`/FR`** instead. For more information, see the Deprecated and removed compiler options section in [Compiler options listed by category](compiler-options-listed-by-category.md).
-If you do not specify `filename`, the .sbr file gets the same base name as the source file.
+The Visual Studio [Code Maps](/visualstudio/modeling/code-maps-for-cpp) feature requires the *`.sbr`* files generated by **`/FR`**.
-**/Fr** is deprecated; use **/FR** instead. For more information, see Deprecated and Removed Compiler Options in [Compiler Options Listed by Category](compiler-options-listed-by-category.md).
+The Microsoft Browse Information File Maintenance Utility (BSCMAKE) uses *`.sbr`* files to create a *`.bsc`* file, used to display browse information in some third-party tools. For more information, see [BSCMAKE reference](bscmake-reference.md).
> [!NOTE]
-> Do not change the .sbr extension. BSCMAKE requires the intermediary files to have that extension.
+> Although BSCMAKE is still installed with Visual Studio, it's no longer used by the IDE. Since Visual Studio 2008, browse and symbol information is stored automatically in a SQL Server SDF file in the solution folder. If you use BSCMAKE, don't change the *`.sbr`* extension. BSCMAKE requires the intermediate files to have that extension.
### To set this compiler option in the Visual Studio development environment
@@ -49,7 +50,7 @@ If you do not specify `filename`, the .sbr file gets the same base name as the s
## See also
-[Output-File (/F) Options](output-file-f-options.md)
-[MSVC Compiler Options](compiler-options.md)
-[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
-[Specifying the Pathname](specifying-the-pathname.md)
+[Output-File (`/F`) options](output-file-f-options.md)\
+[MSVC compiler options](compiler-options.md)\
+[MSVC compiler command-line syntax](compiler-command-line-syntax.md)\
+[Specifying the pathname](specifying-the-pathname.md)
diff --git a/docs/build/reference/fsanitize.md b/docs/build/reference/fsanitize.md
index 8106ba7c22..6e9e8c9439 100644
--- a/docs/build/reference/fsanitize.md
+++ b/docs/build/reference/fsanitize.md
@@ -1,8 +1,8 @@
---
description: "Learn more about the /fsanitize (enable sanitizers) compiler option"
title: "/fsanitize (Enable sanitizers)"
-ms.date: 09/15/2021
-f1_keywords: ["/fsanitize", "-fsanitize", "/fsanitize=address", "/fsanitize=fuzzer", "/fsanitize-address-use-after-return", "-fsanitize-address-use-after-return", "/fno-sanitize-address-vcasan-lib", "-fno-sanitize-address-vcasan-lib"]
+ms.date: 02/17/2022
+f1_keywords: ["/fsanitize", "-fsanitize", "/fsanitize=address", "/fsanitize=fuzzer", "/fsanitize-address-use-after-return", "-fsanitize-address-use-after-return", "/fno-sanitize-address-vcasan-lib", "-fno-sanitize-address-vcasan-lib", "VC.Project.VCCLCompilerTool.EnableASAN"]
helpviewer_keywords: ["/fsanitize [C++]", "-fsanitize=address [C++]", "address sanitizer compiler option [C++]", "/fsanitize-address-use-after-return", "/fno-sanitize-address-vcasan-lib"]
---
# `/fsanitize` (Enable sanitizers)
@@ -12,19 +12,24 @@ Use the **`/fsanitize`** compiler options to enable sanitizers.
## Syntax
> **`/fsanitize=address`**\
+> **`/fsanitize=kernel-address`**\
> **`/fsanitize=fuzzer`**\
> **`/fsanitize-address-use-after-return`**\
> **`/fno-sanitize-address-vcasan-lib`**
+> **`/fsanitize-address-asan-compat-lib`**
+> **`/fno-sanitize-address-asan-compat-lib`**
## Remarks
The **`/fsanitize=address`** compiler option enables [AddressSanitizer](../../sanitizers/asan.md), a powerful compiler and runtime technology to uncover [hard-to-find bugs](../../sanitizers/asan.md#error-types). Support for the **`/fsanitize=address`** option is available starting in Visual Studio 2019 version 16.9.
-The **`/fsanitize=fuzzer`** compiler option enables experimental support for [LibFuzzer](https://releases.llvm.org/3.8.0/docs/LibFuzzer.html). LibFuzzer is a coverage-guided fuzzing library that can be used to find bugs and crashes caused by user-provided input. We recommended you use **`/fsanitize=address`** with LibFuzzer. This option is useful for fuzzing tools such as OneFuzz. For more information, see the [OneFuzz documentation](https://www.microsoft.com/research/project/project-onefuzz/) and [OneFuzz GitHub project](https://github.com/microsoft/onefuzz). Support for the **`/fsanitize=fuzzer`** option is available starting in Visual Studio 2022 version 17.0.
+The **`/fsanitize=kernel-address`** compiler option enables [Kernel AddressSanitizer (KASan)](/windows-hardware/drivers/devtest/kasan). KASan is the kernel-mode variant of AddressSanitizer, available starting in Visual Studio 2022 version 17.11. KASan is only supported on Windows 11 24H2 or Windows Server 2025 and higher, and requires building using a Windows SDK 10.0.26100.2161 and higher. Building with KASan also implies the **`/fsanitize-address-asan-compat-lib`** compiler option.
+
+The **`/fsanitize=fuzzer`** compiler option enables experimental support for [LibFuzzer](https://llvm.org/docs/LibFuzzer.html). LibFuzzer is a coverage-guided fuzzing library that can be used to find bugs and crashes caused by user-provided input. We recommended you use **`/fsanitize=address`** with LibFuzzer. This option is useful for fuzzing tools such as OneFuzz. For more information, see the [OneFuzz documentation](https://www.microsoft.com/research/project/project-onefuzz/) and [OneFuzz GitHub project](https://github.com/microsoft/onefuzz). Support for the **`/fsanitize=fuzzer`** option is available starting in Visual Studio 2022 version 17.0.
The **`/fsanitize`** option doesn't allow comma-separated syntax, for example: **`/fsanitize=address,fuzzer`**. These options must be specified individually.
-The **`/fsanitize-address-use-after-return`** and **`/fno-sanitize-address-vcasan-lib`** compiler options, and the [`/INFERASANLIBS` (Use inferred sanitizer libs)](./inferasanlibs.md) and **`/INFERASANLIBS:NO`** linker options offer support for advanced users. For more information, see [AddressSanitizer build and language reference](../../sanitizers/asan-building.md).
+The **`/fsanitize-address-use-after-return`**, **`/fno-sanitize-address-vcasan-lib`**, **`/fsanitize-address-asan-compat-lib`**, and **`/fno-sanitize-address-asan-compat-lib`** compiler options, and the [`/INFERASANLIBS` (Use inferred sanitizer libs)](./inferasanlibs.md) and **`/INFERASANLIBS:NO`** linker options offer support for advanced users. For more information, see [AddressSanitizer build and language reference](../../sanitizers/asan-building.md).
### To set the **`/fsanitize=address`** compiler option in the Visual Studio development environment
diff --git a/docs/build/reference/functionpadmin-create-hotpatchable-image.md b/docs/build/reference/functionpadmin-create-hotpatchable-image.md
index 3795500ad1..98057d1ebd 100644
--- a/docs/build/reference/functionpadmin-create-hotpatchable-image.md
+++ b/docs/build/reference/functionpadmin-create-hotpatchable-image.md
@@ -1,37 +1,37 @@
---
-description: "Learn more about: /FUNCTIONPADMIN (Create Hotpatchable Image)"
-title: "/FUNCTIONPADMIN (Create Hotpatchable Image)"
-ms.date: "03/09/2018"
-f1_keywords: ["/functionpadmin"]
+description: "Learn more about: /FUNCTIONPADMIN (Create hotpatchable image)"
+title: "/FUNCTIONPADMIN (Create hotpatchable image)"
+ms.date: 09/09/2022
+f1_keywords: ["VC.Project.VCLinkerTool.CreateHotPatchableImage", "/functionpadmin"]
helpviewer_keywords: ["-FUNCTIONPADMIN linker option", "/FUNCTIONPADMIN linker option"]
ms.assetid: 25b02c13-1add-4fbd-add9-fcb30eb2cae7
---
-# /FUNCTIONPADMIN (Create Hotpatchable Image)
+# `/FUNCTIONPADMIN` (Create hotpatchable image)
-Prepares an image for hotpatching.
+Tells the linker to prepare an executable image for hot patching.
## Syntax
-> **/FUNCTIONPADMIN**[**:**_space_]
+> **`/FUNCTIONPADMIN`**[**`:`***`size`*]
### Arguments
-*space*
-The amount of padding to add to the beginning of each function in bytes. On x86 this defaults to 5 bytes of padding and on x64 this defaults to 6 bytes. On other targets a value must be provided.
+*`size`*\
+The amount of padding to add to the beginning of each function in bytes. On x86 the default is 5 bytes of padding and on x64 the default is 6 bytes. On other targets a value must be provided.
## Remarks
-In order for the linker to produce a hotpatchable image, the .obj files must have been compiled with [/hotpatch (Create Hotpatchable Image)](hotpatch-create-hotpatchable-image.md).
+In order for the linker to produce a hotpatchable image, the *`.obj`* files must be compiled by using the [`/hotpatch` (Create hotpatchable image)](hotpatch-create-hotpatchable-image.md) compiler option.
-When you compile and link an image with a single invocation of cl.exe, **/hotpatch** implies **/functionpadmin**.
+When you compile and link an image with a single invocation of cl.exe, **`/hotpatch`** implies **`/FUNCTIONPADMIN`**.
### To set this linker option in the Visual Studio development environment
-1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+1. Open the project's **Property Pages** dialog box. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
-1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
+1. Select the **Configuration Properties** > **Linker** > **General** property page.
-1. Enter the **/FUNCTIONPADMIN** option in **Additional Options**. Choose **OK** to save your changes.
+1. Modify the **Create Hot Patchable Image** property. Choose **OK** or **Apply** to save your changes.
### To set this linker option programmatically
@@ -39,5 +39,5 @@ When you compile and link an image with a single invocation of cl.exe, **/hotpat
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/gd-gr-gv-gz-calling-convention.md b/docs/build/reference/gd-gr-gv-gz-calling-convention.md
index 834a53189c..50380ebb09 100644
--- a/docs/build/reference/gd-gr-gv-gz-calling-convention.md
+++ b/docs/build/reference/gd-gr-gv-gz-calling-convention.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: /Gd, /Gr, /Gv, /Gz (Calling Convention)"
title: "/Gd, /Gr, /Gv, /Gz (Calling Convention)"
-ms.date: "09/05/2018"
+description: "Learn more about: /Gd, /Gr, /Gv, /Gz (Calling Convention)"
+ms.date: 09/05/2018
f1_keywords: ["/Gr", "/Gv", "/Gd", "VC.Project.VCCLCompilerTool.CallingConvention"]
helpviewer_keywords: ["-Gd compiler option [C++]", "-Gv compiler option [C++]", "/Gv compiler option [C++]", "-Gr compiler option [C++]", "Gd compiler option [C++]", "Gr compiler option [C++]", "/Gz compiler option [C++]", "-Gz compiler option [C++]", "/Gd compiler option [C++]", "Gz compiler option [C++]", "Gv compiler option [C++]", "/Gr compiler option [C++]"]
-ms.assetid: fd3110cb-2d77-49f2-99cf-a03f9ead00a3
---
# /Gd, /Gr, /Gv, /Gz (Calling Convention)
@@ -44,7 +43,7 @@ For more information about calling conventions, see [Calling Conventions](../../
On x86 processors, all function arguments are passed on the stack from right to left. On ARM and x64 architectures, some arguments are passed by register and the rest are passed on the stack from right to left. The calling routine pops the arguments from the stack.
-For C, the **`__cdecl`** naming convention uses the function name preceded by an underscore ( `_` ); no case translation is performed. Unless declared as `extern "C"`, C++ functions use a different name-decorating scheme. For more information, see [Decorated Names](decorated-names.md).
+For C, the **`__cdecl`** naming convention uses the function name preceded by an underscore (`_`); no case translation is performed. Unless declared as `extern "C"`, C++ functions use a different name-decorating scheme. For more information, see [Decorated Names](decorated-names.md).
## __fastcall Specifics
diff --git a/docs/build/reference/general-property-page-file.md b/docs/build/reference/general-property-page-file.md
index 5b9b42230a..f4dc2206c6 100644
--- a/docs/build/reference/general-property-page-file.md
+++ b/docs/build/reference/general-property-page-file.md
@@ -21,7 +21,7 @@ When you right-click on a file node **Solution Explorer**, the **General** prope
- **Item Type**
- The **Item Type** specifies the tool that will be used to process the file during the build process. [Files whose extension is known to Visual Studio](/visualstudio/extensibility/visual-cpp-project-extensibility#project-items) have a default value in this property. You can specify a custom tool here if you have a custom file type or wish to override the default tool for a known file type. See [Specifying Custom Build Tools](../specifying-custom-build-tools.md) for more information. You can also use this property page to specify that a file is not part of the build process.
+ The **Item Type** specifies the tool that will be used to process the file during the build process. [Files whose extension is known to Visual Studio](/visualstudio/extensibility/visual-cpp-project-extensibility#project-items) have a default value in this property. You can specify a custom tool here if you have a custom file type or wish to override the default tool for a known file type. For more information, see [Specifying Custom Build Tools](../specifying-custom-build-tools.md). You can also use this property page to specify that a file is not part of the build process.
The following illustration shows the property page for a *.cpp* file. The default **Item Type** for this kind of file is the **C/C++ Compiler** (*cl.exe*) and the property page exposes various compiler settings that can be applied to this file only.
diff --git a/docs/build/reference/genprofile-fastgenprofile-generate-profiling-instrumented-build.md b/docs/build/reference/genprofile-fastgenprofile-generate-profiling-instrumented-build.md
index e77bc2bfd9..37657efee2 100644
--- a/docs/build/reference/genprofile-fastgenprofile-generate-profiling-instrumented-build.md
+++ b/docs/build/reference/genprofile-fastgenprofile-generate-profiling-instrumented-build.md
@@ -1,7 +1,7 @@
---
-description: "Learn more about: /GENPROFILE, /FASTGENPROFILE (Generate Profiling Instrumented Build)"
title: "/GENPROFILE, /FASTGENPROFILE (Generate Profiling Instrumented Build)"
-ms.date: 04/14/2021
+description: "Learn more about: /GENPROFILE, /FASTGENPROFILE (Generate Profiling Instrumented Build)"
+ms.date: 03/27/2025
f1_keywords: ["GENPROFILE", "FASTGENPROFILE", "/GENPROFILE", "/FASTGENPROFILE"]
helpviewer_keywords: ["GENPROFILE", "FASTGENPROFILE"]
---
@@ -12,7 +12,7 @@ Specifies generation of a *`.pgd`* file by the linker to support profile-guided
## Syntax
> **`/GENPROFILE`**\[**`:`**_`profile-argument`_\[**`,`**_`profile-argument`_ ...]]\
-> **`/FASTGENPROFILE`**\[**`:`**_`profile-argument`_\[**`,`**_`profile-argument`_ ...]]\
+> **`/FASTGENPROFILE`**\[**`:`**_`profile-argument`_\[**`,`**_`profile-argument`_ ...]]
> *`profile-argument`*\
> { **`COUNTER32`** | **`COUNTER64`** }\
@@ -43,7 +43,7 @@ Use **`PATH`** to specify a separate set of PGO counters for each unique path t
Specifies whether to use extra counters to keep an accurate count when exceptions are thrown during training. Use **`TRACKEH`** to specify extra counters for an exact count. Use **`NOTRACKEH`** to specify single counters for code that doesn't use exception handling or that doesn't run into exceptions in your training scenarios. When you specify **`/GENPROFILE`**, the default is **`TRACKEH`** . When you specify **`/FASTGENPROFILE`**, the default is **`NOTRACKEH`** .
**`PGD`**=*filename*\
-Specifies a base file name for the *`.pgd`* file. By default, the linker uses the base executable image file name with a *`.pgd`* extension.
+Specifies a base filename for the *`.pgd`* file. By default, the linker uses the base executable image filename with a *`.pgd`* extension. When expanded, the fully qualified filename must not exceed `MAX_PATH` (260 characters).
## Remarks
diff --git a/docs/build/reference/gh-enable-penter-hook-function.md b/docs/build/reference/gh-enable-penter-hook-function.md
index 12a83774da..fbf4459ec3 100644
--- a/docs/build/reference/gh-enable-penter-hook-function.md
+++ b/docs/build/reference/gh-enable-penter-hook-function.md
@@ -1,7 +1,7 @@
---
title: "/Gh (Enable _penter hook function)"
description: "Describes the /Gh compiler option to call the supplied _penter function."
-ms.date: "07/06/2020"
+ms.date: 06/29/2022
f1_keywords: ["_penter"]
helpviewer_keywords: ["/Gh compiler option [C++]", "Gh compiler option [C++]", "_penter function", "-Gh compiler option [C++]"]
ms.assetid: 1510a082-8a0e-486e-a309-6add814b494f
@@ -42,6 +42,8 @@ This declaration isn't available for 64-bit projects.
The following code, when compiled with **/Gh**, shows how `_penter` is called twice; once when entering function `main` and once when entering function `x`. The example consists of two source files, which you compile separately.
+Source file `local_penter.cpp`:
+
```cpp
// local_penter.cpp
// compile with: cl /EHsc /c local_penter.cpp
@@ -74,6 +76,8 @@ extern "C" void __declspec(naked) __cdecl _penter( void ) {
}
```
+Source file `Gh_compiler_option.cpp`:
+
```cpp
// Gh_compiler_option.cpp
// compile with: cl /EHsc /Gh Gh_compiler_option.cpp local_penter.obj
@@ -90,7 +94,6 @@ int main() {
When run, the local `_penter` function is called on entry to `main` and `x`:
```Output
-
In a function!
In a function!
```
diff --git a/docs/build/reference/gs-buffer-security-check.md b/docs/build/reference/gs-buffer-security-check.md
index 227124b814..41fe1b082c 100644
--- a/docs/build/reference/gs-buffer-security-check.md
+++ b/docs/build/reference/gs-buffer-security-check.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: /GS (Buffer Security Check)"
title: "/GS (Buffer Security Check)"
-ms.date: "11/04/2016"
+description: "Learn more about: /GS (Buffer Security Check)"
+ms.date: 11/04/2016
f1_keywords: ["VC.Project.VCCLWCECompilerTool.BufferSecurityCheck", "VC.Project.VCCLCompilerTool.BufferSecurityCheck"]
helpviewer_keywords: ["buffers [C++], buffer overruns", "buffer overruns, compiler /GS switch", "GS compiler option [C++]", "/GS compiler option [C++]", "security check compiler option [C++]", "-GS compiler option [C++]", "buffers [C++], avoiding overruns"]
-ms.assetid: 8d8a5ea1-cd5e-42e1-bc36-66e1cd7e731e
---
# /GS (Buffer Security Check)
@@ -29,11 +28,8 @@ On functions that the compiler recognizes as subject to buffer overrun problems,
A buffer overrun security check is performed on a *GS buffer*. A GS buffer can be one of these:
- An array that is larger than 4 bytes, has more than two elements, and has an element type that is not a pointer type.
-
- A data structure whose size is more than 8 bytes and contains no pointers.
-
-- A buffer allocated by using the [_alloca](../../c-runtime-library/reference/alloca.md) function.
-
+- A buffer allocated by using the [`_alloca`](../../c-runtime-library/reference/alloca.md) function.
- Any class or structure that contains a GS buffer.
For example, the following statements declare GS buffers.
@@ -57,16 +53,14 @@ struct { int a; int b; };
## Initialize the Security Cookie
-The **/GS** compiler option requires that the security cookie be initialized before any function that uses the cookie is run. The security cookie must be initialized immediately on entry to an EXE or DLL. This is done automatically if you use the default VCRuntime entry points: mainCRTStartup, wmainCRTStartup, WinMainCRTStartup, wWinMainCRTStartup, or _DllMainCRTStartup. If you use an alternate entry point, you must manually initialize the security cookie by calling [__security_init_cookie](../../c-runtime-library/reference/security-init-cookie.md).
+The **/GS** compiler option requires that the security cookie be initialized before any function that uses the cookie is run. The security cookie must be initialized immediately on entry to an EXE or DLL. This is done automatically if you use the default VCRuntime entry points: `mainCRTStartup`, `wmainCRTStartup`, `WinMainCRTStartup`, `wWinMainCRTStartup`, or `_DllMainCRTStartup`. If you use an alternate entry point, you must manually initialize the security cookie by calling [`__security_init_cookie`](../../c-runtime-library/reference/security-init-cookie.md).
## What Is Protected
The **/GS** compiler option protects the following items:
- The return address of a function call.
-
- The address of an exception handler for a function.
-
- Vulnerable function parameters.
On all platforms, **/GS** attempts to detect buffer overruns into the return address. Buffer overruns are more easily exploited on platforms such as x86 and x64, which use calling conventions that store the return address of a function call on the stack.
@@ -80,15 +74,10 @@ A vulnerable parameter is allocated before the cookie and local variables. A buf
The compiler does not make copies of vulnerable parameters in the following situations:
- Functions that do not contain a GS buffer.
-
-- Optimizations ([/O options](o-options-optimize-code.md)) are not enabled.
-
+- Optimizations ([`/O` options](o-options-optimize-code.md)) are not enabled.
- Functions that have a variable argument list (...).
-
- Functions that are marked with [naked](../../cpp/naked-cpp.md).
-
- Functions that contain inline assembly code in the first statement.
-
- A parameter is used only in ways that are less likely to be exploitable in the event of a buffer overrun.
## What Is Not Protected
@@ -100,9 +89,7 @@ Even if you use **/GS**, always try to write secure code that has no buffer over
### To set this compiler option in Visual Studio
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
-
1. Select the **Configuration Properties** > **C/C++** > **Code Generation** property page.
-
1. Modify the **Buffer Security Check** property.
### To set this compiler option programmatically
@@ -138,5 +125,5 @@ int main() {
## See also
-[MSVC Compiler Options](compiler-options.md)
+[MSVC Compiler Options](compiler-options.md)\
[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
diff --git a/docs/build/reference/gs-control-stack-checking-calls.md b/docs/build/reference/gs-control-stack-checking-calls.md
index f681a54a15..4e1ff0eb87 100644
--- a/docs/build/reference/gs-control-stack-checking-calls.md
+++ b/docs/build/reference/gs-control-stack-checking-calls.md
@@ -1,44 +1,44 @@
---
description: "Learn more about: /Gs (Control Stack Checking Calls)"
title: "/Gs (Control Stack Checking Calls)"
-ms.date: "10/25/2018"
+ms.date: 02/16/2023
f1_keywords: ["/GS"]
helpviewer_keywords: ["disabling stack probes", "GS compiler option [C++]", "/GS compiler option [C++]", "stack, stack probes", "stack probes", "-GS compiler option [C++]", "stack checking calls"]
ms.assetid: 40daed7c-f942-4085-b872-01e12b37729e
---
-# /Gs (Control Stack Checking Calls)
+# `/Gs` (Control stack checking calls)
Controls the threshold for stack probes.
## Syntax
-> **/Gs**[*size*]
+> **`/Gs`**[*`size`*]
## Arguments
-*size*
-(Optional) The number of bytes that local variables can occupy before a stack probe is initiated. No space is allowed between **/Gs** and *size*.
+*`size`*\
+(Optional) The number of bytes that local variables can occupy before a stack probe is initiated. No whitespace is allowed between **`/Gs`** and *`size`*.
## Remarks
-A *stack probe* is a sequence of code that the compiler inserts at the beginning of a function call. When initiated, a stack probe reaches benignly into memory by the amount of space that is required to store the function's local variables. This causes the operating system to transparently page in additional stack memory if required, before the rest of the function runs.
+A *stack probe* is a sequence of code that the compiler inserts at the beginning of a function call. When initiated, a stack probe reaches benignly into memory by the amount of space required to store the function's local variables. This probe causes the operating system to transparently page in more stack memory if necessary, before the rest of the function runs.
-By default, the compiler generates code that initiates a stack probe when a function requires more than one page of stack space. This is equivalent to a compiler option of **/Gs4096** for x86, x64, ARM, and ARM64 platforms. This value allows an application and the Windows memory manager to increase the amount of memory committed to the program stack dynamically at run time.
+By default, the compiler generates code that initiates a stack probe when a function requires more than one page of stack space. This default is equivalent to a compiler option of **`/Gs4096`** for x86, x64, ARM, and ARM64 platforms. This value allows an application and the Windows memory manager to increase the amount of memory committed to the program stack dynamically at run time.
> [!NOTE]
-> The default value of **/Gs4096** allows the program stack of applications for Windows to grow correctly at run time. We recommend that you do not change the default value unless you know exactly why you have to change it.
+> The default value of **`/Gs4096`** allows the program stack of applications for Windows to grow correctly at run time. We recommend that you do not change the default value unless you know exactly why you have to change it.
-Some programs—for example, virtual device drivers—do not require this default stack-growth mechanism. In such cases, the stack probes are not necessary and you can stop the compiler from generating them by setting *size* to a value that is larger than any function will require for local variable storage.
+Some programs—for example, virtual device drivers—don't require this default stack-growth mechanism. In such cases, the stack probes aren't necessary and you can stop the compiler from generating them by setting *`size`* to a value that is larger than any function requires for local variable storage.
-**/Gs0** initiates stack probes for every function call that requires storage for local variables. This can have a negative impact on performance.
+**`/Gs0`** initiates stack probes for every function call that requires storage for local variables. This value can have a negative impact on performance.
-For x64 targets, if the **/Gs** option is specified without a *size* argument, it is the same as **/Gs0**. If the *size* argument is 1 through 9, warning D9014 is emitted, and the effect is the same as specifying **/Gs0**.
+For x64 targets, if you specify the **`/Gs`** option without a *`size`* argument, it's the same as **`/Gs0`**. If the *`size`* argument is 1 through 9, the compiler emits warning D9014, and the effect is the same as specifying **`/Gs0`**.
-For x86, ARM, and ARM64 targets, the **/Gs** option without a *size* argument is the same as **/Gs4096**. If the *size* argument is 1 through 9, warning D9014 is emitted, and the effect is the same as specifying **/Gs4096**.
+For x86, ARM, and ARM64 targets, the **`/Gs`** option without a *`size`* argument is the same as **`/Gs4096`**. If the *`size`* argument is 1 through 9, the compiler emits warning D9014, and the effect is the same as specifying **`/Gs4096`**.
-For all targets, a *size* argument between 10 and 2147485647 sets the threshold at the specified value. A *size* of 2147485648 or greater causes fatal error C1049.
+For all targets, a *`size`* argument between 10 and 2147483647 sets the threshold at the specified value. A *`size`* of 2147483648 or greater causes fatal error C1049.
-You can turn stack probes on or off by using the [check_stack](../../preprocessor/check-stack.md) directive. **/Gs** and the `check_stack` pragma have no effect on standard C library routines; they affect only the functions you compile.
+You can turn stack probes on or off by using the [`check_stack`](../../preprocessor/check-stack.md) directive. **`/Gs`** and the `check_stack` pragma have no effect on standard C library routines; they affect only the functions you compile.
### To set this compiler option in the Visual Studio development environment
@@ -54,5 +54,5 @@ You can turn stack probes on or off by using the [check_stack](../../preprocesso
## See also
-[MSVC Compiler Options](compiler-options.md)
-[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
+[MSVC compiler options](compiler-options.md)\
+[MSVC compiler command-line syntax](compiler-command-line-syntax.md)
diff --git a/docs/build/reference/guard-enable-control-flow-guard.md b/docs/build/reference/guard-enable-control-flow-guard.md
index b4d970ac8c..61a24b9f5a 100644
--- a/docs/build/reference/guard-enable-control-flow-guard.md
+++ b/docs/build/reference/guard-enable-control-flow-guard.md
@@ -1,47 +1,48 @@
---
description: "Learn more about: /guard (Enable Control Flow Guard)"
title: "/guard (Enable Control Flow Guard)"
-ms.date: "11/04/2016"
+ms.date: 2/24/2025
f1_keywords: ["/guard", "VC.Project.VCCLCompilerTool.ControlFlowGuard"]
-ms.assetid: be495323-f59f-4cf3-a6b6-8ee69e6a19dd
---
-# /guard (Enable Control Flow Guard)
+# `/guard` (Enable Control Flow Guard)
Enable compiler generation of Control Flow Guard security checks.
## Syntax
-```
-/guard:cf[-]
-```
+> **`/guard:cf`**\
+> **`/guard:cf-`**
## Remarks
-The **/guard:cf** option causes the compiler to analyze control flow for indirect call targets at compile time, and then to insert code to verify the targets at runtime. By default, **/guard:cf** is off and must be explicitly enabled. To explicitly disable this option, use **/guard:cf-**.
+The **`/guard:cf`** option causes the compiler to analyze control flow for indirect call targets at compile time, and inserts code at runtime to verify the targets. By default, **`/guard:cf`** is off and must be explicitly enabled. To explicitly disable this option, use **`/guard:cf-`**.
**Visual Studio 2017 and later**: This option adds guards for **`switch`** statements that generate jump tables.
-When the **/guard:cf** Control Flow Guard (CFG) option is specified, the compiler and linker insert extra runtime security checks to detect attempts to compromise your code. During compiling and linking, all indirect calls in your code are analyzed to find every location that the code can reach when it runs correctly. This information is stored in extra structures in the headers of your binaries. The compiler also injects a check before every indirect call in your code that ensures the target is one of the verified locations. If the check fails at runtime on a CFG-aware operating system, the operating system closes the program.
+When the **`/guard:cf`** Control Flow Guard (CFG) option is specified, the compiler and linker insert extra runtime security checks to detect attempts to compromise your code. During compiling and linking, all indirect calls in your code are analyzed to find every location that the code can reach when it runs correctly. This information is stored in extra structures in the headers of your binaries. The compiler also injects a check before every indirect call in your code that ensures the target is one of the verified locations. If the check fails at runtime on a CFG-aware operating system, the operating system closes the program.
-A common attack on software takes advantage of bugs in handling extreme or unexpected inputs. Carefully crafted input to the application may overwrite a location that contains a pointer to executable code. This can be used to redirect control flow to code controlled by the attacker. The CFG runtime checks do not fix the data corruption bugs in your executable. They instead make it more difficult for an attacker to use them to execute arbitrary code. CFG is a mitigation tool that prevents calls to locations other than function entry points in your code. It's similar to how Data Execution Prevention (DEP), [/GS](gs-buffer-security-check.md) stack checks, and [/DYNAMICBASE](dynamicbase-use-address-space-layout-randomization.md) and [/HIGHENTROPYVA](highentropyva-support-64-bit-aslr.md) address space layout randomization (ASLR) lower the chances that your code becomes an exploit vector.
+A common attack on software takes advantage of bugs in handling extreme or unexpected inputs. Carefully crafted input to the application may overwrite a location that contains a pointer to executable code. This technique can be used to redirect control flow to code controlled by the attacker. The CFG runtime checks don't fix the data corruption bugs in your executable. They instead make it more difficult for an attacker to use them to execute arbitrary code. CFG is a mitigation tool that prevents calls to locations other than function entry points in your code. It's similar to how Data Execution Prevention (DEP), [/GS](gs-buffer-security-check.md) stack checks, and [`/DYNAMICBASE`](dynamicbase-use-address-space-layout-randomization.md) and [/HIGHENTROPYVA](highentropyva-support-64-bit-aslr.md) address space layout randomization (ASLR) lower the chances that your code becomes an exploit vector.
-The **/guard:cf** option must be passed to both the compiler and linker to build code that uses the CFG exploit mitigation technique. If your binary is built by using a single `cl` command, the compiler passes the option to the linker. If you compile and link separately, the option must be set on both the compiler and linker commands. The /DYNAMICBASE linker option is also required. To verify that your binary has CFG data, use the `dumpbin /headers /loadconfig` command. CFG-enabled binaries have `Guard` in the list of EXE or DLL characteristics, and Guard Flags include `CF Instrumented` and `FID table present`.
+To use the CFG exploit mitigation technique, pass **`/guard:cf`** to the compiler and **`/GUARD:CF`** to the linker.
-The **/guard:cf** option is incompatible with [/ZI](z7-zi-zi-debug-information-format.md) (Edit and Continue debug information) or [/clr](clr-common-language-runtime-compilation.md) (Common Language Runtime Compilation).
+To disable the CFG exploit mitigation technique, pass **`/guard:cf-`** to the compiler **`/GUARD:NO`** to the linker.
-Code compiled by using **/guard:cf** can be linked to libraries and object files that are not compiled by using the option. Only this code, when also linked by using the **/guard:cf** option and run on a CFG-aware operating system, has CFG protection. Because code compiled without the option will not stop an attack, we recommend that you use the option on all the code you compile. There is a small runtime cost for CFG checks, but the compiler analysis attempts to optimize away the checks on indirect jumps that can be proven to be safe.
+If you build using a single `cl` command, the compiler passes the option to the linker. If you compile and link separately, set the option for both the compiler and linker commands. The `/DYNAMICBASE` linker option is also required.
-### To set this compiler option in the Visual Studio development environment
+To verify that your binary has CFG data, use the `dumpbin /headers /loadconfig` command. CFG-enabled binaries have `Guard` in the list of EXE or DLL characteristics, and Guard Flags include `CF Instrumented` and `FID table present`.
-1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+The **`/guard:cf`** option is incompatible with [`/ZI`](z7-zi-zi-debug-information-format.md) (Edit and Continue debug information) or [`/clr`](clr-common-language-runtime-compilation.md) (Common Language Runtime Compilation).
-1. Select the **Configuration Properties** > **C/C++** > **Code Generation** property page.
+Code compiled by using **`/guard:cf`** can be linked to libraries and object files that aren't compiled by using the option. Only this code, when also linked by using the **`/guard:cf`** option and run on a CFG-aware operating system, has CFG protection. Because code compiled without the option won't stop an attack, we recommend that you use the option on all the code you compile. There's a small runtime cost for CFG checks, but the compiler analysis attempts to optimize away the checks on indirect jumps that can be proven to be safe.
-1. Select the **Control Flow Guard** property.
+### To set this compiler option in the Visual Studio development environment
+1. Open the **Property Pages** dialog box for the project. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
+1. Select the **Configuration Properties** > **C/C++** > **Code Generation** property page.
+1. Select the **Control Flow Guard** property.
1. In the dropdown control, choose **Yes** to enable Control Flow Guard, or **No** to disable it.
## See also
-[MSVC Compiler Options](compiler-options.md)
-[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
+[MSVC compiler options](compiler-options.md)\
+[MSVC compiler command-line syntax](compiler-command-line-syntax.md)
diff --git a/docs/build/reference/guard-enable-guard-checks.md b/docs/build/reference/guard-enable-guard-checks.md
index 85afea2c3c..3df932fa31 100644
--- a/docs/build/reference/guard-enable-guard-checks.md
+++ b/docs/build/reference/guard-enable-guard-checks.md
@@ -1,37 +1,41 @@
---
-description: "Learn more about: /GUARD (Enable Guard Checks)"
+description: "Learn more about: /GUARD (Enable Guard Checks) linker option"
title: "/GUARD (Enable Guard Checks)"
-ms.date: "11/04/2016"
+ms.date: 09/21/2022
+f1_keywords: ["VC.Project.VCCLCompilerTool.LinkControlFlowGuard"]
ms.assetid: 72758e23-70ac-4616-94d7-d767477406d1
---
-# /GUARD (Enable Guard Checks)
+# `/GUARD` (Enable Guard Checks)
-Specifies support for Control Flow Guard checks in the executable image.
+Tells the linker whether to support Control Flow Guard checks in the executable image.
## Syntax
-```
-/GUARD:{CF|NO}
-```
+> **`/GUARD:CF`**\
+> **`/GUARD:NO`**
## Remarks
-When /GUARD:CF is specified, the linker modifies the header of a .dll or .exe to indicate support for Control Flow Guard (CFG) runtime checks. The linker also adds the required control flow target address data to the header. By default, /GUARD:CF is disabled. It can be explicitly disabled by using /GUARD:NO. To be effective, /GUARD:CF also requires the [/DYNAMICBASE (Use address space layout randomization)](dynamicbase-use-address-space-layout-randomization.md) linker option, which is on by default.
+The **`/GUARD:CF`** linker option modifies the header of a DLL or EXE file to indicate support for Control Flow Guard (CFG) runtime checks. The linker also adds the required control flow target address data to the header. By default, **`/GUARD:CF`** is disabled. It can be explicitly disabled by using **`/GUARD:NO`**. To be effective, **`/GUARD:CF`** also requires the [`/DYNAMICBASE` (Use address space layout randomization)](dynamicbase-use-address-space-layout-randomization.md) linker option, which is on by default.
-When source code is compiled by using the [/guard:cf](guard-enable-control-flow-guard.md) option, the compiler analyzes the control flow by examining all indirect calls for possible target addresses. The compiler inserts code to verify the target address of an indirect call instruction is in the list of known target addresses at runtime. Operating systems that support CFG stop a program that fails a CFG runtime check. This makes it more difficult for an attacker to execute malicious code by using data corruption to change a call target.
+When source code is compiled by using the [`/guard:cf`](guard-enable-control-flow-guard.md) compiler option, the compiler analyzes the control flow by examining all indirect calls for possible target addresses. The compiler inserts code to verify the target address of an indirect call instruction is in the list of known target addresses at runtime. Operating systems that support CFG stop a program that fails a CFG runtime check. This check makes it more difficult for an attacker to execute malicious code by using data corruption to change a call target.
-The /GUARD:CF option must be specified to both the compiler and linker to create CFG-enabled executable images. Code compiled but not linked by using /GUARD:CF incurs the cost of runtime checks, but does not enable CFG protection. When the /GUARD:CF option is specified to the `cl` command to compile and link in one step, the compiler passes the flag to the linker. When the **Control Flow Guard** property is set in Visual Studio, the /GUARD:CF option is passed to both the compiler and linker. When object files or libraries have been compiled separately, the option must be explicitly specified in the `link` command.
+The **`/GUARD:CF`** option must be specified to both the compiler and linker to create CFG-enabled executable images. Code compiled but not linked by using **`/GUARD:CF`** incurs the cost of runtime checks, but doesn't enable CFG protection. When the **`/guard:cf`** option is specified to the `cl` command to compile and link in one step, the compiler passes the flag to the linker. When the **Control Flow Guard** property is set in Visual Studio, the **`/GUARD:CF`** option is passed to both the compiler and linker. When object files or libraries have been compiled separately, the option must be explicitly specified in the `link` command.
### To set this linker option in Visual Studio
-1. Open the project **Property Pages** dialog box. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+1. Open the **Property Pages** dialog box for the project. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
-1. In **Additional Options**, enter `/GUARD:CF`.
+1. In **Additional Options**, enter *`/GUARD:CF`*. Choose **OK** or **Apply** to save your changes.
+
+### To set this linker option programmatically
+
+- See .
## See also
-[/guard (Enable Control Flow Guard)](guard-enable-control-flow-guard.md)
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
+[`/guard` (Enable Control Flow Guard)](guard-enable-control-flow-guard.md)\
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/header-unit-json-reference.md b/docs/build/reference/header-unit-json-reference.md
new file mode 100644
index 0000000000..cc0a1bf2c5
--- /dev/null
+++ b/docs/build/reference/header-unit-json-reference.md
@@ -0,0 +1,115 @@
+---
+description: "Reference for header-units.json file"
+title: "C++ header unit.json reference"
+ms.date: 11/09/2022
+author: "tylermsft"
+ms.author: "twhitney"
+f1_keywords: ["header-units.json"]
+helpviewer_keywords: ["header-units.json", "header unit"]
+monikerRange: '>=msvc-160'
+---
+
+# C++ header-units.json reference
+
+The `header-units.json` file serves two purposes:
+- Specify which header files can be translated into header units when [`/translateInclude`](translateinclude.md) is specified.
+- Minimize duplicated symbols to increase build throughput.
+
+This file must be in the same directory as the included header file. This file is only used when [`/translateInclude`](translateinclude.md) is specified along with either [`/scanDependencies`](scandependencies.md) or [`/sourceDependencies:directives`](sourcedependencies-directives.md).
+
+## Rationale
+
+Some header files can't be safely translated to header units. Header files that depend on macros that aren't defined on the command line, or that aren't defined in the header files included by the header, can't be translated to header units.
+
+If a header defines macros that affect whether other headers are included, it can't be safely translated. For example, given `a.h`, `b.h` and `macros.h`, which are all in the same directory:
+
+```cpp
+// a.h
+
+#include "macros.h" // #defines MACRO=1
+#ifdef MACRO
+#include "b.h"
+#endif
+```
+
+The `header-units.json` in this directory can contain `a.h` and `b.h`, but not `macros.h`. The `header-units.json` for this example would be similar to this:
+
+```json
+{
+ "Version": "1.0",
+ "BuildAsHeaderUnits": [
+ // macros.h should not be listed
+ "a.h",
+ "b.h"
+ ]
+}
+```
+
+The reason `macros.h` can't be listed in this `header-units.json` file is that during the scan phase, the header unit (`.ifc`) might not be compiled yet for `macros.h`. In that case, `MACRO` won't be defined when `a.h` is compiled. That means `b.h` will be missing from the list of dependencies for `a.h`. Since it isn't in the list of dependencies, the build system won't build a header unit for `b.h` despite it being listed in the `header-units.json` file.
+
+To avoid this problem, when there's a dependency on a macro in another header file, the header file that defines the macro is excluded from the list of files that can be compiled into a header unit. This way the header file that defines the macro is treated as a normal `#include` and `MACRO` will be visible so that `b.h` is included and listed as one of the dependencies.
+
+### Preventing duplicated symbols
+
+The `header-units.json` file is also important because it allows for automatic header unit creation without duplicated symbols. It does this by creating "atomic" header units for the files listed in `header-units.json`. The imported header units don't contain duplicated symbols from the various `#include` directives that were processed while translating the header file.
+
+For example, consider two header files that both include a common header file. Both header files are included by the same source file:
+
+```cpp
+// a.h
+#include "b.h"
+
+// c.h
+#include "b.h"
+
+// Source.cpp
+import "a.h";
+import "c.h";
+```
+
+If the compiler built header units for `a.h`, `b.h` and `c.h`, then the compiled header units `a.h.ifc`, `b.h.ifc`, and `c.h.ifc` would each contain all of the types from `b.h`. Compiling `Source.cpp`, which imports both `a.h` and `c.h`, would require the compiler to deduplicate the `b.h` types, which would impact build performance.
+
+But if there's a `header-units.json` in the `b.h` directory, and `/translateInclude` is specified, then the following happens:
+
+1. The scan of `a.h` and `c.h` lists `b.h` as a header unit import in the dependency scan files generated by the compiler.
+1. The build system reads the dependency scan files and determines to build `b.h.ifc` first.
+1. Then the build system adds `/headerUnit` for `b.h.ifc` to the command lines for compiling `a.h` and `c.h`. It calls the compiler to build the header units `a.h.ifc` and `c.h.ifc`. Because `/translateInclude` is specified, and `/headerUnit for b.h.ifc` is also specified, `a.h.ifc` and `c.h.ifc` won't contain `b.h` types, so there won't be any duplication in the produced header units.
+
+## Schema
+
+There's a `headerunits.json` file for the Standard Template Library (STL) headers. The build system uses it to determine whether to create a header unit for an STL header file, and for its dependencies. If the STL header file isn't on the list, it's treated as a normal `#include` instead of importing it as a header unit.
+
+You can see the `header-units.json` file under the installation directory for Visual Studio. For example: `%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.30.30705\include\header-units.json`
+
+The `header-units.json` file starts with the schema version, followed by an array of filenames for headers that can be built into header units.
+
+The schema also supports comments, as shown here:
+
+```json
+{
+ "Version": "1.0",
+ "BuildAsHeaderUnits": [
+ // "__msvc_all_public_headers.hpp", // for testing, not production
+ "__msvc_system_error_abi.hpp",
+ "__msvc_tzdb.hpp",
+ "__msvc_xlocinfo_types.hpp",
+ "algorithm",
+ "any",
+ "array",
+ "atomic",
+ "barrier",
+ "bit",
+ "bitset",
+ // "cassert", // design is permanently incompatible with header units
+ ...
+}
+```
+
+## Search rules
+
+The compiler looks for this file in the same directory as the header file being processed. If your library is organized into subdirectories, each subdirectory needs its own `header-units.json` file.
+
+## See also
+
+[Walkthrough: Import STL libraries as header units](..\walkthrough-import-stl-header-units.md#approach1)\
+[Walkthrough: Build and import header units in your Visual C++ projects](..\walkthrough-header-units.md)
\ No newline at end of file
diff --git a/docs/build/reference/headername.md b/docs/build/reference/headername.md
index 25bb89d596..2f7824ddfb 100644
--- a/docs/build/reference/headername.md
+++ b/docs/build/reference/headername.md
@@ -1,7 +1,7 @@
---
title: "/headerName (Build a header unit from the specified header)"
description: "Use the /headerName compiler option to establish a mapping between a header file and the header unit to build."
-ms.date: 04/13/2021
+ms.date: 11/16/2022
author: "tylermsft"
ms.author: "twhitney"
f1_keywords: ["/headerName"]
@@ -23,30 +23,32 @@ The name of a header file that the compiler should compile into a header unit (*
## Remarks
-The **`/headerName`** compiler option is available starting in Visual Studio 2019 version 16.10.
+The **`/headerName:quote`** and **`/headerName:angle`** compiler options are available starting in Visual Studio 2019 version 16.10.
-The **`/headerName`** compiler option, in all its forms, requires the [`/std:c++20`](std-specify-language-standard-version.md) or later compiler option (such as **`/std:c++latest`**).\
-If you specify **`/headerName:{quote,angle}`**, you must also specify [`/exportHeader`](module-exportheader.md).
+The **`/headerName`** compiler options, in all their forms, require the [`/std:c++20`](std-specify-language-standard-version.md) or later compiler option (such as **`/std:c++latest`**).\
+If you specify a **`/headerName`** option, you must also specify [`/exportHeader`](module-exportheader.md).
-**`/headerName:quote`** looks up *`header-filename`* using the same rules as `#include "header-name"` and builds it as a header unit (*`.ifc`* file).\
-**`/headerName:angle`** looks up *`header-filename`* using the same rules as `#include ` and builds it as a header unit (*`.ifc`* file).
+- **`/headerName:quote`** looks up *`header-filename`* using the same rules as `#include "header-filename"` and builds it as a header unit (*`.ifc`* file).
+- **`/headerName:angle`** looks up *`header-filename`* using the same rules as `#include ` and builds it as a header unit (*`.ifc`* file).
+
+For more information about the path searching rules for included files in quotes or angle brackets, see [`#include` directive](../../preprocessor/hash-include-directive-c-cpp.md).
### Examples
-Given a project that references a header file it defines called `m.h`, the compiler option to compile it into a header unit looks similar to this:
+Given a project that references a header file it defines called *`m.h`*, the compiler option to compile it into a header unit looks similar to this example:
-```Bash
+```bash
cl /std:c++latest /exportHeader /headerName:quote m.h /Fom.h.obj
```
-The `/headerName:{quote,angle}` option acts like a flag and does not explicitly need an argument. The following examples are valid:
+The **`/headerName:quote`** and **`/headerName:angle`** options act like a flag and don't need an argument. The following examples are valid:
-```Bash
+```bash
cl /std:c++latest /exportHeader /headerName:angle /MP /Fo.\ vector iostream algorithm
cl /std:c++latest /exportHeader /headerName:quote /MP /Fo.\ my-utilities.h a/b/my-core.h
```
-You can specify multiple `/headerName` options on the same command line, and every argument after that option will be processed with the specified *`header-filename`* lookup rules. The following example processes all the headers as the previous two command line examples in the same way. It looks up the headers using the lookup rules applied as if they had been specified as: `#include `, `#include "my-utilties.h"`, and `#include "a/b/my-core.h"`:
+You can specify multiple **`/headerName`** options on the same command line. Every argument after a **`/headerName`** option is processed with the specified include file lookup rules for quotes or angle brackets until the next **`/headerName`** option. The following example processes all the headers as the previous two command line examples in the same way as before. It looks up the headers using the lookup rules applied as if they had been specified as: `#include `, `#include `, `#include `, `#include "my-utilties.h"`, and `#include "a/b/my-core.h"`:
```bash
cl /std:c++latest /exportHeader /headerName:angle /MP /Fo.\ vector iostream algorithm /headerName:quote my-utilities.h a/b/my-core.h
@@ -55,19 +57,19 @@ cl /std:c++latest /exportHeader /headerName:angle /MP /Fo.\ vector iostream algo
### To set this compiler option in the Visual Studio development environment
> [!NOTE]
-> Users don't typically set this command line option. It's set by the build system.
+> You normally shouldn't set this option in the Visual Studio development environment. It's set by the build system.
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
-1. Set the **Configuration** drop-down to **All Configurations**.
+1. Set the **Configuration** drop-down to **All Configurations**. Set the **Platform** drop-down to **All Platforms**.
1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
-1. Modify the **Additional Options** property to add the *`/headerName`* options and arguments. Then, choose **OK** or **Apply** to save your changes.
+1. Modify the **Additional Options** property to add the *`/headerName:quote`* or *`/headerName:angle`* options and the header filenames the options apply to. Then, choose **OK** or **Apply** to save your changes.
## See also
[`/exportHeader` (Create header units)](module-exportheader.md)\
-[`/headerUnit` (Create header units)](headerunit.md)\
+[`/headerUnit` (Use header unit IFC)](headerunit.md)\
[`/reference` (Use named module IFC)](module-reference.md)\
[`/translateInclude` (Translate include directives into import directives)](translateinclude.md)
diff --git a/docs/build/reference/headerunit.md b/docs/build/reference/headerunit.md
index 8b92219208..6ee2d63554 100644
--- a/docs/build/reference/headerunit.md
+++ b/docs/build/reference/headerunit.md
@@ -1,7 +1,7 @@
---
title: "/headerUnit (Use header unit IFC)"
description: "Use the /headerUnit compiler option to associate a header file with the header unit to import in its place."
-ms.date: 04/13/2021
+ms.date: 5/28/2024
f1_keywords: ["/headerUnit"]
helpviewer_keywords: ["/headerUnit", "Use header unit IFC"]
author: "tylermsft"
@@ -9,13 +9,13 @@ ms.author: "twhitney"
---
# `/headerUnit` (Use header unit IFC)
-Used to import a header unit. Tells the compiler where to find the *`.ifc`* file (the binary representation of the header unit) for the specified header.
+Imports a header unit. Tells the compiler where to find the *`.ifc`* file (the binary representation of the header unit) for the specified header.
## Syntax
> **`/headerUnit`** *`header-filename`*=*`ifc-filename`*\
-> **`/headerUnit:quote`** \[*`header-filename`*=*`ifc-filename`*\]\
-> **`/headerUnit:angle`** \[*`header-filename`*=*`ifc-filename`*\]
+> **`/headerUnit:quote`** *`header-filename`*=*`ifc-filename`*\
+> **`/headerUnit:angle`** *`header-filename`*=*`ifc-filename`*
### Arguments
@@ -27,34 +27,34 @@ The name of a file that contains compiled header unit information. To import mor
## Remarks
-The **`/headerUnit`** compiler option requires the [`/std:c++20`](std-specify-language-standard-version.md) or later compiler option (such as **`/std:c++latest`**).
+The **`/headerUnit`** compiler option requires [`/std:c++20`](std-specify-language-standard-version.md) or later.
-The **`/headerUnit`** compiler option is available starting in Visual Studio 2019 version 16.10.
+The **`/headerUnit`** compiler option is available in Visual Studio 2019 version 16.10 or later.
-When the compiler comes across `import "file";` or `import ;`, this compiler option helps the compiler find the compiled header unit (*`.ifc`*) for the specified header file. The path to this file can be expressed in three ways:
+When the compiler comes across `import "file";` or `import ;` this compiler option helps the compiler find the compiled header unit (*`.ifc`*) for the specified header file. The path to this file can be expressed in these ways:
-**`/headerUnit`** looks up the compiled header unit in the current directory, or at the location specified in *`ifc-filename`*.
+- **`/headerUnit`** looks up the compiled header unit in the current directory, or at the location specified by *`ifc-filename`*.
-**`/headerUnit:quote`** looks up the compiled header unit file using the same rules as `#include "file"`.
+- **`/headerUnit:quote`** looks up the compiled header unit file using the same rules as `#include "file"`.
-**`/headerUnit:angle`** looks up the compiled header unit file using the same rules as `#include `.
+- **`/headerUnit:angle`** looks up the compiled header unit file using the same rules as `#include `.
-The compiler can't map a single *`header-name`* to multiple *`.ifc`* files. While mapping multiple *`header-name`* arguments to a single *`.ifc`* is possible, we don't recommend it. The contents of the *`.ifc`* get imported as if it was only the header specified by *`header-name`*.
+The compiler can't map a single *`header-name`* to multiple *`.ifc`* files. You can map multiple *`header-name`* arguments to a single *`.ifc`*. The contents of the *`.ifc`* are imported as if it was only the header specified by *`header-name`*.
-The compiler implicitly enables the new preprocessor when this option is used. That is, [`/Zc:preprocessor`](zc-preprocessor.md) is added to the command line by the compiler if any form of `/headerUnit` is specified on the command line. To opt out of the implicit `/Zc:preprocessor`, specify: `/Zc:preprocessor-`
+The compiler implicitly enables the new preprocessor when this option is used. If any form of `/headerUnit` is specified on the command line, then [`/Zc:preprocessor`](zc-preprocessor.md) is added to the command line by the compiler. To opt out of the implicit `/Zc:preprocessor`, specify: `/Zc:preprocessor-`
If you disable the new preprocessor, but a file you compile imports a header unit, the compiler will report an error.
### Examples
-Given a project that references two header files and their header units, listed in this table:
+Given a project that references two header files and their header units as listed in this table:
| Header file | IFC file |
|--|--|
| *`C:\utils\util.h`* | *`C:\util.h.ifc`* |
| *`C:\app\app.h`* | *`C:\app\app.h.ifc`* |
-The compiler options to reference the header units for these particular header files would look similar to this:
+The compiler options to reference the header units for these particular header files would look like this:
```CMD
cl ... /std:c++latest /headerUnit C:\utils\util.h=C:\util.h.ifc /headerUnit:quote app.h=app.h.ifc
@@ -62,10 +62,11 @@ cl ... /std:c++latest /headerUnit C:\utils\util.h=C:\util.h.ifc /headerUnit:quot
### To set this compiler option in the Visual Studio development environment
-You normally shouldn't set this in the Visual Studio development environment. It is set by the build system.
+You normally shouldn't set this in the Visual Studio development environment. It's set by the build system.
## See also
[`/exportHeader` (Create header units)](module-exportheader.md)\
[`/headerName` (Create a header unit from the specified header)](headername.md)\
-[`/reference` (Use named module IFC)](module-reference.md)
+[`/reference` (Use named module IFC)](module-reference.md)\
+[`/translateInclude` (Translate include directives into import directives)](translateinclude.md)
diff --git a/docs/build/reference/idlout-name-midl-output-files.md b/docs/build/reference/idlout-name-midl-output-files.md
index 38b277f76d..3c18293306 100644
--- a/docs/build/reference/idlout-name-midl-output-files.md
+++ b/docs/build/reference/idlout-name-midl-output-files.md
@@ -1,51 +1,45 @@
---
-description: "Learn more about: /IDLOUT (Name MIDL Output Files)"
title: "/IDLOUT (Name MIDL Output Files)"
-ms.date: "11/04/2016"
+description: "Learn more about: /IDLOUT (Name MIDL Output Files)"
+ms.date: 03/27/2025
f1_keywords: ["/idlout", "VC.Project.VCLinkerTool.MergedIDLBaseFileName"]
helpviewer_keywords: ["MIDL, output file names", ".idl files, path", "MIDL", "/IDLOUT linker option", "IDL files, path", "-IDLOUT linker option", "IDLOUT linker option"]
-ms.assetid: 10d00a6a-85b4-4de1-8732-e422c6931509
---
# /IDLOUT (Name MIDL Output Files)
-```
-/IDLOUT:[path\]filename
-```
+## Syntax
-## Parameters
+> /IDLOUT:[path\]filename
-*path*
-An absolute or relative path specification. By specifying a path, you affect only the location of an .idl file; all other files are placed in the project directory.
+## Argument
-*filename*
-Specifies the name of the .idl file created by the MIDL compiler. No file extension is assumed; specify *filename*.idl if you want an .idl extension.
+*`path`*\
+An absolute or relative path specification. By specifying a path, you affect only the location of an `.idl` file; all other files are placed in the project directory.
+
+*`filename`*\
+Specifies the name of the `.idl` file created by the MIDL compiler. No file extension is assumed; specify *`filename.idl` if you want an `.idl` extension. When expanded, the fully qualified filename must not exceed `MAX_PATH` (260 characters).
## Remarks
-The /IDLOUT option specifies the name and extension of the .idl file.
+The `/IDLOUT` option specifies the name and extension of the `.idl` file.
-The MIDL compiler is called by the MSVC linker when linking projects that have the [module](../../windows/attributes/module-cpp.md) attribute.
+The MIDL compiler is called by the MSVC linker when linking projects that have the [`module`](../../windows/attributes/module-cpp.md) attribute.
-/IDLOUT also specifies the file names of the other output files associated with the MIDL compiler:
+`/IDLOUT` also specifies the file names of the other output files associated with the MIDL compiler:
- *filename*.tlb
-
- *filename*_p.c
-
- *filename*_i.c
-
- *filename*.h
-*filename* is the parameter that you pass to /IDLOUT. If [/TLBOUT](tlbout-name-dot-tlb-file.md) is specified, the .tlb file will get its name from /TLBOUT *filename*.
+*`filename`* is the parameter that you pass to `/IDLOUT`. If [`/TLBOUT`](tlbout-name-dot-tlb-file.md) is specified, the .tlb file will get its name from `/TLBOUT` *`filename`*.
-If you specify neither /IDLOUT nor /TLBOUT, the linker will create vc70.tlb, vc70.idl, vc70_p.c, vc70_i.c, and vc70.h.
+If you specify neither `/IDLOUT` nor `/TLBOUT`, the linker will create vc70.tlb, vc70.idl, vc70_p.c, vc70_i.c, and vc70.h.
### To set this linker option in the Visual Studio development environment
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
-
1. Select the **Configuration Properties** > **Linker** > **Embedded IDL** property page.
-
1. Modify the **Merge IDL Base File Name** property.
### To set this linker option programmatically
@@ -54,8 +48,8 @@ If you specify neither /IDLOUT nor /TLBOUT, the linker will create vc70.tlb, vc7
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
-[/IGNOREIDL (Don't Process Attributes into MIDL)](ignoreidl-don-t-process-attributes-into-midl.md)
-[/MIDL (Specify MIDL Command Line Options)](midl-specify-midl-command-line-options.md)
+[MSVC linker reference](linking.md)\
+[MSVC Linker Options](linker-options.md)\
+[/IGNOREIDL (Don't Process Attributes into MIDL)](ignoreidl-don-t-process-attributes-into-midl.md)\
+[/MIDL (Specify MIDL Command Line Options)](midl-specify-midl-command-line-options.md)\
[Building an Attributed Program](../../windows/attributes/cpp-attributes-com-net.md)
diff --git a/docs/build/reference/ifc-map.md b/docs/build/reference/ifc-map.md
new file mode 100644
index 0000000000..7466fd2b00
--- /dev/null
+++ b/docs/build/reference/ifc-map.md
@@ -0,0 +1,88 @@
+---
+title: "/ifcMap"
+description: "Map named modules and header units to IFC files."
+ms.date: 10/16/2023
+author: "tylermsft"
+ms.author: "twhitney"
+f1_keywords: ["/ifcMap"]
+helpviewer_keywords: ["/ifcMap", "Specify named module and header unit mappings to IFC files."]
+---
+# `/ifcMap`
+
+This switch tells the compiler where to find the IFC reference map file, which maps references to named modules and header units to their corresponding IFC (`.ifc`) files.
+
+## Syntax
+
+> **`/ifcMap`** *`filename`*
+
+## Remarks
+
+The *`filename`* argument specifies the IFC reference map file. It can be relative to the compiler's working directory, or an absolute path.
+
+You can provide multiple `/ifcMap` arguments to the compiler.
+
+The IFC reference map file format is a subset of the [TOML](https://toml.io/en/) file format. The IFC reference map file can contain a mix of `[[module]]` and `[[header-unit]]` references.
+
+Syntax errors or unrecognized table names result in compiler error `C7696` (TOML parse error).
+
+### Map named modules
+
+The format of the IFC reference map file for named modules is:
+
+```
+# Using literal strings
+[[module]]
+name = 'M'
+ifc = 'C:\modules\M.ifc'
+
+# Using basic strings
+[[module]]
+name = "N"
+ifc = "C:\\modules\\N.ifc"
+```
+
+This IFC reference map file maps the named modules `'M'` and `'N'` to their respective IFC files. The equivalent [`/reference`](module-reference.md) is:
+
+```cmd
+/reference M=C:\modules\M.ifc /reference N=C:\modules\N.ifc
+```
+
+For more information about what types of module names are valid for the `name` field, see [`/reference remarks`](module-reference.md#remarks).
+
+### Map header units
+
+The format of the IFC reference map file for header units is:
+
+```
+# Using literal strings
+[[header-unit]]
+name = ['quote', 'my-utility.h']
+ifc = 'C:\header-units\my-utility.h.ifc'
+
+[[header-unit]]
+name = ['angle', 'vector']
+ifc = 'C:\header-units\vector.ifc'
+
+# Using basic strings
+[[header-unit]]
+name = ["quote", "my-engine.h"]
+ifc = "C:\\header-units\\my-engine.h.ifc"
+
+[[header-unit]]
+name = ["angle", "algorithm"]
+ifc = "C:\\header-units\\algorithm.ifc"
+```
+
+This IFC reference map file maps `"my-utility.h"` to `C:\header-units\my-utility.h.ifc`, and `` to `C:\header-units\vector.ifc`, and so on. The equivalent [`/headerUnit`](headerunit.md) is:
+
+```cmd
+/headerUnit:quote my-utility=C:\header-units\my-utility.h.ifc /headerUnit:angle vector=C:\header-units\vector.ifc /headerUnit:quote my-engine.h=C:\header-units\my-engine.h.ifc /headerUnit:angle algorithm=C:\header-units\algorithm.ifc
+```
+
+When `[[header-unit]]` is specified in an IFC reference map file, the compiler implicitly enables [`/Zc:preprocessor`](zc-preprocessor.md), just as it's implicitly enabled when [`/headerUnit`](headerunit.md) is used. For more information about the behavior of the `angle` and `quote` lookup methods, see [/headerUnit remarks](headerunit.md#remarks).
+
+## See also
+
+[Overview of modules in C++](../../cpp/modules-cpp.md)\
+[Walkthrough: Build and import header units in Visual C++ projects](../walkthrough-header-units.md)\
+[Using C++ Modules in MSVC from the Command Line](https://devblogs.microsoft.com/cppblog/using-cpp-modules-in-msvc-from-the-command-line-part-1/)
\ No newline at end of file
diff --git a/docs/build/reference/ifc-output.md b/docs/build/reference/ifc-output.md
new file mode 100644
index 0000000000..2fd60fcca2
--- /dev/null
+++ b/docs/build/reference/ifc-output.md
@@ -0,0 +1,56 @@
+---
+title: "/ifcOutput"
+description: "Specify output file or directory for `.ifc` files."
+ms.date: 11/21/2022
+author: "tylermsft"
+ms.author: "twhitney"
+f1_keywords: ["/ifcOutput", "VC.Project.VCCLCompilerTool.ifcOutput"]
+helpviewer_keywords: ["/ifcOutput", "Specify where the compiled `.ifc` should go"]
+---
+# `/ifcOutput`
+
+This switch tells the compiler where to output built *`.ifc`* files. If the destination is a directory, then the compiler generates the name of each `.ifc` file based on the interface name or the header unit name.
+
+## Syntax
+
+> **`/ifcOutput`** *`filename`*\
+> **`/ifcOutput`** *`directory\`*
+
+## Remarks
+
+By default, the compiler derives the name for each generated *`.ifc`* file from the module interface name. For example, given a module name `MyModule`, the generated *`.ifc`* will be named *`MyModule.ifc`*, unless you override the name with the `/ifcOutput` switch.
+
+Use this switch to specify an alternative *`.ifc`* filename or directory. If you want to use the default built *`.ifc`* filenames, but specify a directory where they should be built, ensure that you add a trailing backslash (`\`) to the directory name.
+
+When you're building multiple *`.ifc`* files, only use the directory form of the `/ifcOutput` switch. If you provide multiple `/ifcOutput` switches, the compiler only uses the last one.
+
+If you build with the [`/MP` (Build with multiple processes)](mp-build-with-multiple-processes.md) switch, we recommend that you use the directory form of the `/ifcOutput` switch if you have multiple input module files.
+
+In the following example, the *`.ifc`* file for module `m` defined in *`m.ixx`* is built as `c:\example\m.ifc`.
+
+```bash
+cl ... /c /std:c++latest m.ixx /ifcOutput c:\example\
+```
+
+In the following example, the built *`.ifc`* file for module `m` defined in *`m.ixx`** is built as `c:\example\MyModule.ifc`:
+
+```bash
+cl ... /c /std:c++latest m.ixx /ifcOutput c:\example\MyModule.ifc
+```
+
+### To set this compiler option in the Visual Studio development environment
+
+1. To apply the **`/ifcOutput`** option to one file in the IDE, select the file in **Solution Explorer**. Right-click to open the context menu and select **Properties** to open the **Property Pages** dialog.
+
+1. Set the **Configuration** dropdown to **All Configurations**. Set the **Platform** dropdown to **All Platforms**.
+
+1. Open the **Configuration Properties** > **C/C++** > **Output Files** property page.
+
+1. Use the dropdown control to modify the **Module Output File Name** property to a directory name (ending in `\`) or an alternate file name. Or you can specify a directory + file name, for example, `c:\example\mymodule.ifc`. Choose **OK** or **Apply** to save your changes.
+
+Alternatively, you can specify the `/ifcOutput` switch with a right-click on the project name in the **Solution Explorer** > **Configuration Properties** > **C/C++** > **Command Line**.
+
+## See also
+
+[Overview of modules in C++](../../cpp/modules-cpp.md)\
+[Using C++ Modules in MSVC from the Command Line](https://devblogs.microsoft.com/cppblog/using-cpp-modules-in-msvc-from-the-command-line-part-1/)
\ No newline at end of file
diff --git a/docs/build/reference/ilk-name-incremental-database-file.md b/docs/build/reference/ilk-name-incremental-database-file.md
new file mode 100644
index 0000000000..ab1d1d456e
--- /dev/null
+++ b/docs/build/reference/ilk-name-incremental-database-file.md
@@ -0,0 +1,39 @@
+---
+title: "/ILK (Name incremental database file)"
+description: "The MSVC linker option /ILK specifies the incremental link database file pathname."
+ms.date: 03/27/2025
+f1_keywords: ["VC.Project.VCLinkerTool.IncrementalLinkDatabaseFile", "/ilk", "ilk"]
+helpviewer_keywords: ["Name incremental database file in C++ linker", "/ILK linker option", "-ILK linker option", "ILK linker option"]
+---
+# `/ILK` (Name incremental database file)
+
+The **`/ILK`** linker option tells the linker where to put the *`.ilk`* database file for incremental link information ([`/INCREMENTAL`](./incremental-link-incrementally.md)).
+
+## Syntax
+
+> **`/ILK:`**\[*`pathname`*]
+
+### Arguments
+
+*`pathname`*\
+The destination directory and filename for the generated *`.ilk`* file. If the **`/ILK`** option isn't specified when **`/INCREMENTAL`** is used, the filename is created by appending *`.ilk`* to the target base filename. When expanded, the fully qualified filename must not exceed `MAX_PATH` (260 characters).
+
+## Remarks
+
+The **`/ILK`** linker option tells the linker the path and filename to use for the *`.ilk`* incremental database file when you specify [`/INCREMENTAL`](./incremental-link-incrementally.md).
+
+### To set this compiler option in the Visual Studio development environment
+
+1. Open the project **Property Pages** dialog box. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
+1. Select the **Configuration Properties** > **Linker** > **General** property page.
+1. Modify the **Incremental Link Database File** property. The default value is `$(IntDir)$(TargetName).ilk`.
+
+### To set this compiler option programmatically
+
+- See .
+
+## See also
+
+[`/INCREMENTAL`](./incremental-link-incrementally.md)\
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
\ No newline at end of file
diff --git a/docs/build/reference/implib-name-import-library.md b/docs/build/reference/implib-name-import-library.md
index 9bf0f23ef3..93ad9b6efb 100644
--- a/docs/build/reference/implib-name-import-library.md
+++ b/docs/build/reference/implib-name-import-library.md
@@ -1,38 +1,35 @@
---
description: "Learn more about: /IMPLIB (Name Import Library)"
title: "/IMPLIB (Name Import Library)"
-ms.date: "11/04/2016"
+ms.date: 03/24/2025
f1_keywords: ["/implib", "VC.Project.VCLinkerTool.ImportLIbrary"]
helpviewer_keywords: ["IMPLIB linker option", "/IMPLIB linker option", "-IMPLIB linker option", "import libraries, overriding default name"]
-ms.assetid: fe8f71ab-7055-41b5-8ef8-2b97cfa4a432
---
-# /IMPLIB (Name Import Library)
+# `/IMPLIB` (Name Import Library)
+
+## Syntax
> /IMPLIB:*filename*
-## Parameters
+## Argument
-*filename*
-A user-specified name for the import library. It replaces the default name.
+*`filename`*\
+A user-specified name for the import library. It replaces the default name. When expanded, the fully qualified filename must not exceed `MAX_PATH` (260 characters).
## Remarks
-The /IMPLIB option overrides the default name for the import library that LINK creates when it builds a program that contains exports. The default name is formed from the base name of the main output file and the extension .lib. A program contains exports if one or more of the following are specified:
+The `/IMPLIB` option overrides the default name for the import library that LINK creates when it builds a program that contains exports. The default name is formed from the base name of the main output file and the extension `.lib`. A program contains exports if one or more of the following are specified:
- The [__declspec(dllexport)](../../cpp/dllexport-dllimport.md) keyword in the source code
-
- [EXPORTS](exports.md) statement in a .def file
-
- An [/EXPORT](export-exports-a-function.md) specification in a LINK command
-LINK ignores /IMPLIB when an import library is not being created. If no exports are specified, LINK does not create an import library. If an export file is used in the build, LINK assumes that an import library already exists and does not create one. For information on import libraries and export files, see [LIB Reference](lib-reference.md).
+LINK ignores `/IMPLIB` when an import library isn't being created. If no exports are specified, LINK doesn't create an import library. If an export file is used in the build, LINK assumes that an import library already exists and doesn't create one. For information on import libraries and export files, see [LIB Reference](lib-reference.md).
### To set this linker option in the Visual Studio development environment
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
-
1. Select the **Configuration Properties** > **Linker** > **Advanced** property page.
-
1. Modify the **Import Library** property.
### To set this linker option programmatically
@@ -41,5 +38,5 @@ LINK ignores /IMPLIB when an import library is not being created. If no exports
## See also
-[MSVC linker reference](linking.md)
+[MSVC linker reference](linking.md)\
[MSVC Linker Options](linker-options.md)
diff --git a/docs/build/reference/incremental-link-incrementally.md b/docs/build/reference/incremental-link-incrementally.md
index ef569a1246..581ba2ccd8 100644
--- a/docs/build/reference/incremental-link-incrementally.md
+++ b/docs/build/reference/incremental-link-incrementally.md
@@ -1,24 +1,26 @@
---
-description: "Learn more about: /INCREMENTAL (Link Incrementally)"
-title: "/INCREMENTAL (Link Incrementally)"
-ms.date: "11/04/2016"
+description: "Learn more about: /INCREMENTAL (Link incrementally)"
+title: "/INCREMENTAL (Link incrementally)"
+ms.date: 09/07/2022
f1_keywords: ["/incremental", "VC.Project.VCLinkerTool.LinkIncremental"]
helpviewer_keywords: ["/INCREMENTAL linker option", "-INCREMENTAL linker option", "INCREMENTAL linker option", "link incrementally option", "LINK tool [C++], options for full linking", "incremental linking"]
ms.assetid: 135656ff-94fa-4ad4-a613-22e1a2a5d16b
---
-# /INCREMENTAL (Link Incrementally)
+# `/INCREMENTAL` (Link incrementally)
-```
-/INCREMENTAL[:NO]
-```
+Specifies whether to link incrementally or always perform a full link.
+
+## Syntax
+
+> **`/INCREMENTAL`**\[**`:NO`**]
## Remarks
-Controls how the linker handles incremental linking.
+The **`/INCREMENTAL`** linker option controls how the linker handles incremental linking.
-By default, the linker runs in incremental mode. To override a default incremental link, specify /INCREMENTAL:NO.
+By default, the linker runs in incremental mode. To override a default incremental link, specify **`/INCREMENTAL:NO`**.
-An incrementally linked program is functionally equivalent to a program that is non-incrementally linked. However, because it is prepared for subsequent incremental links, an incrementally linked executable, static library, or dynamic-link library file:
+An incrementally linked program is functionally equivalent to a program that is non-incrementally linked. However, because it's prepared for subsequent incremental links, an incrementally linked executable, static library, or dynamic-link library file:
- Is larger than a non-incrementally linked program because of padding of code and data. Padding enables the linker to increase the size of functions and data without recreating the file.
@@ -27,35 +29,37 @@ An incrementally linked program is functionally equivalent to a program that is
> [!NOTE]
> To ensure that your final release build does not contain padding or thunks, link your program non-incrementally.
-To link incrementally regardless of the default, specify /INCREMENTAL. When this option is selected, the linker issues a warning if it cannot link incrementally, and then links the program non-incrementally. Certain options and situations override /INCREMENTAL.
+To link incrementally regardless of the default, specify **`/INCREMENTAL`**. When this option is selected, the linker issues a warning if it can't link incrementally, and then links the program non-incrementally. Certain options and situations override **`/INCREMENTAL`**.
Most programs can be linked incrementally. However, some changes are too great, and some options are incompatible with incremental linking. LINK performs a full link if any of the following options are specified:
-- Link Incrementally is not selected (/INCREMENTAL:NO)
+- Link Incrementally isn't selected (**`/INCREMENTAL:NO`**)
-- /OPT:REF is selected
+- **`/OPT:REF`** is selected
-- /OPT:ICF is selected
+- **`/OPT:ICF`** is selected
-- /OPT:LBR is selected
+- **`/OPT:LBR`** is selected
-- /ORDER is selected
+- **`/ORDER`** is selected
-/INCREMENTAL is implied when [/DEBUG](debug-generate-debug-info.md) is specified.
+**`/INCREMENTAL`** is implied when [`/DEBUG`](debug-generate-debug-info.md) is specified.
Additionally, LINK performs a full link if any of the following situations occur:
-- The incremental status (.ilk) file is missing. (LINK creates a new .ilk file in preparation for subsequent incremental linking.)
+- The incremental status (*`.ilk`*) file is missing. (LINK creates a new *`.ilk`* file in preparation for subsequent incremental linking.)
-- There is no write permission for the .ilk file. (LINK ignores the .ilk file and links non-incrementally.)
+- There's no write permission for the *`.ilk`* file. (LINK ignores the *`.ilk`* file and links non-incrementally.)
-- The .exe or .dll output file is missing.
+- The *`.exe`* or *`.dll`* output file is missing.
-- The timestamp of the .ilk, .exe, or .dll is changed.
+- The timestamp of the *`.ilk`*, *`.exe`*, or *`.dll`* is changed.
- A LINK option is changed. Most LINK options, when changed between builds, cause a full link.
-- An object (.obj) file is added or omitted.
+- An object (*`.obj`*) file is added or omitted.
+
+An incremental link creates or updates an incremental link database *`.ilk`* file. You can specify the name and location of this file by using the [`/ILK` (Name incremental database file)](./ilk-name-incremental-database-file.md) linker option. For more information about the *`.ilk`* file, see [`.ilk` files as linker input](./dot-ilk-files-as-linker-input.md).
### To set this linker option in the Visual Studio development environment
@@ -71,5 +75,6 @@ Additionally, LINK performs a full link if any of the following situations occur
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)\
+[`.ilk` files as linker input](./dot-ilk-files-as-linker-input.md)
diff --git a/docs/build/reference/inference-rules.md b/docs/build/reference/inference-rules.md
index 593b8b2bbb..ebb37cb557 100644
--- a/docs/build/reference/inference-rules.md
+++ b/docs/build/reference/inference-rules.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: NMAKE inference rules"
title: "Inference rules"
+description: "Learn more about: NMAKE inference rules"
ms.date: 09/30/2021
helpviewer_keywords: ["inference rules in NMAKE", "rules, inference", "NMAKE program, inference rules", "search paths in NMAKE inference rules", "defining inference rules", "batch-mode inference rules in NMAKE", "rules, predefined", "NMAKE program, predefined rules", "predefined rules in NMAKE", "rules, inferred", "inferred dependents in NMAKE", "inferred rules in NMAKE", "dependents, inferred", "precedence, inference rule"]
---
@@ -10,7 +10,7 @@ Inference rules in NMAKE supply commands to update targets and to infer dependen
If an out-of-date dependency has no commands, and if [`.SUFFIXES`](dot-directives.md) contains the dependent's extension, NMAKE uses a rule whose extensions match the target and an existing file in the current or specified directory. If more than one rule matches existing files, the **`.SUFFIXES`** list determines which to use; list priority descends from left to right. If a dependent file doesn't exist and isn't listed as a target in another description block, an inference rule can create the missing dependent from another file that has the same base name. If a description block's target has no dependents or commands, an inference rule can update the target. Inference rules can build a command-line target even if no description block exists. NMAKE may invoke a rule for an inferred dependent even if an explicit dependent is specified.
-## Defining a rule
+## Defining a rule
The *from_ext* represents the extension of a dependent file, and *to_ext* represents the extension of a target file.
@@ -21,7 +21,7 @@ The *from_ext* represents the extension of a dependent file, and *to_ext* repres
Extensions aren't case-sensitive. Macros can be invoked to represent *from_ext* and *to_ext*; the macros are expanded during preprocessing. The period (**`.`**) that precedes *from_ext* must appear at the beginning of the line. The colon (**`:`**) is preceded by zero or more spaces or tabs. It can be followed only by spaces or tabs, a semicolon (**`;`**) to specify a command, a number sign (**`#`**) to specify a comment, or a newline character. No other spaces are allowed. Commands are specified as in description blocks.
-## Search paths in rules
+## Search paths in rules
```makefile
{from_path}.from_ext{to_path}.to_ext:
@@ -61,7 +61,7 @@ An inference rule applies to a dependency only if paths specified in the depende
$(CC) $(CFLAGS) $<
```
-## Batch-mode rules
+## Batch-mode rules
```makefile
{from_path}.from_ext{to_path}.to_ext::
@@ -135,7 +135,7 @@ foo4.cpp
Generating Code...
```
-## Predefined rules
+## Predefined rules
Predefined inference rules use NMAKE-supplied command and options macros.
@@ -155,7 +155,7 @@ Predefined inference rules use NMAKE-supplied command and options macros.
| `.cxx.obj` | `$(CXX) $(CXXFLAGS) /c $<` | `cl /c $<` | yes | all |
| `.rc.res` | `$(RC) $(RFLAGS) /r $<` | `rc /r $<` | no | all |
-## Inferred dependents and rules
+## Inferred dependents and rules
NMAKE assumes an inferred dependent for a target if an applicable inference rule exists. A rule applies if:
@@ -169,7 +169,7 @@ NMAKE assumes an inferred dependent for a target if an applicable inference rule
Inferred dependents can cause unexpected side effects. If the target's description block contains commands, NMAKE executes those commands instead of the commands in the rule.
-## Precedence in inference rules
+## Precedence in inference rules
If an inference rule is defined more than once, NMAKE uses the highest-precedence definition. The following list shows the order of precedence from highest to lowest:
diff --git a/docs/build/reference/inline-files-in-a-makefile.md b/docs/build/reference/inline-files-in-a-makefile.md
index 5e2e03c1b2..b18211ffdc 100644
--- a/docs/build/reference/inline-files-in-a-makefile.md
+++ b/docs/build/reference/inline-files-in-a-makefile.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Inline files in a makefile"
title: "Inline files in a makefile"
+description: "Learn more about: Inline files in a makefile"
ms.date: 09/30/2021
helpviewer_keywords: ["inline files [C++], in makefiles", "inline files [C++]", "NMAKE program, inline files", "makefiles, inline files", "files [C++], inline", "inline files, multiple NMAKE", "multiple inline files", "inline files, reusing NMAKE", "reusing inline files", "inline files, creating text", "inline files [C++], specifying NMAKE"]
---
@@ -8,7 +8,7 @@ helpviewer_keywords: ["inline files [C++], in makefiles", "inline files [C++]",
An inline file contains text you specify in the makefile. Its name can be used in commands as input (for example, a LINK command file), or it can pass commands to the operating system. The file is created on disk when a command that creates the file is run.
-## Specify an inline file
+## Specify an inline file
Specify two angle brackets (**`<<`**) in the command where *filename* is to appear. The angle brackets can't be a macro expansion. The *filename* is optional:
@@ -18,7 +18,7 @@ Specify two angle brackets (**`<<`**) in the command where *filename* is to appe
When the command is run, the angle brackets are replaced by *filename*, if specified, or by a unique NMAKE-generated name. If specified, *filename* must follow angle brackets without a space or tab. A path is permitted. No extension is required or assumed. If *filename* is specified, the file is created in the current or specified directory, overwriting any existing file by that name. Otherwise, it's created in the `TMP` directory (or the current directory, if the `TMP` environment variable isn't defined). If a previous *filename* is reused, NMAKE replaces the previous file.
-## Create inline file text
+## Create inline file text
Inline files are temporary or permanent.
@@ -34,11 +34,11 @@ Specify your *inline_text* on the first line after the command. Mark the end wit
A temporary file exists for the duration of the session and can be reused by other commands. Specify **`KEEP`** after the closing angle brackets to retain the file after the NMAKE session; an unnamed file is preserved on disk with the generated filename. Specify **`NOKEEP`** or nothing for a temporary file. **`KEEP`** and **`NOKEEP`** are not case sensitive.
-## Reuse inline files
+## Reuse inline files
To reuse an inline file, specify `< Multiple inline files
+## Multiple inline files
A command can create more than one inline file:
diff --git a/docs/build/reference/integritycheck-require-signature-check.md b/docs/build/reference/integritycheck-require-signature-check.md
index e8786d6bd6..2e154fe960 100644
--- a/docs/build/reference/integritycheck-require-signature-check.md
+++ b/docs/build/reference/integritycheck-require-signature-check.md
@@ -1,23 +1,23 @@
---
description: "Learn more about: /INTEGRITYCHECK (Require signature check)"
title: "/INTEGRITYCHECK (Require signature check)"
-ms.date: 04/21/2021
+ms.date: 08/29/2023
---
# `/INTEGRITYCHECK` (Require signature check)
Specifies that the digital signature of the binary image must be checked at load time.
-> **`/INTEGRITYCHECK`**[**`:NO`**]
+> **`/INTEGRITYCHECK`**
## Remarks
By default, **`/INTEGRITYCHECK`** is off.
-The **`/INTEGRITYCHECK`** linker option sets a flag, `IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY`, in the PE header of the DLL file or executable file. This flag tells the memory manager to check for a digital signature in order to load the image in Windows. This option must be set for both 32-bit and 64-bit DLLs that implement kernel-mode code loaded by certain Windows features. It's recommended for all device drivers on Windows Vista, Windows Server 2008, and all later versions of Windows and Windows Server. Versions of Windows prior to Windows Vista ignore this flag. For more information, see [Forced Integrity Signing of Portable Executable (PE) files](https://social.technet.microsoft.com/wiki/contents/articles/255.forced-integrity-signing-of-portable-executable-pe-files.aspx).
+The **`/INTEGRITYCHECK`** linker option sets a flag, `IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY`, in the PE header of the DLL file or executable file. This flag tells the memory manager to check for a digital signature in order to load the image in Windows. This option must be set for both 32-bit and 64-bit DLLs that certain Windows features load. It's recommended for all device drivers on Windows Vista, Windows Server 2008, and all later versions of Windows and Windows Server. Versions of Windows prior to Windows Vista ignore this flag. For more information, see [Forced Integrity Signing of Portable Executable (PE) files](https://social.technet.microsoft.com/wiki/contents/articles/255.forced-integrity-signing-of-portable-executable-pe-files.aspx).
### Signing `/INTEGRITYCHECK` files
-Microsoft has new signing guidance for DLL and executable files linked by using **`/INTEGRITYCHECK`**. The guidance used to recommend a cross-signed certificate from the [cross-signing program](/windows-hardware/drivers/install/cross-certificates-for-kernel-mode-code-signing). However, the [cross-signing program is now deprecated](/windows-hardware/drivers/install/deprecation-of-software-publisher-certificates-and-commercial-release-certificates). We recommend you sign your **`/INTEGRITYCHECK`** files by using the Microsoft [Azure Code Signing](https://techcommunity.microsoft.com/t5/video-hub/reduce-developer-friction-with-azure-code-signing/m-p/1698637) program instead.
+Microsoft has new signing guidance for DLL and executable files linked by using **`/INTEGRITYCHECK`**. The guidance used to recommend a cross-signed certificate from the [cross-signing program](/windows-hardware/drivers/install/cross-certificates-for-kernel-mode-code-signing). However, the [cross-signing program is now deprecated](/windows-hardware/drivers/install/deprecation-of-software-publisher-certificates-and-commercial-release-certificates). You must now sign your **`/INTEGRITYCHECK`** files by using the Microsoft [Trusted Signing service](/azure/trusted-signing/) program instead.
### To set this linker option in Visual Studio
@@ -25,12 +25,14 @@ Microsoft has new signing guidance for DLL and executable files linked by using
1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
-1. In **Additional Options**, enter *`/INTEGRITYCHECK`* or *`/INTEGRITYCHECK:NO`*. Choose **OK** to save your changes.
+1. To create a digitally signed image, include `/INTEGRITYCHECK` in the **Additional Options** command line. A digitally signed image must pass a verification check before it's loaded. This feature is disabled by default.
+
+1. Choose **OK** to save your changes.
## See also
-[MSVC linker reference](linking.md)
-[MSVC linker options](linker-options.md)
-[Forced integrity signing of portable executable (PE) files](https://social.technet.microsoft.com/wiki/contents/articles/255.forced-integrity-signing-of-portable-executable-pe-files.aspx)
-[Kernel-mode code signing requirements](/windows-hardware/drivers/install/kernel-mode-code-signing-requirements--windows-vista-and-later-)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)\
+[Forced integrity signing of portable executable (PE) files](https://social.technet.microsoft.com/wiki/contents/articles/255.forced-integrity-signing-of-portable-executable-pe-files.aspx)\
+[Kernel-mode code signing requirements](/windows-hardware/drivers/install/kernel-mode-code-signing-requirements--windows-vista-and-later-)\
[AppInit DLLs and Secure Boot](/windows/win32/dlls/secure-boot-and-appinit-dlls)
diff --git a/docs/build/reference/interface.md b/docs/build/reference/interface.md
new file mode 100644
index 0000000000..743215fc73
--- /dev/null
+++ b/docs/build/reference/interface.md
@@ -0,0 +1,50 @@
+---
+title: "/interface"
+description: "Use the /interface compiler option to treat the input file as a module interface unit."
+ms.date: 11/16/2022
+author: "tylermsft"
+ms.author: "twhitney"
+f1_keywords: ["/interface", "VC.Project.VCCLCompilerTool.Interface"]
+helpviewer_keywords: ["/interface", "Translate include directives into import directives"]
+---
+# `/interface`
+
+This switch instructs the compiler to treat the input file on the command line as a module interface unit.
+
+## Syntax
+
+> **`/interface`** *`filename`*
+
+## Remarks
+
+Use this switch when a module interface has a different extension than `.ixx`.
+
+In the following example, the module interface has a `.cppm` extension instead of `.ixx`, so the `/interface` switch is used to compile it as a module interface:
+
+```bash
+cl /c /std:c++latest /interface /TP my-module.cppm
+```
+
+The compiler derives the name for the generated `.ifc` file from the module interface name. For example, given a module name `MyModule` defined in `my-module.cppm`, the generated `.ifc` will be named `MyModule.ifc`.
+
+This switch must be used in with the [`/TP` (Specify source file type)](tc-tp-tc-tp-specify-source-file-type.md) compiler flag.
+
+**`/interface`** is available in Visual Studio 2019 version 16.10, or later.\
+**`/interface`** requires [/std:c++20](std-specify-language-standard-version.md) or later.
+
+### To set this compiler option in the Visual Studio development environment
+
+You normally shouldn't set this option in the Visual Studio development environment unless you use a different extension for your module interface files. By default, the build system applies this option to files that have a *`.ixx`** extension.
+
+1. To apply the **`/interface`** option to a file explicitly in the IDE, select the file in **Solution Explorer**. Right-click to open the context menu and select **Properties** to open the Property Pages dialog.
+
+1. Set the **Configuration** dropdown to **All Configurations**. Set the **Platform** dropdown to **All Platforms**.
+
+1. Open the **Configuration Properties** > **C/C++** > **Advanced** property page.
+
+1. Use the dropdown control to modify the **Compile As** property to **Compile as C++ Module Code (/interface)**. Choose **OK** or **Apply** to save your changes.
+
+## See also
+
+[Overview of modules in C++](../../cpp/modules-cpp.md)\
+[Using C++ Modules in MSVC from the Command Line](https://devblogs.microsoft.com/cppblog/using-cpp-modules-in-msvc-from-the-command-line-part-1/)
\ No newline at end of file
diff --git a/docs/build/reference/internal-partition.md b/docs/build/reference/internal-partition.md
new file mode 100644
index 0000000000..393c44956a
--- /dev/null
+++ b/docs/build/reference/internal-partition.md
@@ -0,0 +1,69 @@
+---
+title: "/internalPartition"
+description: "Use the /internalPartition compiler option to treat the input file as an internal partition unit."
+ms.date: 11/16/2022
+author: "tylermsft"
+ms.author: "twhitney"
+f1_keywords: ["/internalPartition", "VC.Project.VCCLCompilerTool.Interface"]
+helpviewer_keywords: ["/internalPartition", "Translate include directives into import directives"]
+---
+# `/internalPartition`
+
+Use the **`/internalPartition`** compiler option to treat the input file as an *internal partition unit*, which is a [module partition implementation unit](../../cpp/modules-cpp.md#implementing-modules) that doesn't contribute to the external interface of the module.
+
+## Syntax
+
+> **`/internalPartition`** *`filename`*
+
+## Remarks
+
+The following example demonstrates how to use the `/internalPartition` option:
+
+Source file `m-internals.cpp`:
+
+```cpp
+// m-internals.cpp
+module m:internals;
+
+void internalFunc() {} // cannot have `export` since this is an internal partition
+```
+
+Source file `m.ixx`:
+
+```cpp
+// m.ixx
+export module m;
+import :internals; // Cannot export this partition.
+
+export
+void wrapper() { internalFunc(); }
+```
+
+To compile this interface:
+
+```bash
+cl /std:c++latest /internalPartition /c m-internals.cpp
+```
+
+This option can't be used with the [`/interface`](interface.md) compiler option.
+
+**`/internalPartition`** is available in Visual Studio 2019 version 16.10, or later.\
+**`/internalPartition`** requires [/std:c++20](std-specify-language-standard-version.md) or later.
+
+### To set this compiler option in the Visual Studio development environment
+
+You normally shouldn't set this option in the Visual Studio development environment unless you use a different extension for your partition files. By default, the build system applies this option to files that have a *`.ixx`** extension.
+
+1. To apply the **`/internalPartition`** option to a file explicitly in the IDE, select the file in **Solution Explorer**. Right-click to open the context menu and select **Properties** to open the Property Pages dialog.
+
+1. Set the **Configuration** dropdown to **All Configurations**. Set the **Platform** dropdown to **All Platforms**.
+
+1. Open the **Configuration Properties** > **C/C++** > **Advanced** property page.
+
+1. Use the dropdown control to modify the **Compile As** property to **Compile as C++ Module Internal Partition (/internalPartition)**. Choose **OK** or **Apply** to save your changes.
+
+## See also
+
+[Overview of modules in C++](../../cpp/modules-cpp.md)\
+[Using C++ Modules in MSVC from the Command Line](https://devblogs.microsoft.com/cppblog/using-cpp-modules-in-msvc-from-the-command-line-part-1/)\
+[C++ Modules conformance improvements with MSVC in Visual Studio 2019 16.5](https://devblogs.microsoft.com/cppblog/c-modules-conformance-improvements-with-msvc-in-visual-studio-2019-16-5/#module-partitions)
\ No newline at end of file
diff --git a/docs/build/reference/jmc.md b/docs/build/reference/jmc.md
index ebff0e2dec..c78e3b3eb1 100644
--- a/docs/build/reference/jmc.md
+++ b/docs/build/reference/jmc.md
@@ -1,25 +1,27 @@
---
description: "Learn more about: /JMC (Just My Code debugging)"
title: "/JMC (Just My Code debugging)"
-ms.date: "08/20/2018"
+ms.date: 03/01/2022
f1_keywords: ["VC.Project.VCCLCompilerTool.SupportJustMyCode"]
helpviewer_keywords: ["/JMC compiler option [C++]", "Just my code [C++]", "-JMC compiler option [C++]", "User code, debugging", "JMC compiler option [C++]"]
---
-# /JMC (Just My Code debugging)
+# `/JMC` (Just My Code debugging)
-Specifies compiler support for native *Just My Code* debugging in the Visual Studio debugger. This option supports the user settings that allow Visual Studio to step over system, framework, library, and other non-user calls, and to collapse those calls in the call stack window. The **/JMC** compiler option is available starting in Visual Studio 2017 version 15.8.
+Specifies compiler support for native *Just My Code* debugging in the Visual Studio debugger. This option supports the user settings that allow Visual Studio to step over system, framework, library, and other non-user calls, and to collapse those calls in the call stack window. The **`/JMC`** compiler option is available starting in Visual Studio 2017 version 15.8.
## Syntax
-> **/JMC**\[**-**]
+> **`/JMC`**\[**`-`**]
## Remarks
-The Visual Studio [Just My Code](/visualstudio/debugger/just-my-code) settings specify whether the Visual Studio debugger steps over system, framework, library, and other non-user calls. The **/JMC** compiler option enables support for Just My Code debugging in your native C++ code. When **/JMC** is enabled, the compiler inserts calls to a helper function, `__CheckForDebuggerJustMyCode`, in the function prolog. The helper function provides hooks that support Visual Studio debugger Just My Code step operations. To enable Just My Code in the Visual Studio debugger, on the menu bar, choose **Tools** > **Options**, and then set the option in **Debugging** > **General** > **Enable Just My Code**.
+The Visual Studio [Just My Code](/visualstudio/debugger/just-my-code#BKMK_C___Just_My_Code) settings specify whether the Visual Studio debugger steps over system, framework, library, and other non-user calls. The **`/JMC`** compiler option enables support for Just My Code debugging in your native C++ code. When **`/JMC`** is enabled, the compiler inserts calls to a helper function, `__CheckForDebuggerJustMyCode`, in the function prolog. The helper function provides hooks that support Visual Studio debugger Just My Code step operations. To enable Just My Code in the Visual Studio debugger, on the menu bar, choose **Tools** > **Options**, and then set the option in **Debugging** > **General** > **Enable Just My Code**.
-The **/JMC** option requires that your code links to the C Runtime Library (CRT), which provides the `__CheckForDebuggerJustMyCode` helper function. If your project does not link to the CRT, you may see linker error **LNK2019: unresolved external symbol __CheckForDebuggerJustMyCode**. To resolve this error, either link to the CRT, or disable the **/JMC** option.
+The **`/JMC`** option requires that your code links to the C Runtime Library (CRT), which provides the `__CheckForDebuggerJustMyCode` helper function. If your project doesn't link to the CRT, you may see linker error **LNK2019: unresolved external symbol __CheckForDebuggerJustMyCode**. To resolve this error, either link to the CRT, or disable the **`/JMC`** option.
-By default, the **/JMC** compiler option is off. However, starting in Visual Studio 2017 version 15.8 this option is enabled in most Visual Studio project templates. To explicitly disable this option, use the **/JMC-** option on the command line. In Visual Studio, open the project Property Pages dialog box, and change the **Support Just My Code Debugging** property in the **Configuration Properties** > **C/C++** > **General** property page to **No**.
+When the **`/JMC`** option is enabled, the PDB file is annotated with extra line number information. In versions before Visual Studio 2019 version 16.8, this information may appear in code coverage reports as occurring at line 15732480 (0xF00F00) or 16707566 (0xFEEFEE). These fictitious line numbers are used as markers to delineate user code from non-user code. To include non-user code in code coverage reports without these unexpected line numbers, build your code with the **`/JMC-`** option.
+
+By default, the **`/JMC`** compiler option is off. However, starting in Visual Studio 2017 version 15.8 this option is enabled in most Visual Studio project templates. To explicitly disable this option, use the **`/JMC-`** option on the command line. In Visual Studio, open the project Property Pages dialog box, and change the **Support Just My Code Debugging** property in the **Configuration Properties** > **C/C++** > **General** property page to **No**.
For more information, see [C++ Just My Code](/visualstudio/debugger/just-my-code#BKMK_C___Just_My_Code) in [Specify whether to debug only user code using Just My Code in Visual Studio](/visualstudio/debugger/just-my-code), and the Visual C++ Team Blog post [Announcing C++ Just My Code Stepping in Visual Studio](https://devblogs.microsoft.com/cppblog/announcing-jmc-stepping-in-visual-studio/).
@@ -37,5 +39,5 @@ For more information, see [C++ Just My Code](/visualstudio/debugger/just-my-code
## See also
-[MSVC Compiler Options](compiler-options.md)
-[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
+[MSVC compiler options](compiler-options.md)\
+[MSVC compiler command-line syntax](compiler-command-line-syntax.md)
diff --git a/docs/build/reference/jump-table-rdata.md b/docs/build/reference/jump-table-rdata.md
new file mode 100644
index 0000000000..9cb7dd4fdc
--- /dev/null
+++ b/docs/build/reference/jump-table-rdata.md
@@ -0,0 +1,40 @@
+---
+description: "Learn more about: /jumptablerdata (Place switch case jump tables in .rdata)"
+title: "/jumptablerdata (put switch case jump tables in `.rdata`)"
+ms.date: 06/02/2023
+f1_keywords: ["/jumptable"]
+helpviewer_keywords: ["-jumptablerdata compiler option [C++]", "/jumptablerdata compiler option [C++]"]
+---
+# /jumptablerdata (put switch case jump tables in `.rdata`)
+
+Puts the generated switch case jump tables in the `.rdata` section instead of alongside code in the `.text` section.
+
+## Syntax
+
+```cpp
+/jumptablerdata
+```
+
+## Remarks
+
+Putting jump tables generated for switch case statements in the `.rdata` section prevents the jump table from being loaded into both the instruction cache (iCache) and data cache (dCache), potentially increasing performance. The `.rdata` section is where const initialized data is stored.
+
+> [!IMPORTANT]
+> This flag only applies to x64 code. This flag was introduced in Visual Studio 17.7.
+
+### To set this compiler option in the Visual Studio development environment
+
+1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+
+1. Select the **Configuration Properties** > **C/C++** > **Command Line** property page.
+
+1. Modify the **Additional Options** property to include `/jumptablerdata` and then choose **OK**.
+
+### To set this compiler option programmatically
+
+- See .
+
+## See also
+
+[MSVC Compiler Options](compiler-options.md)\
+[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
diff --git a/docs/build/reference/keycontainer-specify-a-key-container-to-sign-an-assembly.md b/docs/build/reference/keycontainer-specify-a-key-container-to-sign-an-assembly.md
index cb7054b09a..8ee29e44c0 100644
--- a/docs/build/reference/keycontainer-specify-a-key-container-to-sign-an-assembly.md
+++ b/docs/build/reference/keycontainer-specify-a-key-container-to-sign-an-assembly.md
@@ -23,7 +23,7 @@ The linker creates a signed assembly by inserting a public key into the assembly
If you compile with [/LN](ln-create-msil-module.md), the name of the key file is held in the module and incorporated into the assembly that is created when you compile an assembly that includes an explicit reference to the module, via [#using](../../preprocessor/hash-using-directive-cpp.md), or when linking with [/ASSEMBLYMODULE](assemblymodule-add-a-msil-module-to-the-assembly.md).
-You can also pass your encryption information to the compiler with [/KEYFILE](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md). Use [/DELAYSIGN](delaysign-partially-sign-an-assembly.md) if you want a partially signed assembly. See [Strong Name Assemblies (Assembly Signing) (C++/CLI)](../../dotnet/strong-name-assemblies-assembly-signing-cpp-cli.md) for more information on signing an assembly.
+You can also pass your encryption information to the compiler with [/KEYFILE](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md). Use [/DELAYSIGN](delaysign-partially-sign-an-assembly.md) if you want a partially signed assembly. For more information on signing an assembly, see [Strong Name Assemblies (Assembly Signing) (C++/CLI)](../../dotnet/strong-name-assemblies-assembly-signing-cpp-cli.md).
Other linker options that affect assembly generation are:
diff --git a/docs/build/reference/keyfile-specify-key-or-key-pair-to-sign-an-assembly.md b/docs/build/reference/keyfile-specify-key-or-key-pair-to-sign-an-assembly.md
index 2ef01ea543..3d1a74d531 100644
--- a/docs/build/reference/keyfile-specify-key-or-key-pair-to-sign-an-assembly.md
+++ b/docs/build/reference/keyfile-specify-key-or-key-pair-to-sign-an-assembly.md
@@ -1,12 +1,11 @@
---
-description: "Learn more about: /KEYFILE (Specify Key or Key Pair to Sign an Assembly)"
title: "/KEYFILE (Specify Key or Key Pair to Sign an Assembly)"
-ms.date: "11/04/2016"
+description: "Learn more about: /KEYFILE (Specify Key or Key Pair to Sign an Assembly)"
+ms.date: 03/24/2025
f1_keywords: ["/keyfile", "VC.Project.VCLinkerTool.KeyFile"]
helpviewer_keywords: ["/KEYFILE linker option", "-KEYFILE linker option", "KEYFILE linker option"]
-ms.assetid: 9b71f8c0-541c-4fe5-a0c7-9364f42ecb06
---
-# /KEYFILE (Specify Key or Key Pair to Sign an Assembly)
+# `/KEYFILE` (Specify Key or Key Pair to Sign an Assembly)
```
/KEYFILE:filename
@@ -14,39 +13,33 @@ ms.assetid: 9b71f8c0-541c-4fe5-a0c7-9364f42ecb06
## Arguments
-*filename*
+*`filename`*\
File that contains the key. Place the string in double quotation marks (" ") if it contains a space.
## Remarks
-The linker inserts the public key into the assembly manifest and then signs the final assembly with the private key. To generate a key file, type [sn -k](/dotnet/framework/tools/sn-exe-strong-name-tool) *filename* at the command line. A signed assembly is said to have a strong name.
+The linker inserts the public key into the assembly manifest and then signs the final assembly with the private key. To generate a key file, type [`sn -k`](/dotnet/framework/tools/sn-exe-strong-name-tool) *filename* at the command line. A signed assembly is said to have a strong name.
-If you compile with [/LN](ln-create-msil-module.md), the name of the key file is held in the module and incorporated into the assembly that is created when you compile an assembly that includes an explicit reference to the module, via [#using](../../preprocessor/hash-using-directive-cpp.md), or when linking with [/ASSEMBLYMODULE](assemblymodule-add-a-msil-module-to-the-assembly.md).
+If you compile with [`/LN`](ln-create-msil-module.md), the name of the key file is held in the module and incorporated into the assembly that is created when you compile an assembly that includes an explicit reference to the module, via [`#using`](../../preprocessor/hash-using-directive-cpp.md), or when linking with [`/ASSEMBLYMODULE`](assemblymodule-add-a-msil-module-to-the-assembly.md).
-You can also pass your encryption information to the linker with [/KEYCONTAINER](keycontainer-specify-a-key-container-to-sign-an-assembly.md). Use [/DELAYSIGN](delaysign-partially-sign-an-assembly.md) if you want a partially signed assembly. For more information on signing an assembly, see [Strong Name Assemblies (Assembly Signing) (C++/CLI)](../../dotnet/strong-name-assemblies-assembly-signing-cpp-cli.md) and [Creating and Using Strong-Named Assemblies](/dotnet/framework/app-domains/create-and-use-strong-named-assemblies).
+You can also pass your encryption information to the linker with [`/KEYCONTAINER`](keycontainer-specify-a-key-container-to-sign-an-assembly.md). Use [`/DELAYSIGN`](delaysign-partially-sign-an-assembly.md) if you want a partially signed assembly. For more information on signing an assembly, see [Strong Name Assemblies (Assembly Signing) (C++/CLI)](../../dotnet/strong-name-assemblies-assembly-signing-cpp-cli.md) and [Creating and Using Strong-Named Assemblies](/dotnet/framework/app-domains/create-and-use-strong-named-assemblies).
-In case both **/KEYFILE** and **/KEYCONTAINER** are specified (either by command-line option or by custom attribute), the linker will first try the key container. If that succeeds, then the assembly is signed with the information in the key container. If the linker doesn't find the key container, it will try the file specified with /KEYFILE. If that succeeds, the assembly is signed with the information in the key file and the key information will be installed in the key container (similar to sn -i) so that on the next compilation, the key container will be valid.
+In case both **`/KEYFILE`** and **`/KEYCONTAINER`** are specified (either by command-line option or by custom attribute), the linker will first try the key container. If that succeeds, then the assembly is signed with the information in the key container. If the linker doesn't find the key container, it will try the file specified with /KEYFILE. If that succeeds, the assembly is signed with the information in the key file and the key information will be installed in the key container (similar to sn -i) so that on the next compilation, the key container will be valid.
A key file might contain only the public key.
Other linker options that affect assembly generation are:
-- [/ASSEMBLYDEBUG](assemblydebug-add-debuggableattribute.md)
-
-- [/ASSEMBLYLINKRESOURCE](assemblylinkresource-link-to-dotnet-framework-resource.md)
-
-- [/ASSEMBLYMODULE](assemblymodule-add-a-msil-module-to-the-assembly.md)
-
-- [/ASSEMBLYRESOURCE](assemblyresource-embed-a-managed-resource.md)
-
-- [/NOASSEMBLY](noassembly-create-a-msil-module.md)
+- [`/ASSEMBLYDEBUG`](assemblydebug-add-debuggableattribute.md)
+- [`/ASSEMBLYLINKRESOURCE`](assemblylinkresource-link-to-dotnet-framework-resource.md)
+- [`/ASSEMBLYMODULE`](assemblymodule-add-a-msil-module-to-the-assembly.md)
+- [`/ASSEMBLYRESOURCE`](assemblyresource-embed-a-managed-resource.md)
+- [`/NOASSEMBLY`](noassembly-create-a-msil-module.md)
### To set this linker option in the Visual Studio development environment
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
-
1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
-
1. Enter the option into the **Additional Options** box.
### To set this linker option programmatically
@@ -55,5 +48,5 @@ Other linker options that affect assembly generation are:
## See also
-[MSVC linker reference](linking.md)
+[MSVC linker reference](linking.md)\
[MSVC Linker Options](linker-options.md)
diff --git a/docs/build/reference/largeaddressaware-handle-large-addresses.md b/docs/build/reference/largeaddressaware-handle-large-addresses.md
index e63c9bf10e..4d3910054e 100644
--- a/docs/build/reference/largeaddressaware-handle-large-addresses.md
+++ b/docs/build/reference/largeaddressaware-handle-large-addresses.md
@@ -1,10 +1,9 @@
---
-description: "Learn more about: /LARGEADDRESSAWARE (Handle Large Addresses)"
title: "/LARGEADDRESSAWARE (Handle Large Addresses)"
-ms.date: "11/04/2016"
+description: "Learn more about: /LARGEADDRESSAWARE (Handle Large Addresses)"
+ms.date: "02/12/2024"
f1_keywords: ["VC.Project.VCLinkerTool.LargeAddressAware", "/largeaddressaware"]
helpviewer_keywords: ["LARGEADDRESSAWARE linker option", "-LARGEADDRESSAWARE linker option", "/LARGEADDRESSAWARE linker option"]
-ms.assetid: a29756c8-e893-47a9-9750-1f0d25359385
---
# /LARGEADDRESSAWARE (Handle Large Addresses)
@@ -14,9 +13,11 @@ ms.assetid: a29756c8-e893-47a9-9750-1f0d25359385
## Remarks
-The /LARGEADDRESSAWARE option tells the linker that the application can handle addresses larger than 2 gigabytes. In the 64-bit compilers, this option is enabled by default. In the 32-bit compilers, /LARGEADDRESSAWARE:NO is enabled if /LARGEADDRESSAWARE is not otherwise specified on the linker line.
+The /LARGEADDRESSAWARE option tells the linker that the application can handle addresses larger than 2 gigabytes. In the 64-bit compilers, this option is enabled by default. In the 32-bit compilers, `/LARGEADDRESSAWARE:NO` is enabled if `/LARGEADDRESSAWARE` is not otherwise specified on the linker line.
+
+If an application was linked with `/LARGEADDRESSAWARE`, `DUMPBIN` [/HEADERS](headers.md) will display information to that effect.
-If an application was linked with /LARGEADDRESSAWARE, DUMPBIN [/HEADERS](headers.md) will display information to that effect.
+Linking 64-bit applications with **`/LARGEADDRESSAWARE:NO`** is not recommended because it restricts the available address space, which can result in runtime failures if the app exhausts memory. It may also prevent x64 apps from running on ARM64 systems because the emulation runtime will try to reserve 4GB of virtual address space. If the app was linked with `/LARGEADDRESSAWARE:NO`, the app won't launch because it can't allocate that much address space.
### To set this linker option in the Visual Studio development environment
@@ -32,5 +33,5 @@ If an application was linked with /LARGEADDRESSAWARE, DUMPBIN [/HEADERS](headers
## See also
-[MSVC linker reference](linking.md)
+[MSVC linker reference](linking.md)\
[MSVC Linker Options](linker-options.md)
diff --git a/docs/build/reference/libpath-additional-libpath.md b/docs/build/reference/libpath-additional-libpath.md
index 1ac84a5485..64cfdd3f94 100644
--- a/docs/build/reference/libpath-additional-libpath.md
+++ b/docs/build/reference/libpath-additional-libpath.md
@@ -1,32 +1,29 @@
---
description: "Learn more about: /LIBPATH (Additional Libpath)"
title: "/LIBPATH (Additional Libpath)"
-ms.date: "11/04/2016"
+ms.date: 03/27/2025
f1_keywords: ["/libpath", "VC.Project.VCLinkerTool.AdditionalLibraryDirectories"]
helpviewer_keywords: ["LIBPATH linker option", "/LIBPATH linker option", "Additional Libpath linker option", "environment library path override", "-LIBPATH linker option", "library path linker option"]
-ms.assetid: 7240af0b-9a3d-4d53-8169-2a92cd6958ba
---
-# /LIBPATH (Additional Libpath)
+# `/LIBPATH` (Additional Libpath)
-```
-/LIBPATH:dir
-```
+## Syntax
-## Parameters
+> /LIBPATH:dir
-*dir*
-Specifies a path that the linker will search before it searches the path specified in the LIB environment option.
+## Argument
+
+*`dir`*\
+Specifies a path that the linker searches before it searches the path specified in the `LIB` environment option. When expanded, the fully qualified directory must not exceed `MAX_PATH` (260 characters).
## Remarks
-Use the /LIBPATH option to override the environment library path. The linker will first search in the path specified by this option, and then search in the path specified in the LIB environment variable. You can specify only one directory for each /LIBPATH option you enter. If you want to specify more than one directory, you must specify multiple /LIBPATH options. The linker will then search the specified directories in order.
+Use the `/LIBPATH` option to override the environment library path. The linker first searches in the path specified by this option, and then searches in the path specified in the `LIB` environment variable. You can specify only one directory for each `/LIBPATH` option you enter. To specify more than one directory, specify multiple `/LIBPATH` options. The linker searches the specified directories in order.
### To set this linker option in the Visual Studio development environment
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
-
1. Select the **Configuration Properties** > **Linker** > **General** property page.
-
1. Modify the **Additional Library Directories** property.
### To set this linker option programmatically
@@ -35,5 +32,5 @@ Use the /LIBPATH option to override the environment library path. The linker wil
## See also
-[MSVC linker reference](linking.md)
+[MSVC linker reference](linking.md)\
[MSVC Linker Options](linker-options.md)
diff --git a/docs/build/reference/link-code-for-kernel-mode.md b/docs/build/reference/link-code-for-kernel-mode.md
new file mode 100644
index 0000000000..6a9d5e3901
--- /dev/null
+++ b/docs/build/reference/link-code-for-kernel-mode.md
@@ -0,0 +1,34 @@
+---
+description: "Learn more about: /KERNEL (Create kernel mode binary)."
+title: /KERNEL
+ms.date: "08/25/2023"
+---
+# /KERNEL (Create kernel mode binary)
+
+Create a binary that is suitable for running in kernel mode.
+
+## Syntax
+
+> **`/KERNEL`**
+
+## Remarks
+
+Causes the linker to emit a warning if any object file or library linked in the binary wasn't compiled with [/kernel](kernel-create-kernel-mode-binary.md).
+
+Code that can run in kernel mode must be compiled with the **`/kernel`** option. If you link a binary that contains code that wasn't compiled with **`/kernel`**, the binary might not run correctly in kernel mode.
+
+Code for kernel mode is compiled with a simplified set of C++ language features that are specific to code that runs in kernel mode. The compiler produces warnings for C++ language features that are potentially disruptive but can't be disabled. For more information about compiling code in kernel mode, see [/kernel (Create kernel mode binary)](kernel-create-kernel-mode-binary.md).
+
+### To set this linker option in Visual Studio
+
+1. Open the project **Property Pages** dialog box. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+
+1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
+
+1. In **Additional Options**, enter `/KERNELMODE`.
+
+## See also
+
+- [MSVC linker reference](linking.md)
+- [MSVC linker options](linker-options.md)
+- [Compiler options: /kernel](kernel-create-kernel-mode-binary.md)
\ No newline at end of file
diff --git a/docs/build/reference/link-input-files.md b/docs/build/reference/link-input-files.md
index 793f81974a..80664636c6 100644
--- a/docs/build/reference/link-input-files.md
+++ b/docs/build/reference/link-input-files.md
@@ -1,42 +1,42 @@
---
description: "Learn more about: LINK Input Files"
title: "LINK Input Files"
-ms.date: "11/04/2016"
+ms.date: 09/01/2022
helpviewer_keywords: ["files [C++], LINK", "module definition files", "resources [C++], linker files", "LINK tool [C++], input files", "module definition files, linker files", "input files [C++], LINK", "linker [C++], input files", "import libraries [C++], linker files", "command input to linker files [C++]"]
ms.assetid: bb26fcc5-509a-4620-bc3e-b6c6e603a412
---
-# LINK Input Files
+# LINK input files
-You provide the linker with files that contain objects, import and standard libraries, resources, module definitions, and command input. LINK does not use file extensions to make assumptions about the contents of a file. Instead, LINK examines each input file to determine what kind of file it is.
+You provide the linker with files that contain objects, import and standard libraries, resources, module definitions, and command input. LINK doesn't use file extensions to make assumptions about the contents of a file. Instead, LINK examines each input file to determine what kind of file it is.
-Object files on the command line are processed in the order they appear on the command line. Libraries are searched in command line order as well, with the following caveat: Symbols that are unresolved when bringing in an object file from a library are searched for in that library first, and then the following libraries from the command line and [/DEFAULTLIB (Specify Default Library)](defaultlib-specify-default-library.md) directives, and then to any libraries at the beginning of the command line.
+Object files on the command line are processed in the order they appear on the command line. Libraries are searched in command line order as well, with the following caveat: Symbols that are unresolved when bringing in an object file from a library are searched for in that library first, and then the following libraries from the command line and [`/DEFAULTLIB` (Specify default library)](defaultlib-specify-default-library.md) directives, and then to any libraries at the beginning of the command line.
> [!NOTE]
-> LINK no longer accepts a semicolon (or any other character) as the start of a comment in response files and order files. Semicolons are recognized only as the start of comments in module-definition files (.def).
+> LINK no longer accepts a semicolon (or any other character) as the start of a comment in response files and order files. Semicolons are recognized only as the start of comments in module-definition files (`.def`).
LINK uses the following types of input files:
-- [.obj files](dot-obj-files-as-linker-input.md)
+- [`.obj` files](dot-obj-files-as-linker-input.md)
-- [.netmodule files](netmodule-files-as-linker-input.md)
+- [`.netmodule` files](netmodule-files-as-linker-input.md)
-- [.lib files](dot-lib-files-as-linker-input.md)
+- [`.lib` files](dot-lib-files-as-linker-input.md)
-- [.exp files](dot-exp-files-as-linker-input.md)
+- [`.exp` files](dot-exp-files-as-linker-input.md)
-- [.def files](dot-def-files-as-linker-input.md)
+- [`.def` files](dot-def-files-as-linker-input.md)
-- [.pdb files](dot-pdb-files-as-linker-input.md)
+- [`.pdb` files](dot-pdb-files-as-linker-input.md)
-- [.res files](dot-res-files-as-linker-input.md)
+- [`.res` files](dot-res-files-as-linker-input.md)
-- [.exe files](dot-exe-files-as-linker-input.md)
+- [`.exe` files](dot-exe-files-as-linker-input.md)
-- [.txt files](dot-txt-files-as-linker-input.md)
+- [`.txt` files](dot-txt-files-as-linker-input.md)
-- [.ilk files](dot-ilk-files-as-linker-input.md)
+- [`.ilk` files](dot-ilk-files-as-linker-input.md)
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/link-repro-full-path-rsp.md b/docs/build/reference/link-repro-full-path-rsp.md
new file mode 100644
index 0000000000..c08892e4c7
--- /dev/null
+++ b/docs/build/reference/link-repro-full-path-rsp.md
@@ -0,0 +1,51 @@
+---
+description: "Learn more about: /LINKREPROFULLPATHRSP (Generate file containing absolute paths of linked files)"
+title: "/LINKREPROFULLPATHRSP (Generate file containing absolute paths of linked files)"
+ms.date: 03/27/2025
+f1_keywords: ["VC.Project.VCLinkerTool.LinkReproFullPathRSP", "/LINKREPROFULLPATHRSP"]
+helpviewer_keywords: ["/LINKREPROFULLPATHRSP linker option", "-LINKREPROFULLPATHRSP linker option", "LINKREPROFULLPATHRSP linker option"]
+---
+# `/LINKREPROFULLPATHRSP` (Generate file containing absolute paths of linked files)
+
+Generates a response file (`.RSP`) containing the absolute paths of all the files the linker took as input.
+
+This flag was introduced in Visual Studio 2022 version 17.11.
+
+## Syntax
+
+> **/LINKREPROFULLPATHRSP:filename**
+
+## Argument
+
+*`filename`*\
+Specifies the name of the response file to create. When expanded, the fully qualified filename must not exceed `MAX_PATH` (260 characters).
+
+## Remarks
+
+Rather than generate a full link repro like `/LINKREPRO`, which copies all the files to a directory and creates a response file with relative paths to that directory, this option writes the names of the files used during linking to the specified file.
+
+For example, given:
+- a directory `c:\temp\test` that contains the files `test.cpp`, `f1.cpp`, `f2.cpp`
+- the linker command line: `link f1.obj f2.obj test.obj /out:test.exe /LINKREPROFULLPATHRSP:test.rsp`
+The linker produces `test.rsp` containing the following lines to reflect the fully qualified paths of the input files:
+
+```cmd
+"c:\temp\test\f1.obj"
+"c:\temp\test\f2.obj"
+"c:\temp\test\test.obj"
+```
+
+### To set this linker option in the Visual Studio development environment
+
+1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
+1. Enter *`/LINKREPROFULLPATHRSP:file.rsp`* into **Additional Options**. Choose **OK** or **Apply** to apply the change.
+
+### To set this linker option programmatically
+
+- See [VCLinkerTool.AdditionalOptions](/dotnet/api/microsoft.visualstudio.vcprojectengine.vclinkertool.additionaloptions)
+
+## See also
+
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/linker-options.md b/docs/build/reference/linker-options.md
index 4fb8cbd463..5749d0c236 100644
--- a/docs/build/reference/linker-options.md
+++ b/docs/build/reference/linker-options.md
@@ -1,136 +1,140 @@
---
title: "MSVC Linker options"
description: "A list of the options supported by the Microsoft LINK linker."
-ms.date: "09/01/2020"
+ms.date: 03/14/2025
f1_keywords: ["link"]
helpviewer_keywords: ["linker [C++]", "linker [C++], options listed", "libraries [C++], linking to COFF", "LINK tool [C++], linker options"]
-ms.assetid: c1d51b8a-bd23-416d-81e4-900e02b2c129
---
# Linker options
-LINK.exe links Common Object File Format (COFF) object files and libraries to create an executable (.exe) file or a dynamic-link library (DLL).
+LINK.exe links Common Object File Format (COFF) object files and libraries to create an executable (EXE) file or a dynamic-link library (DLL).
-The following table lists options for LINK.exe. For more information about LINK, see:
+The following table lists options for `LINK.exe`. For more information about LINK, see:
-- [Compiler-Controlled LINK Options](compiler-controlled-link-options.md)
+- [Compiler-controlled LINK options](compiler-controlled-link-options.md)
+- [LINK input files](link-input-files.md)
+- [LINK output](link-output.md)
+- [Reserved words](reserved-words.md)
-- [LINK Input Files](link-input-files.md)
+Linker options aren't case-sensitive; for example, `/base` and `/BASE` mean the same thing. For details on how to specify each option on the command line or in Visual Studio, see the documentation for that option.
-- [LINK Output](link-output.md)
-
-- [Reserved Words](reserved-words.md)
-
-On the command line, linker options aren't case-sensitive; for example, `/base` and `/BASE` mean the same thing. For details on how to specify each option on the command line or in Visual Studio, see the documentation for that option.
-
-You can use the [comment](../../preprocessor/comment-c-cpp.md) pragma to specify some linker options.
+You can use the [`comment`](../../preprocessor/comment-c-cpp.md) pragma to specify some linker options.
## Linker options listed alphabetically
-|Option|Purpose|
-|------------|-------------|
-|[@](at-specify-a-linker-response-file.md)|Specifies a response file.|
-|[/ALIGN](align-section-alignment.md)|Specifies the alignment of each section.|
-|[/ALLOWBIND](allowbind-prevent-dll-binding.md)|Specifies that a DLL can't be bound.|
-|[/ALLOWISOLATION](allowisolation-manifest-lookup.md)|Specifies behavior for manifest lookup.|
-|[/APPCONTAINER](appcontainer-windows-store-app.md)|Specifies whether the app must run within an appcontainer process environment.|
-|[/ASSEMBLYDEBUG](assemblydebug-add-debuggableattribute.md)|Adds the to a managed image.|
-|[/ASSEMBLYLINKRESOURCE](assemblylinkresource-link-to-dotnet-framework-resource.md)|Creates a link to a managed resource.|
-|[/ASSEMBLYMODULE](assemblymodule-add-a-msil-module-to-the-assembly.md)|Specifies that a Microsoft intermediate language (MSIL) module should be imported into the assembly.|
-|[/ASSEMBLYRESOURCE](assemblyresource-embed-a-managed-resource.md)|Embeds a managed resource file in an assembly.|
-|[/BASE](base-base-address.md)|Sets a base address for the program.|
-|[/CETCOMPAT](cetcompat.md)|Marks the binary as CET Shadow Stack compatible.|
-|[/CGTHREADS](cgthreads-compiler-threads.md)|Sets number of cl.exe threads to use for optimization and code generation when link-time code generation is specified.|
-|[/CLRIMAGETYPE](clrimagetype-specify-type-of-clr-image.md)|Sets the type (IJW, pure, or safe) of a CLR image.|
-|[/CLRSUPPORTLASTERROR](clrsupportlasterror-preserve-last-error-code-for-pinvoke-calls.md)|Preserves the last error code of functions that are called through the P/Invoke mechanism.|
-|[/CLRTHREADATTRIBUTE](clrthreadattribute-set-clr-thread-attribute.md)|Specifies the threading attribute to apply to the entry point of your CLR program.|
-|[/CLRUNMANAGEDCODECHECK](clrunmanagedcodecheck-add-suppressunmanagedcodesecurityattribute.md)|Specifies whether the linker will apply the SuppressUnmanagedCodeSecurity attribute to linker-generated PInvoke stubs that call from managed code into native DLLs.|
-|[/DEBUG](debug-generate-debug-info.md)|Creates debugging information.|
-|[/DEBUGTYPE](debugtype-debug-info-options.md)|Specifies which data to include in debugging information.|
-|[/DEF](def-specify-module-definition-file.md)|Passes a module-definition (.def) file to the linker.|
-|[/DEFAULTLIB](defaultlib-specify-default-library.md)|Searches the specified library when external references are resolved.|
-|[/DELAY](delay-delay-load-import-settings.md)|Controls the delayed loading of DLLs.|
-|[/DELAYLOAD](delayload-delay-load-import.md)|Causes the delayed loading of the specified DLL.|
-|[/DELAYSIGN](delaysign-partially-sign-an-assembly.md)|Partially signs an assembly.|
-|[/DEPENDENTLOADFLAG](dependentloadflag.md)|Sets default flags on dependent DLL loads.|
-|[/DLL](dll-build-a-dll.md)|Builds a DLL.|
-|[/DRIVER](driver-windows-nt-kernel-mode-driver.md)|Creates a kernel mode driver.|
-|[/DYNAMICBASE](dynamicbase-use-address-space-layout-randomization.md)|Specifies whether to generate an executable image that's rebased at load time by using the address space layout randomization (ASLR) feature.|
-|[/ENTRY](entry-entry-point-symbol.md)|Sets the starting address.|
-|[/ERRORREPORT](errorreport-report-internal-linker-errors.md)| Deprecated. Error reporting is controlled by [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings. |
-|[/EXPORT](export-exports-a-function.md)|Exports a function.|
-|[/FILEALIGN](filealign.md)|Aligns sections within the output file on multiples of a specified value.|
-|[/FIXED](fixed-fixed-base-address.md)|Creates a program that can be loaded only at its preferred base address.|
-|[/FORCE](force-force-file-output.md)|Forces a link to complete even with unresolved symbols or symbols defined more than once.|
-|[/FUNCTIONPADMIN](functionpadmin-create-hotpatchable-image.md)|Creates an image that can be hot patched.|
-|[/GENPROFILE, /FASTGENPROFILE](genprofile-fastgenprofile-generate-profiling-instrumented-build.md)|Both of these options specify generation of a *`.pgd`* file by the linker to support profile-guided optimization (PGO). /GENPROFILE and /FASTGENPROFILE use different default parameters.|
-|[/GUARD](guard-enable-guard-checks.md)|Enables Control Flow Guard protection.|
-|[/HEAP](heap-set-heap-size.md)|Sets the size of the heap, in bytes.|
-|[/HIGHENTROPYVA](highentropyva-support-64-bit-aslr.md)|Specifies support for high-entropy 64-bit address space layout randomization (ASLR).|
-|[/IDLOUT](idlout-name-midl-output-files.md)|Specifies the name of the *`.idl`* file and other MIDL output files.|
-|[/IGNORE](ignore-ignore-specific-warnings.md)|Suppresses output of specified linker warnings.|
-|[/IGNOREIDL](ignoreidl-don-t-process-attributes-into-midl.md)|Prevents the processing of attribute information into an *`.idl`* file.|
-|[/IMPLIB](implib-name-import-library.md)|Overrides the default import library name.|
-|[/INCLUDE](include-force-symbol-references.md)|Forces symbol references.|
-|[/INCREMENTAL](incremental-link-incrementally.md)|Controls incremental linking.|
-|[/INFERASANLIBS](inferasanlibs.md)|Uses inferred sanitizer libraries.|
-|[/INTEGRITYCHECK](integritycheck-require-signature-check.md)|Specifies that the module requires a signature check at load time.|
-|[/KEYCONTAINER](keycontainer-specify-a-key-container-to-sign-an-assembly.md)|Specifies a key container to sign an assembly.|
-|[/KEYFILE](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md)|Specifies a key or key pair to sign an assembly.|
-|[/LARGEADDRESSAWARE](largeaddressaware-handle-large-addresses.md)|Tells the compiler that the application supports addresses larger than two gigabytes|
-|[/LIBPATH](libpath-additional-libpath.md)|Specifies a path to search before the environmental library path.|
-|[/LINKREPRO](linkrepro.md)|Specifies a path to generate link repro artifacts in.|
-|[/LINKREPROTARGET](linkreprotarget.md)|Generates a link repro only when producing the specified target.16.1|
-|[/LTCG](ltcg-link-time-code-generation.md)|Specifies link-time code generation.|
-|[/MACHINE](machine-specify-target-platform.md)|Specifies the target platform.|
-|[/MANIFEST](manifest-create-side-by-side-assembly-manifest.md)|Creates a side-by-side manifest file and optionally embeds it in the binary.|
-|[/MANIFESTDEPENDENCY](manifestdependency-specify-manifest-dependencies.md)|Specifies a \ section in the manifest file.|
-|[/MANIFESTFILE](manifestfile-name-manifest-file.md)|Changes the default name of the manifest file.|
-|[/MANIFESTINPUT](manifestinput-specify-manifest-input.md)|Specifies a manifest input file for the linker to process and embed in the binary. You can use this option multiple times to specify more than one manifest input file.|
-|[/MANIFESTUAC](manifestuac-embeds-uac-information-in-manifest.md)|Specifies whether User Account Control (UAC) information is embedded in the program manifest.|
-|[/MAP](map-generate-mapfile.md)|Creates a mapfile.|
-|[/MAPINFO](mapinfo-include-information-in-mapfile.md)|Includes the specified information in the mapfile.|
-|[/MERGE](merge-combine-sections.md)|Combines sections.|
-|[/MIDL](midl-specify-midl-command-line-options.md)|Specifies MIDL command-line options.|
-|[/NATVIS](natvis-add-natvis-to-pdb.md)|Adds debugger visualizers from a Natvis file to the program database (PDB).|
-|[/NOASSEMBLY](noassembly-create-a-msil-module.md)|Suppresses the creation of a .NET Framework assembly.|
-|[/NODEFAULTLIB](nodefaultlib-ignore-libraries.md)|Ignores all (or the specified) default libraries when external references are resolved.|
-|[/NOENTRY](noentry-no-entry-point.md)|Creates a resource-only DLL.|
-|[/NOLOGO](nologo-suppress-startup-banner-linker.md)|Suppresses the startup banner.|
-|[/NXCOMPAT](nxcompat-compatible-with-data-execution-prevention.md)|Marks an executable as verified to be compatible with the Windows Data Execution Prevention feature.|
-|[/OPT](opt-optimizations.md)|Controls LINK optimizations.|
-|[/ORDER](order-put-functions-in-order.md)|Places COMDATs into the image in a predetermined order.|
-|[/OUT](out-output-file-name.md)|Specifies the output file name.|
-|[/PDB](pdb-use-program-database.md)|Creates a PDB file.|
-|[/PDBALTPATH](pdbaltpath-use-alternate-pdb-path.md)|Uses an alternate location to save a PDB file.|
-|[/PDBSTRIPPED](pdbstripped-strip-private-symbols.md)|Creates a PDB file that has no private symbols.|
-|[/PGD](pgd-specify-database-for-profile-guided-optimizations.md)|Specifies a *`.pgd`* file for profile-guided optimizations.|
-|[/POGOSAFEMODE](pogosafemode-linker-option.md)|**Obsolete** Creates a thread-safe PGO instrumented build.|
-|[/PROFILE](profile-performance-tools-profiler.md)|Produces an output file that can be used with the Performance Tools profiler.|
-|[/RELEASE](release-set-the-checksum.md)|Sets the Checksum in the *`.exe`* header.|
-|[/SAFESEH](safeseh-image-has-safe-exception-handlers.md)|Specifies that the image will contain a table of safe exception handlers.|
-|[/SECTION](section-specify-section-attributes.md)|Overrides the attributes of a section.|
-|[/SOURCELINK](sourcelink.md)|Specifies a SourceLink file to add to the PDB.|
-|[/STACK](stack-stack-allocations.md)|Sets the size of the stack in bytes.|
-|[/STUB](stub-ms-dos-stub-file-name.md)|Attaches an MS-DOS stub program to a Win32 program.|
-|[/SUBSYSTEM](subsystem-specify-subsystem.md)|Tells the operating system how to run the *`.exe`* file.|
-|[/SWAPRUN](swaprun-load-linker-output-to-swap-file.md)|Tells the operating system to copy the linker output to a swap file before it's run.|
-|[/TLBID](tlbid-specify-resource-id-for-typelib.md)|Specifies the resource ID of the linker-generated type library.|
-|[/TLBOUT](tlbout-name-dot-tlb-file.md)|Specifies the name of the *`.tlb`* file and other MIDL output files.|
-|[/TSAWARE](tsaware-create-terminal-server-aware-application.md)|Creates an application that is designed specifically to run under Terminal Server.|
-|[/USEPROFILE](useprofile.md)|Uses profile-guided optimization training data to create an optimized image.|
-|[/VERBOSE](verbose-print-progress-messages.md)|Prints linker progress messages.|
-|[/VERSION](version-version-information.md)|Assigns a version number.|
-|[/WHOLEARCHIVE](wholearchive-include-all-library-object-files.md)|Includes every object file from specified static libraries.|
-|[/WINMD](winmd-generate-windows-metadata.md)|Enables generation of a Windows Runtime Metadata file.|
-|[/WINMDFILE](winmdfile-specify-winmd-file.md)|Specifies the file name for the Windows Runtime Metadata (winmd) output file that's generated by the [/WINMD](winmd-generate-windows-metadata.md) linker option.|
-|[/WINMDKEYFILE](winmdkeyfile-specify-winmd-key-file.md)|Specifies a key or key pair to sign a Windows Runtime Metadata file.|
-|[/WINMDKEYCONTAINER](winmdkeycontainer-specify-key-container.md)|Specifies a key container to sign a Windows Metadata file.|
-|[/WINMDDELAYSIGN](winmddelaysign-partially-sign-a-winmd.md)|Partially signs a Windows Runtime Metadata (.winmd) file by placing the public key in the winmd file.|
-|[/WX](wx-treat-linker-warnings-as-errors.md)|Treats linker warnings as errors.|
+| Option | Purpose |
+|--|--|
+| [`@`](at-specify-a-linker-response-file.md) | Specifies a response file. |
+| [`/ALIGN`](align-section-alignment.md) | Specifies the alignment of each section. |
+| [`/ALLOWBIND`](allowbind-prevent-dll-binding.md) | Specifies that a DLL can't be bound. |
+| [`/ALLOWISOLATION`](allowisolation-manifest-lookup.md) | Specifies behavior for manifest lookup. |
+| [`/APPCONTAINER`](appcontainer-windows-store-app.md) | Specifies whether the app must run within an appcontainer process environment. |
+| [`/ARM64XFUNCTIONPADMINX64`](arm64-function-pad-min-x64.md) | Specifies the minimum number of bytes of padding between x64 functions in ARM64X images.17.8 |
+| [`/ASSEMBLYDEBUG`](assemblydebug-add-debuggableattribute.md) | Adds the to a managed image. |
+| [`/ASSEMBLYLINKRESOURCE`](assemblylinkresource-link-to-dotnet-framework-resource.md) | Creates a link to a managed resource. |
+| [`/ASSEMBLYMODULE`](assemblymodule-add-a-msil-module-to-the-assembly.md) | Specifies that a Microsoft intermediate language (MSIL) module should be imported into the assembly. |
+| [`/ASSEMBLYRESOURCE`](assemblyresource-embed-a-managed-resource.md) | Embeds a managed resource file in an assembly. |
+| [`/BASE`](base-base-address.md) | Sets a base address for the program. |
+| [`/CETCOMPAT`](cetcompat.md) | Marks the binary as CET Shadow Stack compatible. |
+| [`/CGTHREADS`](cgthreads-compiler-threads.md) | Sets number of cl.exe threads to use for optimization and code generation when link-time code generation is specified. |
+| [`/CLRIMAGETYPE`](clrimagetype-specify-type-of-clr-image.md) | Sets the type (IJW, pure, or safe) of a CLR image. |
+| [`/CLRSUPPORTLASTERROR`](clrsupportlasterror-preserve-last-error-code-for-pinvoke-calls.md) | Preserves the last error code of functions that are called through the P/Invoke mechanism. |
+| [`/CLRTHREADATTRIBUTE`](clrthreadattribute-set-clr-thread-attribute.md) | Specifies the threading attribute to apply to the entry point of your CLR program. |
+| [`/CLRUNMANAGEDCODECHECK`](clrunmanagedcodecheck-add-suppressunmanagedcodesecurityattribute.md) | Specifies whether the linker applies the `SuppressUnmanagedCodeSecurity` attribute to linker-generated P/Invoke stubs that call from managed code into native DLLs. |
+| [`/DEBUG`](debug-generate-debug-info.md) | Creates debugging information. |
+| [`/DEBUGTYPE`](debugtype-debug-info-options.md) | Specifies which data to include in debugging information. |
+| [`/DEF`](def-specify-module-definition-file.md) | Passes a module-definition (.def) file to the linker. |
+| [`/DEFAULTLIB`](defaultlib-specify-default-library.md) | Searches the specified library when external references are resolved. |
+| [`/DELAY`](delay-delay-load-import-settings.md) | Controls the delayed loading of DLLs. |
+| [`/DELAYLOAD`](delayload-delay-load-import.md) | Causes the delayed loading of the specified DLL. |
+| [`/DELAYSIGN`](delaysign-partially-sign-an-assembly.md) | Partially signs an assembly. |
+| [`/DEPENDENTLOADFLAG`](dependentloadflag.md) | Sets default flags on dependent DLL loads. |
+| [`/DLL`](dll-build-a-dll.md) | Builds a DLL. |
+| [`/DRIVER`](driver-windows-nt-kernel-mode-driver.md) | Creates a kernel mode driver. |
+| [`/DYNAMICBASE`](dynamicbase-use-address-space-layout-randomization.md) | Specifies whether to generate an executable image that's rebased at load time by using the address space layout randomization (ASLR) feature. |
+| [`/DYNAMICDEOPT`](dynamic-deopt-linker.md) | Enable [C++ Dynamic Debugging (Preview)](/visualstudio/debugger/cpp-dynamic-debugging) and step in anywhere with on-demand function deoptimization. |
+| [`/ENTRY`](entry-entry-point-symbol.md) | Sets the starting address. |
+| [`/ERRORREPORT`](errorreport-report-internal-linker-errors.md) | Deprecated. Error reporting is controlled by [Windows Error Reporting (WER)](/windows/win32/wer/windows-error-reporting) settings. |
+| [`/EXPORT`](export-exports-a-function.md) | Exports a function. |
+| [`/FILEALIGN`](filealign.md) | Aligns sections within the output file on multiples of a specified value. |
+| [`/FIXED`](fixed-fixed-base-address.md) | Creates a program that can be loaded only at its preferred base address. |
+| [`/FORCE`](force-force-file-output.md) | Forces a link to complete even with unresolved symbols or symbols defined more than once. |
+| [`/FUNCTIONPADMIN`](functionpadmin-create-hotpatchable-image.md) | Creates an image that can be hot patched. |
+| [`/GENPROFILE`, `/FASTGENPROFILE`](genprofile-fastgenprofile-generate-profiling-instrumented-build.md) | Both of these options specify generation of a *`.pgd`* file by the linker to support profile-guided optimization (PGO). /GENPROFILE and /FASTGENPROFILE use different default parameters. |
+| [`/GUARD`](guard-enable-guard-checks.md) | Enables Control Flow Guard protection. |
+| [`/HEAP`](heap-set-heap-size.md) | Sets the size of the heap, in bytes. |
+| [`/HIGHENTROPYVA`](highentropyva-support-64-bit-aslr.md) | Specifies support for high-entropy 64-bit address space layout randomization (ASLR). |
+| [`/IDLOUT`](idlout-name-midl-output-files.md) | Specifies the name of the *`.idl`* file and other MIDL output files. |
+| [`/IGNORE`](ignore-ignore-specific-warnings.md) | Suppresses output of specified linker warnings. |
+| [`/IGNOREIDL`](ignoreidl-don-t-process-attributes-into-midl.md) | Prevents the processing of attribute information into an *`.idl`* file. |
+| [`/ILK`](ilk-name-incremental-database-file.md) | Overrides the default incremental database file name. |
+| [`/IMPLIB`](implib-name-import-library.md) | Overrides the default import library name. |
+| [`/INCLUDE`](include-force-symbol-references.md) | Forces symbol references. |
+| [`/INCREMENTAL`](incremental-link-incrementally.md) | Controls incremental linking. |
+| [`/INFERASANLIBS`](inferasanlibs.md) | Uses inferred sanitizer libraries. |
+| [`/INTEGRITYCHECK`](integritycheck-require-signature-check.md) | Specifies that the module requires a signature check at load time. |
+| [`/KERNEL`](link-code-for-kernel-mode.md) | Create a kernel mode binary. |
+| [`/KEYCONTAINER`](keycontainer-specify-a-key-container-to-sign-an-assembly.md) | Specifies a key container to sign an assembly. |
+| [`/KEYFILE`](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md) | Specifies a key or key pair to sign an assembly. |
+| [`/LARGEADDRESSAWARE`](largeaddressaware-handle-large-addresses.md) | Tells the compiler that the application supports addresses larger than 2 gigabytes |
+| [`/LIBPATH`](libpath-additional-libpath.md) | Specifies a path to search before the environmental library path. |
+| [`/LINKREPRO`](linkrepro.md) | Specifies a path to generate link repro artifacts in. |
+| [`/LINKREPROFULLPATHRSP`](link-repro-full-path-rsp.md) | Generates a response file containing the absolute paths to all the files that the linker took as input. |
+| [`/LINKREPROTARGET`](linkreprotarget.md) | Generates a link repro only when producing the specified target.16.1 |
+| [`/LTCG`](ltcg-link-time-code-generation.md) | Specifies link-time code generation. |
+| [`/MACHINE`](machine-specify-target-platform.md) | Specifies the target platform. |
+| [`/MANIFEST`](manifest-create-side-by-side-assembly-manifest.md) | Creates a side-by-side manifest file and optionally embeds it in the binary. |
+| [`/MANIFESTDEPENDENCY`](manifestdependency-specify-manifest-dependencies.md) | Specifies a \ section in the manifest file. |
+| [`/MANIFESTFILE`](manifestfile-name-manifest-file.md) | Changes the default name of the manifest file. |
+| [`/MANIFESTINPUT`](manifestinput-specify-manifest-input.md) | Specifies a manifest input file for the linker to process and embed in the binary. You can use this option multiple times to specify more than one manifest input file. |
+| [`/MANIFESTUAC`](manifestuac-embeds-uac-information-in-manifest.md) | Specifies whether User Account Control (UAC) information is embedded in the program manifest. |
+| [`/MAP`](map-generate-mapfile.md) | Creates a mapfile. |
+| [`/MAPINFO`](mapinfo-include-information-in-mapfile.md) | Includes the specified information in the mapfile. |
+| [`/MERGE`](merge-combine-sections.md) | Combines sections. |
+| [`/MIDL`](midl-specify-midl-command-line-options.md) | Specifies MIDL command-line options. |
+| [`/NATVIS`](natvis-add-natvis-to-pdb.md) | Adds debugger visualizers from a Natvis file to the program database (PDB). |
+| [`/NOASSEMBLY`](noassembly-create-a-msil-module.md) | Suppresses the creation of a .NET Framework assembly. |
+| [`/NODEFAULTLIB`](nodefaultlib-ignore-libraries.md) | Ignores all (or the specified) default libraries when external references are resolved. |
+| [`/NOENTRY`](noentry-no-entry-point.md) | Creates a resource-only DLL. |
+| [`/NOFUNCTIONPADSECTION`](no-function-pad-section.md) | Disables function padding for functions in the specified section.17.8 |
+| [`/NOLOGO`](nologo-suppress-startup-banner-linker.md) | Suppresses the startup banner. |
+| [`/NXCOMPAT`](nxcompat-compatible-with-data-execution-prevention.md) | Marks an executable as verified to be compatible with the Windows Data Execution Prevention feature. |
+| [`/OPT`](opt-optimizations.md) | Controls LINK optimizations. |
+| [`/ORDER`](order-put-functions-in-order.md) | Places COMDATs into the image in a predetermined order. |
+| [`/OUT`](out-output-file-name.md) | Specifies the output file name. |
+| [`/PDB`](pdb-use-program-database.md) | Creates a PDB file. |
+| [`/PDBALTPATH`](pdbaltpath-use-alternate-pdb-path.md) | Uses an alternate location to save a PDB file. |
+| [`/PDBSTRIPPED`](pdbstripped-strip-private-symbols.md) | Creates a PDB file that has no private symbols. |
+| [`/PGD`](pgd-specify-database-for-profile-guided-optimizations.md) | Specifies a *`.pgd`* file for profile-guided optimizations. |
+| [`/POGOSAFEMODE`](pogosafemode-linker-option.md) | **Obsolete** Creates a thread-safe PGO instrumented build. |
+| [`/PROFILE`](profile-performance-tools-profiler.md) | Produces an output file that can be used with the Performance Tools profiler. |
+| [`/RELEASE`](release-set-the-checksum.md) | Sets the Checksum in the *`.exe`* header. |
+| [`/SAFESEH`](safeseh-image-has-safe-exception-handlers.md) | Specifies that the image will contain a table of safe exception handlers. |
+| [`/SECTION`](section-specify-section-attributes.md) | Overrides the attributes of a section. |
+| [`/SOURCELINK`](sourcelink.md) | Specifies a SourceLink file to add to the PDB. |
+| [`/STACK`](stack-stack-allocations.md) | Sets the size of the stack in bytes. |
+| [`/STUB`](stub-ms-dos-stub-file-name.md) | Attaches an MS-DOS stub program to a Win32 program. |
+| [`/SUBSYSTEM`](subsystem-specify-subsystem.md) | Tells the operating system how to run the *`.exe`* file. |
+| [`/SWAPRUN`](swaprun-load-linker-output-to-swap-file.md) | Tells the operating system to copy the linker output to a swap file before it's run. |
+| [`/TIME`](time-linker-time-information.md) | Output linker pass timing information. |
+| [`/TLBID`](tlbid-specify-resource-id-for-typelib.md) | Specifies the resource ID of the linker-generated type library. |
+| [`/TLBOUT`](tlbout-name-dot-tlb-file.md) | Specifies the name of the *`.tlb`* file and other MIDL output files. |
+| [`/TSAWARE`](tsaware-create-terminal-server-aware-application.md) | Creates an application that is designed specifically to run under Terminal Server. |
+| [`/USEPROFILE`](useprofile.md) | Uses profile-guided optimization training data to create an optimized image. |
+| [`/VERBOSE`](verbose-print-progress-messages.md) | Prints linker progress messages. |
+| [`/VERSION`](version-version-information.md) | Assigns a version number. |
+| [`/WHOLEARCHIVE`](wholearchive-include-all-library-object-files.md) | Includes every object file from specified static libraries. |
+| [`/WINMD`](winmd-generate-windows-metadata.md) | Enables generation of a Windows Runtime Metadata file. |
+| [`/WINMDFILE`](winmdfile-specify-winmd-file.md) | Specifies the file name for the Windows Runtime Metadata (winmd) output file that's generated by the [`/WINMD`](winmd-generate-windows-metadata.md) linker option. |
+| [`/WINMDKEYFILE`](winmdkeyfile-specify-winmd-key-file.md) | Specifies a key or key pair to sign a Windows Runtime Metadata file. |
+| [`/WINMDKEYCONTAINER`](winmdkeycontainer-specify-key-container.md) | Specifies a key container to sign a Windows Metadata file. |
+| [`/WINMDDELAYSIGN`](winmddelaysign-partially-sign-a-winmd.md) | Partially signs a Windows Runtime Metadata (*`.winmd`*) file by placing the public key in the winmd file. |
+| [`/WX`](wx-treat-linker-warnings-as-errors.md) | Treats linker warnings as errors. |
-16.1 This option is available starting in Visual Studio 2019 version 16.1.
+16.1 This option is available starting in Visual Studio 2019 version 16.1.\
+17.8 This option is available starting in Visual Studio 2022 version 17.8.
## See also
-[C/C++ Building Reference](c-cpp-building-reference.md)\
+[C/C++ building reference](c-cpp-building-reference.md)\
[MSVC linker reference](linking.md)
diff --git a/docs/build/reference/linker-property-pages.md b/docs/build/reference/linker-property-pages.md
index b198808f57..27a8a52d11 100644
--- a/docs/build/reference/linker-property-pages.md
+++ b/docs/build/reference/linker-property-pages.md
@@ -1,9 +1,9 @@
---
-description: "Learn more about: Linker Property Pages"
title: "Linker Property Pages"
-ms.date: "07/24/2019"
+description: "Learn more about: Linker Property Pages"
+ms.date: 09/07/2022
ms.topic: "article"
-ms.assetid: 7e7671e5-a35a-4e67-9bdb-661d75c4d11e
+f1_keywords: ["VC.Project.VCLinkerTool.IgnoreImportLibrary", "VC.Project.VCLinkerTool.RegisterOutput", "VC.Project.VCLinkerTool.PerUserRedirection", "VC.Project.VCLinkerTool.LinkLibraryDependencies", "VC.Project.VCLinkerTool.UseLibraryDependencyInputs"]
---
# Linker Property Pages
@@ -13,7 +13,7 @@ The following properties are found under **Project** > **Properties** > **Config
### Output File
-The [/OUT](out-output-file-name.md) option overrides the default name and location of the program that the linker creates.
+The [`/OUT`](out-output-file-name.md) option overrides the default name and location of the program that the linker creates.
### Show Progress
@@ -31,150 +31,150 @@ Prints Linker Progress Messages
### Version
-The [/VERSION](version-version-information.md) option tells the linker to put a version number in the header of the .exe or .dll file. Use DUMPBIN /HEADERS to see the image version field of the OPTIONAL HEADER VALUES to see the effect of **/VERSION**.
+The [`/VERSION`](version-version-information.md) option tells the linker to put a version number in the header of the *`.exe`* or *`.dll`* file. Use `DUMPBIN /HEADERS` to see the image version field of the `OPTIONAL HEADER VALUES` to see the effect of **`/VERSION`**.
### Enable Incremental Linking
-Enables incremental linking. ([/INCREMENTAL](incremental-link-incrementally.md), /INCREMENTAL:NO)
+Enables incremental linking. ([`/INCREMENTAL, /INCREMENTAL:NO`](incremental-link-incrementally.md))
### Suppress Startup Banner
-The [/NOLOGO](nologo-suppress-startup-banner-linker.md) option prevents display of the copyright message and version number.
+The [`/NOLOGO`](nologo-suppress-startup-banner-linker.md) option prevents display of the copyright message and version number.
### Ignore Import Library
-This property tells the linker not to link any .lib output generated from this build into any dependent project. It allows the project system to handle .dll files that don't produce a .lib file when built. If a project depends on another project that produces a DLL, the project system automatically links the .lib file produced by that child project. This property may be unnecessary in projects that produce COM DLLs or resource-only DLLs, because these DLLs don't have any meaningful exports. If a DLL has no exports, the linker doesn't generate a .lib file. If no export .lib file is present, and the project system tells the linker to link with the missing DLL, the link fails. Use the **Ignore Import Library** property to resolve this problem. When set to **Yes**, the project system ignores the presence or absence of the .lib file, and causes any project that depends on this project to not link with the nonexistent .lib file.
+This property tells the linker not to link any *`.lib`* output generated from this build into any dependent project. It allows the project system to handle *`.dll`* files that don't produce a *`.lib`* file when built. If a project depends on another project that produces a DLL, the project system automatically links the *`.lib`* file produced by that child project. This property may be unnecessary in projects that produce COM DLLs or resource-only DLLs, because these DLLs don't have any meaningful exports. If a DLL has no exports, the linker doesn't generate a *`.lib`* file. If no export *`.lib`* file is present, and the project system tells the linker to link with the missing DLL, the link fails. Use the **Ignore Import Library** property to resolve this problem. When set to **Yes**, the project system ignores the presence or absence of the *`.lib`* file, and causes any project that depends on this project to not link with the nonexistent *`.lib`* file.
To programmatically access this property, see .
### Register Output
-Runs `regsvr32.exe /s $(TargetPath)` on the build output, which is valid only on .dll projects. For .exe projects, this property is ignored. To register an .exe output, set a postbuild event on the configuration to do the custom registration that is always required for registered .exe files.
+Runs `regsvr32.exe /s $(TargetPath)` on the build output, which is valid only on *`.dll`* projects. For *`.exe`* projects, this property is ignored. To register an *`.exe`* output, set a postbuild event on the configuration to do the custom registration that is always required for registered *`.exe`* files.
To programmatically access this property, see .
### Per-user Redirection
-Registration in Visual Studio has traditionally been done in HKEY_CLASSES_ROOT (HKCR). With Windows Vista and later operating systems, to access HKCR you must run Visual Studio in elevated mode. Developers don't always want to run in elevated mode but still must work with registration. Per-user redirection allows you to register without having to run in elevated mode.
+Registration in Visual Studio has traditionally been done in `HKEY_CLASSES_ROOT` (HKCR). With Windows Vista and later operating systems, to access HKCR you must run Visual Studio in elevated mode. Developers don't always want to run in elevated mode but still must work with registration. Per-user redirection allows you to register without having to run in elevated mode.
-Per-user redirection forces any writes to HKCR to be redirected to HKEY\_CURRENT\_USER (HKCU). If per-user redirection is turned off, it can cause [Project Build Error PRJ0050](../../error-messages/tool-errors/project-build-error-prj0050.md) when the program tries to write to HKCR.
+Per-user redirection forces any writes to HKCR to be redirected to `HKEY_CURRENT_USER` (HKCU). If per-user redirection is turned off, it can cause [Project Build Error PRJ0050](../../error-messages/tool-errors/project-build-error-prj0050.md) when the program tries to write to HKCR.
### Additional Library Directories
-Allows the user to override the environmental library path. ([/LIBPATH](libpath-additional-libpath.md):folder)
+Allows the user to override the environment's library path. ([`/LIBPATH:folder`](libpath-additional-libpath.md))
### Link Library Dependencies
-Specifies whether to link the .lib files that are produced by dependent projects. Typically, you want to link in the .lib files, but it may not be the case for certain DLLs.
+Specifies whether to link the *`.lib`* files that are produced by dependent projects. Typically, you want to link in the *`.lib`* files, but it may not be the case for certain DLLs.
-You can also specify a .obj file by providing the file name and relative path, for example "..\\..\MyLibProject\MyObjFile.obj". If the source code for the .obj file #includes a precompiled header, for example pch.h, then the pch.obj file is located in the same folder as MyObjFile.obj. You must also add pch.obj as an additional dependency.
+You can also specify a *`.obj`* file by providing the file name and relative path, for example, *`..\..\MyLibProject\MyObjFile.obj`*. If the source code for the *`.obj`* file has a `#include` for a precompiled header, for example, *`pch.h`*, then the *`pch.obj`* file is located in the same folder as *`MyObjFile.obj`*. You must also add *`pch.obj`* as an additional dependency.
### Use Library Dependency Inputs
-Specifies whether to use the inputs to the librarian tool, rather than the library file itself, when linking in library outputs of project dependencies. In a large project, when a dependent project produces a .lib file, incremental linking is disabled. If there are many dependent projects that produce .lib files, building the application can take a long time. When this property is set to **Yes**, the project system links in the .obj files for .libs produced by dependent projects, enabling incremental linking.
+Specifies whether to use the inputs to the librarian tool, rather than the library file itself, when linking in library outputs of project dependencies. In a large project, when a dependent project produces a *`.lib`* file, incremental linking is disabled. If there are many dependent projects that produce *`.lib`* files, building the application can take a long time. When this property is set to **Yes**, the project system links in the *`.obj`* files for *`.lib`* files produced by dependent projects, enabling incremental linking.
-For information about how to access the **General** linker property page, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+For information about how to access the **General** linker property page, see [Set compiler and build properties](../working-with-project-properties.md).
### Link Status
-Specifies whether the linker should display a progress indicator showing what percentage of the link is complete. The default is to not display this status information. ([/LTCG](ltcg-link-time-code-generation.md):STATUS|LTCG:NOSTATUS)
+Specifies whether the linker should display a progress indicator showing what percentage of the link is complete. The default is to not display this status information. ([`/LTCG:STATUS|LTCG:NOSTATUS`](ltcg-link-time-code-generation.md))
### Prevent DLL Binding
-[/ALLOWBIND](allowbind-prevent-dll-binding.md):NO sets a bit in a DLL's header that indicates to Bind.exe that the image isn't allowed to be bound. You may not want a DLL to be bound if it has been digitally signed (binding invalidates the signature).
+[`/ALLOWBIND:NO`](allowbind-prevent-dll-binding.md) sets a bit in a DLL's header that indicates to *`Bind.exe`* that binding the image isn't allowed. You may not want a DLL to be bound if it has been digitally signed (binding invalidates the signature).
### Treat Linker Warning As Errors
-[/WX](wx-treat-linker-warnings-as-errors.md) causes no output file to be generated if the linker generates a warning.
+[`/WX`](wx-treat-linker-warnings-as-errors.md) causes no output file to be generated if the linker generates a warning.
### Force File Output
-The [/FORCE](force-force-file-output.md) option tells the linker to create an .exe file or DLL even if a symbol is referenced but not defined, or is multiply defined. It may create invalid .exe file.
+The [`/FORCE`](force-force-file-output.md) option tells the linker to create an *`.exe`* file or DLL even if a symbol is referenced but not defined (**`UNRESOLVED`**), or is defined multiple times (**`MULTIPLE`**). It may create an invalid *`.exe`* file.
**Choices**
-- **Enabled** - /FORCE with no arguments implies both multiple and unresolved.
-- **Multiply Defined Symbol Only** - Use /FORCE:MULTIPLE to create an output file, even if LINK finds more than one definition for a symbol.
-- **Undefined Symbol Only** - Use /FORCE:UNRESOLVED to create an output file whether or not LINK finds an undefined symbol. /FORCE:UNRESOLVED is ignored if the entry point symbol is unresolved.
+- **Enabled** - **`/FORCE`** with no arguments implies both **`/FORCE:MULTIPLE`** and **`/FORCE:UNRESOLVED`**.
+- **Multiply Defined Symbol Only** - Use **`/FORCE:MULTIPLE`** to create an output file, even if LINK finds more than one definition for a symbol.
+- **Undefined Symbol Only** - Use **`/FORCE:UNRESOLVED`** to create an output file whether or not LINK finds an undefined symbol. **`/FORCE:UNRESOLVED`** is ignored if the entry point symbol is unresolved.
### Create Hot Patchable Image
-Prepares an image for hotpatching.
+Prepares an image for hot patching.
**Choices**
-- **Enabled** - Prepares an image for hotpatching.
-- **X86 Image Only** - Prepares an X86 image for hotpatching.
-- **X64 Image Only** - Prepares an X64 image for hotpatching.
-- **Itanium Image Only** - Prepares an Itanium image for hotpatching.
+- **Enabled** - Prepares an image for hot patching.
+- **X86 Image Only** - Prepares an X86 image for hot patching.
+- **X64 Image Only** - Prepares an X64 image for hot patching.
+- **Itanium Image Only** - Prepares an Itanium image for hot patching.
### Specify Section Attributes
-The [/SECTION](section-specify-section-attributes.md) option changes the attributes of a section, overriding the attributes set when the .obj file for the section was compiled.
+The [`/SECTION`](section-specify-section-attributes.md) option changes the attributes of a section, overriding the attributes set when the *`.obj`* file for the section was compiled.
## Input Property Page
### Additional Dependencies
-Specifies additional items to add to the link command line, for example *kernel32.lib*.
+Specifies extra dependency items to add to the link command line, for example *`kernel32.lib`*.
### Ignore All Default Libraries
-The [/NODEFAULTLIB](nodefaultlib-ignore-libraries.md) option tells the linker to remove one or more default libraries from the list of libraries it searches when resolving external references.
+The [`/NODEFAULTLIB`](nodefaultlib-ignore-libraries.md) option tells the linker to remove one or more default libraries from the list of libraries it searches when resolving external references.
### Ignore Specific Default Libraries
-Specifies one or more names of default libraries to ignore. Separate multiple libraries with semi-colons. (/NODEFAULTLIB:[name, name, ...])
+Specifies one or more names of default libraries to ignore. Separate multiple libraries with semi-colons. ([`/NODEFAULTLIB:[name, name, ...]`](nodefaultlib-ignore-libraries.md))
### Module Definition File
-The [/DEF](def-specify-module-definition-file.md) option passes a module-definition file (.def) to the linker. Only one .def file can be specified to LINK.
+The [`/DEF`](def-specify-module-definition-file.md) option passes a module-definition file (*`.def`*) to the linker. Only one *`.def`* file can be specified to LINK.
### Add Module to Assembly
-The [/ASSEMBLYMODULE](assemblymodule-add-a-msil-module-to-the-assembly.md) option allows you to add a module reference to an assembly. Type information in the module will not be available to the assembly program that added the module reference. However, type information in the module will be available to any program that references the assembly.
+The [`/ASSEMBLYMODULE`](assemblymodule-add-a-msil-module-to-the-assembly.md) option allows you to add a module reference to an assembly. Type information in the module won't be available to the assembly program that added the module reference. However, type information in the module will be available to any program that references the assembly.
### Embed Managed Resource File
-[/ASSEMBLYRESOURCE](assemblyresource-embed-a-managed-resource.md) embeds a resource file in the output file.
+[`/ASSEMBLYRESOURCE`](assemblyresource-embed-a-managed-resource.md) embeds a resource file in the output file.
### Force Symbol References
-The [/INCLUDE](include-force-symbol-references.md) option tells the linker to add a specified symbol to the symbol table.
+The [`/INCLUDE`](include-force-symbol-references.md) option tells the linker to add a specified symbol to the symbol table.
### Delay Loaded DLLs
-The [/DELAYLOAD](delayload-delay-load-import.md) option causes delayed loading of DLLs. The dll name specifies a DLL to delay load.
+The [`/DELAYLOAD`](delayload-delay-load-import.md) option causes delayed loading of DLLs. The dll name specifies a DLL to delay load.
### Assembly Link Resource
-The [/ASSEMBLYLINKRESOURCE](assemblylinkresource-link-to-dotnet-framework-resource.md) option creates a link to a .NET Framework resource in the output file; the resource file is not placed in the output file.
+The [`/ASSEMBLYLINKRESOURCE`](assemblylinkresource-link-to-dotnet-framework-resource.md) option creates a link to a .NET Framework resource in the output file. The linker doesn't place the resource file in the output file.
## Manifest File Property Page
### Generate Manifest
-[/MANIFEST](manifest-create-side-by-side-assembly-manifest.md) specifies that the linker should create a side-by-side manifest file.
+[`/MANIFEST`](manifest-create-side-by-side-assembly-manifest.md) specifies that the linker should create a side-by-side manifest file.
### Manifest File
-[/MANIFESTFILE](manifestfile-name-manifest-file.md) lets you change the default name of the manifest file. The default name of the manifest file is the file name with .manifest appended.
+[`/MANIFESTFILE`](manifestfile-name-manifest-file.md) lets you change the default name of the manifest file. The default name of the manifest file is the file name with *`.manifest`* appended.
### Additional Manifest Dependencies
-[/MANIFESTDEPENDENCY](manifestdependency-specify-manifest-dependencies.md) lets you specify attributes that will be placed in the dependency section of the manifest file.
+[`/MANIFESTDEPENDENCY`](manifestdependency-specify-manifest-dependencies.md) lets you specify attributes that will be placed in the dependency section of the manifest file.
### Allow Isolation
-Specifies behavior for manifest lookup. ([/ALLOWISOLATION](allowisolation-manifest-lookup.md):NO)
+Specifies behavior for manifest lookup. ([`/ALLOWISOLATION:NO`](allowisolation-manifest-lookup.md))
### Enable User Account Control (UAC)
-Specifies whether or not User Account Control is enabled. ([/MANIFESTUAC](manifestuac-embeds-uac-information-in-manifest.md), /MANIFESTUAC:NO)
+Specifies whether or not User Account Control is enabled. ([`/MANIFESTUAC, /MANIFESTUAC:NO`](manifestuac-embeds-uac-information-in-manifest.md))
### UAC Execution Level
-Specifies the requested execution level for the application when running with User Account Control. (/MANIFESTUAC:level=[value])
+Specifies the requested execution level for the application when running with User Account Control. ([`/MANIFESTUAC:level=[value]`](manifestuac-embeds-uac-information-in-manifest.md))
**Choices**
@@ -184,32 +184,32 @@ Specifies the requested execution level for the application when running with Us
### UAC Bypass UI Protection
-Specifies whether or not to bypass user interface protection levels for other windows on the desktop. Set this property to 'Yes' only for accessibility applications. ([/MANIFESTUAC](manifestuac-embeds-uac-information-in-manifest.md):uiAccess=[true | false])
+Specifies whether or not to bypass user interface protection levels for other windows on the desktop. Set this property to 'Yes' only for accessibility applications. ([`/MANIFESTUAC:uiAccess=[true | false]`](manifestuac-embeds-uac-information-in-manifest.md))
## Debugging Property Page
### Generate Debug Info
-This option enables creation of debugging information for the .exe file or the DLL.
+This option enables creation of debugging information for the *`.exe`* file or the DLL.
**Choices**
- **No** - Produces no debugging information.
- **Generate Debug Information** - Create a complete Program Database (PDB) ideal for distribution to Microsoft Symbol Server.
-- **Generate Debug Information optimized for faster links** - Produces a program database (PDB) ideal for edit-link-debug cycle.
-- **Generate Debug Information optimized for sharing and publishing** - Produces a program database (PDB) ideal for edit-link-debug cycle.
+- **Generate Debug Information optimized for faster links** - Produces a program database (PDB) ideal for a fast edit-link-debug cycle.
+- **Generate Debug Information optimized for sharing and publishing** - Produces a program database (PDB) ideal for a shared edit-link-debug cycle.
### Generate Program Database File
-By default, when [/DEBUG](debug-generate-debug-info.md) is specified, the linker creates a program database (PDB) which holds debugging information. The default file name for the PDB has the base name of the program and the extension .pdb.
+By default, when [`/DEBUG`](debug-generate-debug-info.md) is specified, the linker creates a program database (PDB) which holds debugging information. The default file name for the PDB has the base name of the program and the extension *`.pdb`*.
### Strip Private Symbols
-The [/PDBSTRIPPED](pdbstripped-strip-private-symbols.md) option creates a second program database (PDB) file when you build your program image with any of the compiler or linker options that generate a PDB file (/DEBUG, /Z7, /Zd, or /Zi).
+The [`/PDBSTRIPPED`](pdbstripped-strip-private-symbols.md) option creates a second program database (PDB) file when you build your program image with any of the compiler or linker options that generate a PDB file (**`/DEBUG`**, **`/Z7`**, **`/Zd`**, or **`/Zi`**).
### Generate Map File
-The [/MAP](map-generate-mapfile.md) option tells the linker to create a mapfile.
+The [`/MAP`](map-generate-mapfile.md) option tells the linker to create a mapfile.
### Map File Name
@@ -217,24 +217,24 @@ A user-specified name for the mapfile. It replaces the default name.
### Map Exports
-The [/MAPINFO](mapinfo-include-information-in-mapfile.md) option tells the linker to include the specified information in a mapfile, which is created if you specify the /MAP option. EXPORTS tells the linker to include exported functions.
+The [`/MAPINFO`](mapinfo-include-information-in-mapfile.md) option tells the linker to include the specified information in a mapfile, which is created if you specify the **`/MAP`** option. **`EXPORTS`** tells the linker to include exported functions.
### Debuggable Assembly
-[/ASSEMBLYDEBUG](assemblydebug-add-debuggableattribute.md) emits the DebuggableAttribute attribute with debug information tracking and disables JIT optimizations.
+[`/ASSEMBLYDEBUG`](assemblydebug-add-debuggableattribute.md) emits the `DebuggableAttribute` attribute with debug information tracking and disables JIT optimizations.
## System Property Page
### SubSystem
-The [/SUBSYSTEM](subsystem-specify-subsystem.md) option tells the operating system how to run the .exe file. The choice of subsystem affects the entry point symbol (or entry point function) that the linker will choose.
+The [`/SUBSYSTEM`](subsystem-specify-subsystem.md) option tells the operating system how to run the *`.exe`* file. The choice of subsystem affects the entry point symbol (or entry point function) that the linker will choose.
**Choices**
- **Not Set** - No subsystem set.
-- **Console** - Win32 character-mode application. Console applications are given a console by the operating system. If main or wmain is defined, CONSOLE is the default.
-- **Windows** - Application does not require a console, probably because it creates its own windows for interaction with the user. If WinMain or wWinMain is defined, WINDOWS is the default.
-- **Native** - Device drivers for Windows NT. If /DRIVER:WDM is specified, NATIVE is the default.
+- **Console** - Win32 character-mode application. Console applications are given a console by the operating system. If `main` or `wmain` is defined, `CONSOLE` is the default.
+- **Windows** - Application doesn't require a console, probably because it creates its own windows for interaction with the user. If `WinMain` or `wWinMain` is defined, `WINDOWS` is the default.
+- **Native** - Device drivers for Windows NT. If **`/DRIVER:WDM`** is specified, `NATIVE` is the default.
- **EFI Application** - EFI Application.
- **EFI Boot Service Driver** - EFI Boot Service Driver.
- **EFI ROM** - EFI ROM.
@@ -243,109 +243,109 @@ The [/SUBSYSTEM](subsystem-specify-subsystem.md) option tells the operating syst
### Minimum Required Version
-Specify the minimum required version of the subsystem. The arguments are decimal numbers in the range 0 through 65,535.
+Specify the minimum required version of the subsystem. The arguments are decimal numbers in the range 0 through 65535.
### Heap Reserve Size
-Specifies total heap allocation size in virtual memory. Default is 1 MB. ([/HEAP](heap-set-heap-size.md):reserve)
+Specifies total heap allocation size in virtual memory. Default is 1 MB. ([`/HEAP:reserve`](heap-set-heap-size.md))
### Heap Commit Size
-Specifies total heap allocation size in physical memory. Default is 4 KB. ([/HEAP](heap-set-heap-size.md):reserve,commit)
+Specifies total heap allocation size in physical memory. Default is 4 KB. ([`/HEAP:reserve,commit`](heap-set-heap-size.md))
### Stack Reserve Size
-Specifies the total stack allocation size in virtual memory. Default is 1 MB. ([/STACK](stack-stack-allocations.md):reserve)
+Specifies the total stack allocation size in virtual memory. Default is 1 MB. ([`/STACK:reserve`](stack-stack-allocations.md))
### Stack Commit Size
-Specifies the total stack allocation size in physical memory. Default is 4 KB. ([/STACK](stack-stack-allocations.md):reserve,commit)
+Specifies the total stack allocation size in physical memory. Default is 4 KB. ([`/STACK:reserve,commit`](stack-stack-allocations.md))
### Enable Large Addresses
-The [/LARGEADDRESSAWARE](largeaddressaware-handle-large-addresses.md) option tells the linker that the application can handle addresses larger than 2 gigabytes. By default, /LARGEADDRESSAWARE:NO is enabled if /LARGEADDRESSAWARE is not otherwise specified on the linker line.
+The [`/LARGEADDRESSAWARE`](largeaddressaware-handle-large-addresses.md) option tells the linker that the application can handle addresses larger than 2 gigabytes. By default, **`/LARGEADDRESSAWARE:NO`** is enabled if **`/LARGEADDRESSAWARE`** isn't otherwise specified on the linker line.
### Terminal Server
-The [/TSAWARE](tsaware-create-terminal-server-aware-application.md) option sets a flag in the IMAGE_OPTIONAL_HEADER DllCharacteristics field in the program image's optional header. When this flag is set, Terminal Server will not make certain changes to the application.
+The [`/TSAWARE`](tsaware-create-terminal-server-aware-application.md) option sets a flag in the `IMAGE_OPTIONAL_HEADER` `DllCharacteristics` field in the program image's optional header. When this flag is set, Terminal Server won't make certain changes to the application.
### Swap Run From CD
-The [/SWAPRUN](swaprun-load-linker-output-to-swap-file.md) option tells the operating system to first copy the linker output to a swap file, and then run the image from there. This option is a Windows NT 4.0 (and later) feature. When **CD** is specified, the operating system will copy the image on a removable disk to a page file and then load it.
+The [`/SWAPRUN`](swaprun-load-linker-output-to-swap-file.md) option tells the operating system to first copy the linker output to a swap file, and then run the image from there. This option is a Windows NT 4.0 (and later) feature. When **`CD`** is specified, the operating system will copy the image on a removable disk to a page file, and then load it.
### Swap Run From Network
-The [/SWAPRUN](swaprun-load-linker-output-to-swap-file.md) option tells the operating system to first copy the linker output to a swap file, and then run the image from there. This option is a Windows NT 4.0 (and later) feature. If **NET** is specified, the operating system will first copy the binary image from the network to a swap file and load it from there. This option is useful for running applications over the network.
+The [`/SWAPRUN`](swaprun-load-linker-output-to-swap-file.md) option tells the operating system to first copy the linker output to a swap file, and then run the image from there. This option is a Windows NT 4.0 (and later) feature. If **`NET`** is specified, the operating system will first copy the binary image from the network to a swap file and load it from there. This option is useful for running applications over the network.
### Driver
-Use the [/DRIVER](driver-windows-nt-kernel-mode-driver.md) linker option to build a Windows NT kernel mode driver.
+Use the [`/DRIVER`](driver-windows-nt-kernel-mode-driver.md) linker option to build a Windows NT kernel mode driver.
**Choices**
- **Not Set** - Default driver setting.
- **Driver** - Driver
-- **UP Only** - /DRIVER:UPONLY causes the linker to add the IMAGE_FILE_UP_SYSTEM_ONLY bit to the characteristics in the output header to specify that it is a uniprocessor (UP) driver. The operating system will refuse to load a UP driver on a multiprocessor (MP) system.
-- **WDM** - /DRIVER:WDM causes the linker to set the IMAGE_DLLCHARACTERISTICS_WDM_DRIVER bit in the optional header's DllCharacteristics field.
+- **UP Only** - **`/DRIVER:UPONLY`** causes the linker to add the `IMAGE_FILE_UP_SYSTEM_ONLY` bit to the characteristics in the output header to specify that it's a uniprocessor (UP) driver. The operating system will refuse to load a UP driver on a multiprocessor (MP) system.
+- **WDM** - **`/DRIVER:WDM`** causes the linker to set the `IMAGE_DLLCHARACTERISTICS_WDM_DRIVER` bit in the optional header's `DllCharacteristics` field.
## Optimization Property Page
### References
-[/OPT](opt-optimizations.md):REF eliminates functions and/or data that's never referenced while /OPT:NOREF keeps functions and/or data that's never referenced.
+[`/OPT:REF`](opt-optimizations.md) eliminates functions and/or data that's never referenced while **`/OPT:NOREF`** keeps functions and/or data that's never referenced.
### Enable COMDAT Folding
-Use [/OPT](opt-optimizations.md):ICF\[=iterations] to perform identical COMDAT folding.
+Use [`/OPT:ICF[=iterations]`](opt-optimizations.md) to perform identical COMDAT folding.
### Function Order
-The [/ORDER](order-put-functions-in-order.md)option tells LINK to optimize your program by placing certain COMDATs into the image in a predetermined order. LINK places the functions in the specified order within each section in the image.
+The [`/ORDER`](order-put-functions-in-order.md) option tells LINK to optimize your program by placing certain COMDATs into the image in a predetermined order. LINK places the functions in the specified order within each section in the image.
### Profile Guided Database
-Specify .pgd file for profile guided optimizations. ([/PGD](pgd-specify-database-for-profile-guided-optimizations.md))
+Specify the *`.pgd`* file for profile guided optimizations. ([`/PGD`](pgd-specify-database-for-profile-guided-optimizations.md))
### Link Time Code Generation
-Specifies link-time code generation. ([/LTCG](ltcg-link-time-code-generation.md))
+Specifies link-time code generation. ([`/LTCG`](ltcg-link-time-code-generation.md))
**Choices**
- **Default** - Default LTCG setting.
-- **Use Fast Link Time Code Generation** - Use Link Time Code Generation with [/FASTGENPROFILE](genprofile-fastgenprofile-generate-profiling-instrumented-build.md).
+- **Use Fast Link Time Code Generation** - Use Link Time Code Generation with [`/FASTGENPROFILE`](genprofile-fastgenprofile-generate-profiling-instrumented-build.md).
- **Use Link Time Code Generation** - Use [Link Time Code Generation](ltcg-link-time-code-generation.md).
-- **Profile Guided Optimization - Instrument** - Use [profile guided optimization](../profile-guided-optimizations.md) with :PGINSTRUMENT.
+- **Profile Guided Optimization - Instrument** - Use [profile guided optimization](../profile-guided-optimizations.md) with `:PGINSTRUMENT`.
- **Profile Guided Optimization - Optimization** - Specifies that the linker should use the profile data created after running the instrumented binary to create an optimized image.
-- **Profile Guided Optimization - Update** - Allows and tracks list of input files to be added or modified from what was specified in the :PGINSTRUMENT phase.
+- **Profile Guided Optimization - Update** - Allows and tracks list of input files to be added or modified from what was specified in the `:PGINSTRUMENT` phase.
## Embedded IDL Property Page
### MIDL Commands
-Specify MIDL command line Options. ([/MIDL](midl-specify-midl-command-line-options.md):@responsefile)
+Specify MIDL command line options. ([`/MIDL:@responsefile`](midl-specify-midl-command-line-options.md))
### Ignore Embedded IDL
-The [/IGNOREIDL](ignoreidl-don-t-process-attributes-into-midl.md) option specifies that any IDL attributes in source code should not be processed into an .idl file.
+The [`/IGNOREIDL`](ignoreidl-don-t-process-attributes-into-midl.md) option specifies that any IDL attributes in source code shouldn't be processed into an *`.idl`* file.
### Merged IDL Base File Name
-The [/IDLOUT](idlout-name-midl-output-files.md) option specifies the name and extension of the .idl file.
+The [`/IDLOUT`](idlout-name-midl-output-files.md) option specifies the name and extension of the *`.idl`* file.
### Type Library
-The [/TLBOUT](tlbout-name-dot-tlb-file.md) option specifies the name and extension of the .tlb file.
+The [`/TLBOUT`](tlbout-name-dot-tlb-file.md) option specifies the name and extension of the *`.tlb`* file.
### TypeLib Resource ID
-Allows you to specify the resource ID of the linker-generated type library. ([/TLBID](tlbid-specify-resource-id-for-typelib.md):id)
+Allows you to specify the resource ID of the linker-generated type library. ([`/TLBID:id`](tlbid-specify-resource-id-for-typelib.md))
## Windows Metadata Property Page
### Generate Windows Metadata
-Enables or disable generation of Windows Metadata.
+Enables or disables generation of Windows Metadata.
**Choices**
@@ -354,73 +354,73 @@ Enables or disable generation of Windows Metadata.
### Windows Metadata File
-The [/WINMDFILE](winmdfile-specify-winmd-file.md) option switch.
+The [`/WINMDFILE`](winmdfile-specify-winmd-file.md) option switch.
### Windows Metadata Key File
-Specify key or key pair to sign an Windows Metadata. ([/WINMDKEYFILE](winmdkeyfile-specify-winmd-key-file.md):filename)
+Specify a key or key pair to sign the Windows Metadata. ([`/WINMDKEYFILE:filename`](winmdkeyfile-specify-winmd-key-file.md))
### Windows Metadata Key Container
-Specify a key container to sign an Windows Metadata. ([/WINMDKEYCONTAINER](winmdkeycontainer-specify-key-container.md):name)
+Specify a key container to sign the Windows Metadata. ([`/WINMDKEYCONTAINER:name`](winmdkeycontainer-specify-key-container.md))
### Windows Metadata Delay Sign
-Partially sign an Windows Metadata. Use [/WINMDDELAYSIGN](winmddelaysign-partially-sign-a-winmd.md) if you only want to place the public key in the Windows Metadata. The default is /WINMDDELAYSIGN:NO.
+Partially sign the Windows Metadata. Use [`/WINMDDELAYSIGN`](winmddelaysign-partially-sign-a-winmd.md) if you only want to place the public key in the Windows Metadata. The default is **`/WINMDDELAYSIGN:NO`**.
## Advanced Property Page
### Entry Point
-The [/ENTRY](entry-entry-point-symbol.md) option specifies an entry point function as the starting address for an .exe file or DLL.
+The [`/ENTRY`](entry-entry-point-symbol.md) option specifies an entry point function as the starting address for an *`.exe`* file or DLL.
### No Entry Point
-The [/NOENTRY](noentry-no-entry-point.md)option is required for creating a resource-only DLL.Use this option to prevent LINK from linking a reference to `_main` into the DLL.
+The [`/NOENTRY`](noentry-no-entry-point.md) option is required for creating a resource-only DLL. Use this option to prevent LINK from linking a reference to `_main` into the DLL.
### Set Checksum
-The [/RELEASE](release-set-the-checksum.md) option sets the Checksum in the header of an .exe file.
+The [`/RELEASE`](release-set-the-checksum.md) option sets the Checksum in the header of an *`.exe`* file.
### Base Address
-Sets a base address for the program. ([/BASE](base-base-address.md):{address\[,size] | @filename,key})
+Sets a base address for the program. ([`/BASE:{address[,size] | @filename,key}`](base-base-address.md))
### Randomized Base Address
-Randomized Base Address. ([/DYNAMICBASE](dynamicbase-use-address-space-layout-randomization.md)\[:NO])
+Randomized Base Address. ([`/DYNAMICBASE[:NO]`](dynamicbase-use-address-space-layout-randomization.md))
### Fixed Base Address
-Creates a program that can be loaded only at its preferred base address. ([/FIXED](fixed-fixed-base-address.md)\[:NO])
+Creates a program that can be loaded only at its preferred base address. ([`/FIXED[:NO]`](fixed-fixed-base-address.md))
### Data Execution Prevention (DEP)
-Marks an executable as having been tested to be compatible with Windows Data Execution Prevention feature. ([/NXCOMPAT](nxcompat-compatible-with-data-execution-prevention.md)\[:NO])
+Marks an executable as having been tested to be compatible with Windows Data Execution Prevention feature. ([`/NXCOMPAT[:NO]`](nxcompat-compatible-with-data-execution-prevention.md))
### Turn Off Assembly Generation
-The [/NOASSEMBLY](noassembly-create-a-msil-module.md) option tells the linker to create an image for the current output file without a .NET Framework assembly.
+The [`/NOASSEMBLY`](noassembly-create-a-msil-module.md) option tells the linker to create an image for the current output file without a .NET Framework assembly.
### Unload delay loaded DLL
-The **UNLOAD** qualifier tells the delay-load helper function to support explicit unloading of the DLL. ([/DELAY](delay-delay-load-import-settings.md):UNLOAD)
+The **`UNLOAD`** qualifier tells the delay-load helper function to support explicit unloading of the DLL. ([`/DELAY:UNLOAD`](delay-delay-load-import-settings.md))
### Nobind delay loaded DLL
-The **NOBIND** qualifier tells the linker not to include a bindable IAT in the final image. The default is to create the bindable IAT for delay-loaded DLLs. ([/DELAY](delay-delay-load-import-settings.md):NOBIND)
+The **`NOBIND`** qualifier tells the linker not to include a bindable Import Address Table (IAT) in the final image. The default is to create the bindable IAT for delay-loaded DLLs. ([`/DELAY:NOBIND`](delay-delay-load-import-settings.md))
### Import Library
-Overrides the default import library name. ([/IMPLIB](implib-name-import-library.md):filename)
+Overrides the default import library name. ([`/IMPLIB:filename`](implib-name-import-library.md))
### Merge Sections
-The [/MERGE](merge-combine-sections.md) option combines the first section (from) with the second section (to), naming the resulting section to. For example, /merge:.rdata=.text.
+The [`/MERGE`](merge-combine-sections.md) option combines the first section with the second section, and gives the resulting section the second section name. For example, `/merge:.rdata=.text` merges the `.rdata` section with the `.text` section, and names the combined section `.text`.
### Target Machine
-The [/MACHINE](machine-specify-target-platform.md) option specifies the target platform for the program.
+The [`/MACHINE`](machine-specify-target-platform.md) option specifies the target platform for the program.
**Choices**
@@ -440,7 +440,7 @@ The [/MACHINE](machine-specify-target-platform.md) option specifies the target p
### Profile
-Produces an output file that can be used with the Performance Tools profiler. Requires GenerateDebugInformation (/[/DEBUG](debug-generate-debug-info.md)) to be set. ([/PROFILE](profile-performance-tools-profiler.md))
+Produces an output file that can be used with the Performance Tools profiler. Requires the **Generate Debug Info** property be set to **GenerateDebugInformation (/DEBUG)**. ([`/PROFILE`](profile-performance-tools-profiler.md))
### CLR Thread Attribute
@@ -450,7 +450,7 @@ Explicitly specify the threading attribute for the entry point of your CLR progr
- **MTA threading attribute** - Applies the MTAThreadAttribute attribute to the entry point of your program.
- **STA threading attribute** - Applies the STAThreadAttribute attribute to the entry point of your program.
-- **Default threading attribute** - Same as not specifying [/CLRTHREADATTRIBUTE](clrthreadattribute-set-clr-thread-attribute.md). Lets the Common Language Runtime (CLR) set the default threading attribute.
+- **Default threading attribute** - Same as not specifying [`/CLRTHREADATTRIBUTE`](clrthreadattribute-set-clr-thread-attribute.md). Lets the Common Language Runtime (CLR) set the default threading attribute.
### CLR Image Type
@@ -465,45 +465,45 @@ Sets the type (IJW, pure, or safe) of a CLR image.
### Key File
-Specify key or key pair to sign an assembly. ([/KEYFILE](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md):filename)
+Specify key or key pair to sign an assembly. ([`/KEYFILE:filename`](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md))
### Key Container
-Specify a key container to sign an assembly. ([/KEYCONTAINER](keycontainer-specify-a-key-container-to-sign-an-assembly.md):name)
+Specify a key container to sign an assembly. ([`/KEYCONTAINER:name`](keycontainer-specify-a-key-container-to-sign-an-assembly.md))
### Delay Sign
-Partially sign an assembly. Use [/DELAYSIGN](delaysign-partially-sign-an-assembly.md) if you only want to place the public key in the assembly. The default is /DELAYSIGN:NO.
+Partially sign an assembly. Use [`/DELAYSIGN`](delaysign-partially-sign-an-assembly.md) if you only want to place the public key in the assembly. The default is **`/DELAYSIGN:NO`**.
### CLR Unmanaged Code Check
-[/CLRUNMANAGEDCODECHECK](clrunmanagedcodecheck-add-suppressunmanagedcodesecurityattribute.md) specifies whether the linker will apply SuppressUnmanagedCodeSecurityAttribute to linker-generated PInvoke calls from managed code into native DLLs.
+[`/CLRUNMANAGEDCODECHECK`](clrunmanagedcodecheck-add-suppressunmanagedcodesecurityattribute.md) specifies whether the linker will apply `SuppressUnmanagedCodeSecurityAttribute` to linker-generated P/Invoke calls from managed code into native DLLs.
### Error Reporting
-Allows you to provide internal compiler error (ICE) information directly to the Visual C++ team.
+Allows you to provide internal compiler error (ICE) information directly to the Visual Studio C++ team.
**Choices**
- **PromptImmediately** - Prompt immediately.
-- **Queue For Next Login** - Queue for next login.
+- **Queue For Next Login** - Queue for next sign-in.
- **Send Error Report** - Send error report.
- **No Error Report** - No error report.
### SectionAlignment
-The [/ALIGN](align-section-alignment.md) option specifies the alignment of each section within the linear address space of the program. The number argument is in bytes and must be a power of two.
+The [`/ALIGN`](align-section-alignment.md) option specifies the alignment of each section within the linear address space of the program. The number argument is in bytes and must be a power of two.
### Preserve Last Error Code for PInvoke Calls
-[/CLRSUPPORTLASTERROR](clrsupportlasterror-preserve-last-error-code-for-pinvoke-calls.md), which is on by default, preserves the last error code of functions called through the P/Invoke mechanism, which allows you to call native functions in DLLS, from code compiled with /clr.
+[`/CLRSUPPORTLASTERROR`](clrsupportlasterror-preserve-last-error-code-for-pinvoke-calls.md), which is on by default, preserves the last error code of functions called through the P/Invoke mechanism, which allows you to call native functions in DLLS, from code compiled with **`/clr`**.
**Choices**
-- **Enabled** - Enable CLRSupportLastError.
-- **Disabled** - Disable CLRSupportLastError.
-- **System Dlls Only** - Enable CLRSupportLastError for system dlls only.
+- **Enabled** - Enable **`/CLRSupportLastError`**.
+- **Disabled** - Disable **`/CLRSupportLastError`**.
+- **System DLLs Only** - Enable **`/CLRSupportLastError`** for system DLLs only.
### Image Has Safe Exception Handlers
-When [/SAFESEH](safeseh-image-has-safe-exception-handlers.md) is specified, the linker will only produce an image if it can also produce a table of the image's safe exception handlers. This table specifies for the operating system which exception handlers are valid for the image.
+When [`/SAFESEH`](safeseh-image-has-safe-exception-handlers.md) is specified, the linker will only produce an image if it can also produce a table of the image's safe exception handlers. This table specifies for the operating system which exception handlers are valid for the image.
diff --git a/docs/build/reference/linking.md b/docs/build/reference/linking.md
index 3cc16467a7..8891ebf554 100644
--- a/docs/build/reference/linking.md
+++ b/docs/build/reference/linking.md
@@ -1,83 +1,80 @@
---
description: "Learn more about: Linking"
title: "MSVC linker reference"
-ms.date: "12/10/2018"
-ms.assetid: bb736587-d13b-4f3c-8982-3cc2c015c59c
+ms.date: 03/27/2025
---
# Linking
-In a C++ project, the *linking* step is performed after the compiler has compiled the source code into object files (*.obj). The linker (link.exe) combines the object files into a single executable file.
+In a C++ project, the *linking* step is performed after the compiler compiles the source code into object files (*.obj). The linker (`link.exe`) combines the object files into a single executable file.
Linker options can be set inside or outside of Visual Studio. Within Visual Studio, you access linker options by right-clicking on a project node in **Solution Explorer** and choosing **Properties** to display the property pages. Choose **Linker** in the left pane to expand the node and see all the options.
## Linker command-line syntax
-When you run LINK outside of Visual Studio, you can specify input in one or more ways:
+When you run the linker outside of Visual Studio, you can specify input in one or more ways:
- On the command line
-
- Using command files
-
- In environment variables
-LINK first processes options specified in the LINK environment variable, followed by options in the order they are specified on the command line and in command files. If an option is repeated with different arguments, the last one processed takes precedence.
+The linker first processes options specified in the `LINK` environment variable, followed by options in the order they're specified on the command line and in command files. If an option is repeated with different arguments, the last one processed takes precedence.
Options apply to the entire build; no options can be applied to specific input files.
-To run LINK.EXE, use the following command syntax:
+To run `link.exe`, use the following command syntax:
-```
-LINK arguments
+```cmd
+link arguments
```
The `arguments` include options and filenames and can be specified in any order. Options are processed first, then files. Use one or more spaces or tabs to separate arguments.
> [!NOTE]
-> You can start this tool only from the Visual Studio command prompt. You cannot start it from a system command prompt or from File Explorer.
+> You can start this tool only from the Visual Studio command prompt. You can't start it from a system command prompt or from File Explorer.
## Command line
-On the command line, an option consists of an option specifier, either a dash (-) or a forward slash (/), followed by the name of the option. Option names cannot be abbreviated. Some options take an argument, specified after a colon (:). No spaces or tabs are allowed within an option specification, except within a quoted string in the /COMMENT option. Specify numeric arguments in decimal or C-language notation. Option names and their keyword or filename arguments are not case sensitive, but identifiers as arguments are case sensitive.
+On the command line, an option consists of an option specifier, either a dash (`-`) or a forward slash (`/`), followed by the name of the option. Option names can't be abbreviated. Some options take an argument, specified after a colon (`:`). No spaces or tabs are allowed within an option specification, except within a quoted string in the `/COMMENT` option. Specify numeric arguments in decimal or C-language notation. Option names and their keyword or filename arguments aren't case sensitive, but identifiers as arguments are case sensitive.
-To pass a file to the linker, specify the filename on the command line after the LINK command. You can specify an absolute or relative path with the filename, and you can use wildcards in the filename. If you omit the dot (.) and filename extension, LINK assumes .obj for the purpose of finding the file. LINK does not use filename extensions or the lack of them to make assumptions about the contents of files; it determines the type of file by examining it, and processes it accordingly.
+To pass a file to the linker, specify the filename on the command line after the `link.exe` command. You can specify an absolute or relative path with the filename, and you can use wildcards in the filename. If you omit the dot (`.`) and filename extension, the linker assumes an extension of `.obj` to find the file. The linker doesn't use filename extensions or the lack of them to make assumptions about the contents of files. It determines the type of file by examining it, and processes it accordingly.
-link.exe returns zero for success (no errors). Otherwise, the linker returns the error number that stopped the link. For example, if the linker generates LNK1104, the linker returns 1104. Accordingly, the lowest error number returned on an error by the linker is 1000. A return value of 128 represents a configuration problem with either the operating system or a .config file; the loader didn't load either link.exe or c2.dll.
+> [!NOTE]
+> Various linker flags take a filename. Whether you specify a relative path or an absolute path, if the fully-qualified filename exceeds `MAX_PATH` (260 characters), the linker may fail--particularly while searching for libraries. If you encounter this problem, try using a shorter path.
-## LINK Command Files
+The linker returns zero for success (no errors). Otherwise, it returns the error number that stopped the link. For example, if the linker generates `LNK1104`, the linker returns 1104. Accordingly, the lowest error number returned on an error by the linker is 1000. A return value of 128 represents a configuration problem with either the operating system or a .config file; the loader didn't load either `link.exe` or `c2.dll`.
-You can pass command-line arguments to LINK in the form of a command file. To specify a command file to the linker, use the following syntax:
+## Linker command files
-> **LINK \@**commandfile
+You can pass command-line arguments to `link.exe` in the form of a command file. To specify a command file to the linker, use the following syntax:
-The *commandfile* is the name of a text file. No space or tab is allowed between the at sign (**\@**) and the filename. There is no default extension; you must specify the full filename, including any extension. Wildcards cannot be used. You can specify an absolute or relative path with the filename. LINK does not use an environment variable to search for the file.
+> `link @commandfile`
-In the command file, arguments can be separated by spaces or tabs (as on the command line) and by newline characters.
+The *`commandfile`* is the name of a text file. No space or tab is allowed between the at sign (**\@**) and the filename. There's no default extension; you must specify the full filename, including any extension. Wildcards can't be used. You can specify an absolute or relative path with the filename. Must not exceed `MAX_PATH` (260 characters). The linker doesn't use an environment variable to search for the file.
-You can specify all or part of the command line in a command file. You can use more than one command file in a LINK command. LINK accepts the command-file input as if it were specified in that location on the command line. Command files cannot be nested. LINK echoes the contents of command files, unless the [/NOLOGO](nologo-suppress-startup-banner-linker.md) option is specified.
+In the command file, arguments are separated by spaces or tabs (as on the command line) and by newline characters.
+
+You can specify all or part of the command line in a command file. You can use more than one command file in a `link.exe` command. The linker accepts the command-file input as if it was specified in that location on the command line. Command files can't be nested. The linker echoes the contents of command files, unless [`/NOLOGO`](nologo-suppress-startup-banner-linker.md) is specified.
## Example
-The following command to build a DLL passes the names of object files and libraries in separate command files and uses a third command file for specification of the /EXPORTS option:
+The following command builds a DLL. It passes the names of object files and libraries in separate command files and uses a third command file for specification of the `/EXPORTS` option:
```cmd
link /dll @objlist.txt @liblist.txt @exports.txt
```
-## LINK Environment Variables
-
-The LINK tool uses the following environment variables:
-
-- LINK and \_LINK\_, if defined. The LINK tool prepends the options and arguments defined in the LINK environment variable and appends the options and arguments defined in the \_LINK\_ environment variable to the command line arguments before processing.
-
-- LIB, if defined. The LINK tools uses the LIB path when searching for an object, library, or other file specified on the command line or by the [/BASE](base-base-address.md) option. It also uses the LIB path to find a .pdb file named in an object. The LIB variable can contain one or more path specifications, separated by semicolons. One path must point to the \lib subdirectory of your Visual C++ installation.
+## LINK environment variables
-- PATH, if the tool needs to run CVTRES and cannot find the file in the same directory as LINK itself. (LINK requires CVTRES to link a .res file.) PATH must point to the \bin subdirectory of your Visual C++ installation.
+The linker recognizes the following environment variables:
-- TMP, to specify a directory when linking OMF or .res files.
+- `LINK` and `_LINK_`, if defined. The linker prepends the options and arguments defined in the `LINK` environment variable and appends the options and arguments defined in the `_LINK_` environment variable to the command line arguments before processing.
+- `LIB`, if defined. The linker uses the `LIB` path when it searches for an object, library, or other file specified on the command line or by the [`/BASE`](base-base-address.md) option. It also uses the `LIB` path to find a `.pdb` file named in an object. The `LIB` variable can contain one or more path specifications, separated by semicolons. One path must point to the `\lib` subdirectory of your Visual C++ installation.
+- `PATH`, if the tool needs to run `CVTRES` and can't find the file in the same directory as `link.exe` itself. (`link.exe` requires `CVTRES` to link a `.res` file.) `PATH` must point to the `\bin` subdirectory of your Visual C++ installation.
+- `TMP`, to specify a directory when linking OMF or `.res` files.
## See also
-[C/C++ Building Reference](c-cpp-building-reference.md)
-[MSVC Linker Options](linker-options.md)
-[Module-Definition (.def) Files](module-definition-dot-def-files.md)
+[C/C++ Building Reference](c-cpp-building-reference.md)\
+[MSVC Linker Options](linker-options.md)\
+[Module-Definition (.def) Files](module-definition-dot-def-files.md)\
[Linker Support for Delay-Loaded DLLs](linker-support-for-delay-loaded-dlls.md)
diff --git a/docs/build/reference/linkrepro.md b/docs/build/reference/linkrepro.md
index 9d00525a14..a106200fdc 100644
--- a/docs/build/reference/linkrepro.md
+++ b/docs/build/reference/linkrepro.md
@@ -1,7 +1,7 @@
---
title: "/LINKREPRO (Link repro directory name)"
description: Linker or library tool option to set the directory for a link repro.
-ms.date: "09/24/2019"
+ms.date: 03/28/2025
f1_keywords: ["/LINKREPRO"]
helpviewer_keywords: ["LINKREPRO linker option", "/LINKREPRO linker option", "-LINKREPRO linker option", "linker repro reporting"]
---
@@ -11,12 +11,12 @@ Tells the linker or library tool to generate a link repro in a specified directo
## Syntax
-> **/LINKREPRO:**_directory-name_
+> `/LINKREPRO:` **_directory-name_**
### Arguments
-**/LINKREPRO:**_directory-name_\
-The user-specified directory to store the link repro in. Directory names that include spaces must be enclosed in double quotes.
+**_directory-name_**\
+The user-specified directory to store the link repro in. Directory names that include spaces must be enclosed in double quotes. When expanded, the fully qualified link repro filename must not exceed `MAX_PATH` (260 characters).
## Remarks
diff --git a/docs/build/reference/ltcg-link-time-code-generation.md b/docs/build/reference/ltcg-link-time-code-generation.md
index e38ae4810e..1a22070855 100644
--- a/docs/build/reference/ltcg-link-time-code-generation.md
+++ b/docs/build/reference/ltcg-link-time-code-generation.md
@@ -1,8 +1,8 @@
---
title: "/LTCG (Link-time code generation)"
description: "The MSVC linker option /LTCG enables link-time code generation for whole-program optimization."
-ms.date: 07/08/2020
-f1_keywords: ["VC.Project.VCLinkerTool.LinkTimeCodeGeneration", "VC.Project.VCCLWCECompilerTool.WholeProgramOptimization", "/ltcg", "VC.Project.VCCLCompilerTool.WholeProgramOptimization"]
+ms.date: 09/08/2022
+f1_keywords: ["VC.Project.VCLinkerTool.LinkTimeCodeGeneration", "VC.Project.VCCLWCECompilerTool.WholeProgramOptimization", "/ltcg", "VC.Project.VCCLCompilerTool.WholeProgramOptimization", "VC.Project.VCLinkerTool.LinkStatus"]
helpviewer_keywords: ["link-time code generation in C++ linker", "/LTCG linker option", "-LTCG linker option", "LTCG linker option"]
ms.assetid: 788c6f52-fdb8-40c2-90af-4026ea2cf2e2
---
@@ -12,22 +12,22 @@ Use **`/LTCG`** to perform whole-program optimization, or to create profile-guid
## Syntax
-> **`/LTCG`**[**`:`**{**`INCREMENTAL`**|**`NOSTATUS`**|**`STATUS`**|**`OFF`**}]
+> **`/LTCG`**[**`:`**{**`INCREMENTAL`**\|**`NOSTATUS`**\|**`STATUS`**\|**`OFF`**}]
These options are deprecated starting in Visual Studio 2015:
-> **`/LTCG:`**{**`PGINSTRUMENT`**|**`PGOPTIMIZE`**|**`PGUPDATE`**}
+> **`/LTCG:`**{**`PGINSTRUMENT`**\|**`PGOPTIMIZE`**\|**`PGUPDATE`**}
### Arguments
**`INCREMENTAL`**
(Optional) Specifies that the linker only applies whole program optimization or link-time code generation (LTCG) to files affected by an edit, instead of the entire project. By default, this flag isn't set when **`/LTCG`** is specified, and the entire project is linked by using whole program optimization.
-**`NOSTATUS`** | **`STATUS`**
+**`NOSTATUS`** \| **`STATUS`**
(Optional) Specifies whether the linker displays a progress indicator that shows what percentage of the link is complete. By default, this status information isn't displayed.
**`OFF`**
-(Optional) Disables link-time code generation. This behavior is the same as when **`/LTCG`** isn't specified on the command line.
+(Optional) Disables link-time code generation. The linker treats all modules compiled with **`/GL`** as if they're compiled without that option, and any MSIL modules cause the link to fail.
**`PGINSTRUMENT`**
(Optional) This option is deprecated starting in Visual Studio 2015. Instead, use **`/LTCG`** and [`/GENPROFILE` or `/FASTGENPROFILE`](genprofile-fastgenprofile-generate-profiling-instrumented-build.md) to generate an instrumented build for profile-guided optimization. The data that is collected from instrumented runs is used to create an optimized image. For more information, see [Profile-Guided Optimizations](../profile-guided-optimizations.md). The short form of this option is **`/LTCG:PGI`**.
@@ -76,7 +76,7 @@ The rest of this article discusses the link-time code generation done by **`/LTC
The linker invokes link-time code generation if it's passed a module that was compiled by using **`/GL`** or an MSIL module (see [`.netmodule` Files as Linker Input](netmodule-files-as-linker-input.md)). If you don't explicitly specify **`/LTCG`** when you pass **`/GL`** or MSIL modules to the linker, the linker eventually detects this situation and restarts the link by using **`/LTCG`**. Explicitly specify **`/LTCG`** when you pass **`/GL`** and MSIL modules to the linker for the fastest possible build performance.
-For even faster performance, use **`/LTCG:INCREMENTAL`**. This option tells the linker to reoptimize only the files affected by a source file change, instead of the entire project. This option can significantly reduce the link time required. This option isn't the same option as [incremental linking](incremental-link-incrementally.md).
+For even faster performance, use **`/LTCG:INCREMENTAL`**. This option tells the linker to reoptimize only the files affected by a source file change, instead of the entire project. This option can significantly reduce the link time required. This option isn't the same option as [incremental linking](incremental-link-incrementally.md). If you remove the **`/LTCG:INCREMENTAL`** option, also remove any [`/LTCGOUT`](./ltcgout.md) option to improve build times and disk utilization.
**`/LTCG`** isn't valid for use with [`/INCREMENTAL`](incremental-link-incrementally.md).
@@ -101,7 +101,7 @@ Using **`/LTCG`** and **`/O2`** causes double-alignment optimization.
If **`/LTCG`** and **`/O1`** are specified, double alignment isn't performed. If most of the functions in an application are compiled for speed, with a few functions compiled for size (for example, by using the [`optimize`](../../preprocessor/optimize.md) pragma), the compiler double-aligns the functions that are optimized for size if they call functions that require double alignment.
-If the compiler can identify all of the call sites of a function, the compiler ignores explicit calling-convention modifiers on a function and tries to optimize the function's calling convention:
+If the compiler can identify all of the call sites of a function, the compiler ignores explicit calling-convention modifiers, and tries to optimize the function's calling convention:
- pass parameters in registers
@@ -124,14 +124,40 @@ Modules that are compiled by using [`/GL`](gl-whole-program-optimization.md) and
### To set this compiler option in the Visual Studio development environment
-1. Open the project **Property Pages** dialog box. See [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+The Whole Program Optimization property sets several compiler and linker options, including **`/LTCG`**. We recommend you use this property to change the settings for an entire build configuration. To set Whole Program Optimization for your project:
+
+1. Open the project **Property Pages** dialog box. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
1. Select the **Configuration Properties** > **General** property page.
-1. Modify the **Whole Program Optimization** property.
+1. Modify the **Whole Program Optimization** property. Choose **OK** or **Apply** to save your changes.
You can also apply **`/LTCG`** to specific builds by choosing **Build** > **Profile Guided Optimization** on the menu bar, or by choosing one of the Profile Guided Optimization options on the shortcut menu for the project.
+To enable Link Time Code Generation separately or set a specific Link Time Code Generation option:
+
+1. Open the project **Property Pages** dialog box.
+
+1. Select the **Configuration Properties** > **Linker** > **Optimization** property page.
+
+1. Modify the **Link Time Code Generation** property to one of the following options:
+ - **Default**
+ - **Use Fast Link Time Code Generation (LTCG:incremental)**
+ - **Use Link Time Code Generation (LTCG)**
+ - **Profile Guided Optimization - Instrument (LTCG:PGInstrument)**
+ - **Profile Guided Optimization - Optimization (LTCG:PGOptimize)**
+ - **Profile Guided Optimization - Update (LTCG:PGUpdate)**
+
+1. Choose **OK** or **Apply** to save your changes.
+
+To specify whether the linker displays a progress indicator for Link Time Code Generation:
+
+1. Open the project **Property Pages** dialog box.
+
+1. Select the **Configuration Properties** > **Linker** > **General** property page.
+
+1. Modify the **Link Status** property. Choose **OK** or **Apply** to save your changes.
+
### To set this compiler option programmatically
- See .
diff --git a/docs/build/reference/ltcgout.md b/docs/build/reference/ltcgout.md
new file mode 100644
index 0000000000..6a02243c24
--- /dev/null
+++ b/docs/build/reference/ltcgout.md
@@ -0,0 +1,40 @@
+---
+title: "/LTCGOUT (Name LTCG incremental object file)"
+description: "The MSVC linker option /LTCGOUT names the incremental link-time code generation object file."
+ms.date: 08/31/2022
+f1_keywords: ["VC.Project.VCLinkerTool.LinkTimeCodeGenerationObjectFile", "/ltcgout", "ltcgout"]
+helpviewer_keywords: ["Name link-time code generation file in C++ linker", "/LTCGOUT linker option", "-LTCGOUT linker option", "LTCGOUT linker option"]
+---
+# `/LTCGOUT` (Name LTCG incremental object file)
+
+The **`/LTCGOUT`** linker option tells the linker where to put the intermediate *`.iobj`* object file for incremental link-time code generation (**`/LTCG:INCREMENTAL`**).
+
+## Syntax
+
+> **`/LTCGOUT:`**\[*`pathname`*]
+
+### Arguments
+
+*`pathname`*\
+The optional destination directory and filename for the generated *`.iobj`* file. If the **`/LTCGOUT`** option isn't specified when **`/LTCG:INCREMENTAL`** is used, the filename is created by appending *`.iobj`* to the target base filename. If the **`/LTCGOUT`** option is specified with an empty *`pathname`* when **`/LTCG:INCREMENTAL`** isn't used, no *`.iobj`* file is generated.
+
+## Remarks
+
+The **`/LTCGOUT`** linker option tells the linker the path and filename to use for the intermediate *`.iobj`* object file when you specify [`/LTCG:INCREMENTAL`](./ltcg-link-time-code-generation.md). If you remove the **`/LTCG:INCREMENTAL`** option from your project, you should also remove any **`/LTCGOUT`** option.
+
+### To set this compiler option in the Visual Studio development environment
+
+1. Open the project **Property Pages** dialog box. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
+
+1. Select the **Configuration Properties** > **Linker** > **Optimization** property page.
+
+1. Modify the **Link Time Code Generation Object File** property. The option isn't set if this property is empty.
+
+### To set this compiler option programmatically
+
+- See .
+
+## See also
+
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/machine-specify-target-platform.md b/docs/build/reference/machine-specify-target-platform.md
index f5cf171020..203ac3a325 100644
--- a/docs/build/reference/machine-specify-target-platform.md
+++ b/docs/build/reference/machine-specify-target-platform.md
@@ -1,22 +1,20 @@
---
description: "Learn more about: /MACHINE (Specify Target Platform)"
title: "/MACHINE (Specify Target Platform)"
-ms.date: "11/04/2016"
+ms.date: 03/25/2022
f1_keywords: ["VC.Project.VCLinkerTool.TargetMachine", "/machine"]
helpviewer_keywords: ["mapfiles, creating linker", "target platform", "-MACHINE linker option", "/MACHINE linker option", "MACHINE linker option"]
ms.assetid: 8d41bf4b-7e53-4ab9-9085-d852b08d31c2
---
# /MACHINE (Specify Target Platform)
-```
-/MACHINE:{ARM|EBC|X64|X86}
-```
+> **`/MACHINE:`**{**`ARM`**|**`ARM64`**|**`ARM64EC`**|**`EBC`**|**`X64`**|**`X86`**}
## Remarks
-The /MACHINE option specifies the target platform for the program.
+The **`/MACHINE`** option specifies the target platform for the program.
-Usually, you don't have to specify the /MACHINE option. LINK infers the machine type from the .obj files. However, in some circumstances, LINK cannot determine the machine type and issues a [linker tools error LNK1113](../../error-messages/tool-errors/linker-tools-error-lnk1113.md). If such an error occurs, specify /MACHINE.
+Usually, you don't have to specify the **`/MACHINE`** option. LINK infers the machine type from the *`.obj`* files. However, in some circumstances, LINK cannot determine the machine type and issues a [linker tools error LNK1113](../../error-messages/tool-errors/linker-tools-error-lnk1113.md). If such an error occurs, specify **`/MACHINE`**.
### To set this linker option in the Visual Studio development environment
@@ -32,5 +30,5 @@ Usually, you don't have to specify the /MACHINE option. LINK infers the machine
## See also
-[MSVC linker reference](linking.md)
+[MSVC linker reference](linking.md)\
[MSVC Linker Options](linker-options.md)
diff --git a/docs/build/reference/makefile-preprocessing.md b/docs/build/reference/makefile-preprocessing.md
index f8ff9993a7..7092de7a26 100644
--- a/docs/build/reference/makefile-preprocessing.md
+++ b/docs/build/reference/makefile-preprocessing.md
@@ -1,6 +1,6 @@
---
-description: "Learn more about: Makefile Preprocessing"
title: "Makefile preprocessing"
+description: "Learn more about: Makefile Preprocessing"
ms.date: 09/30/2021
f1_keywords: ["!UNDEF", "!INCLUDE", "!IFNDEF", "!MESSAGE"]
helpviewer_keywords: ["preprocessing makefiles", "makefiles, preprocessing", "!CMDSWITCHES directive", "!ELSE directive", "!ELSEIF directive", "!ELSEIFDEF directive", "!ELSEIFNDEF directive", "!ENDIF directive", "!ERROR directive", "!IF directive", "!IFDEF directive", "!IFNDEF directive", "!INCLUDE directive", "!MESSAGE directive", "!UNDEF directive", "directives, makefile preprocessing", "preprocessing directives, makefiles", "NMAKE program, expressions", "NMAKE program, preprocessor directives", "makefiles, preprocessing directives", "expressions [C++], makefile preprocessing", "operators [C++], makefile preprocessing", "EXIST operator", "preprocessing NMAKE makefile operators", "NMAKE program, operators", "DEFINED operator", "makefiles, preprocessing operators"]
@@ -9,11 +9,11 @@ helpviewer_keywords: ["preprocessing makefiles", "makefiles, preprocessing", "!C
You can control the NMAKE session by using preprocessing directives and expressions. Preprocessing instructions can be placed in the makefile or in *`Tools.ini`*. Using directives, you can conditionally process your makefile, display error messages, include other makefiles, undefine a macro, and turn certain options on or off.
-## Makefile Preprocessing Directives
+## Makefile Preprocessing Directives
Preprocessing directives aren't case-sensitive. The initial exclamation point (**`!`**) must appear at the beginning of the line. Zero or more spaces or tabs can appear after the exclamation point, for indentation.
-- **`!CMDSWITCHES`** { **`+`**_option_ | **`-`**_option_ } ...
+- **`!CMDSWITCHES`** { **`+`**_option_ \| **`-`**_option_ } ...
Turns each listed *option* on or off. Spaces or tabs must appear before the **`+`** or **`-`** operator. No spaces can appear between the operator and the [option letters](running-nmake.md#nmake-options). Letters aren't case-sensitive and are specified without a slash (`/`). To turn on some options and turn off others, use separate specifications of **`!CMDSWITCHES`**.
@@ -43,7 +43,7 @@ Preprocessing directives aren't case-sensitive. The initial exclamation point (*
Processes statements between **`!IFNDEF`** and the next **`!ELSE`** or **`!ENDIF`** if *macro_name* isn't defined.
-- **`!ELSE`** [ **`IF`** *constant_expression* | **`IFDEF`** *macro_name* | **`IFNDEF`** *macro_name* ]
+- **`!ELSE`** [ **`IF`** *constant_expression* \| **`IFDEF`** *macro_name* \| **`IFNDEF`** *macro_name* ]
Processes statements between **`!ELSE`** and the next **`!ENDIF`** if the prior **`!IF`**, **`!IFDEF`**, or **`!IFNDEF`** statement evaluated to zero. The optional keywords give further control of preprocessing.
@@ -67,13 +67,13 @@ Preprocessing directives aren't case-sensitive. The initial exclamation point (*
Undefines *macro_name*.
-## Expressions in makefile preprocessing
+## Expressions in makefile preprocessing
The **`!IF`** or **`!ELSE IF`** *constant_expression* consists of integer constants (in decimal or C-language notation), string constants, or commands. Use parentheses to group expressions. Expressions use C-style signed long integer arithmetic; numbers are in 32-bit two's-complement form in the range -2147483648 to 2147483647.
Expressions can use operators that act on constant values, exit codes from commands, strings, macros, and file-system paths.
-## Makefile preprocessing operators
+## Makefile preprocessing operators
Makefile preprocessing expressions can use operators that act on constant values, exit codes from commands, strings, macros, and file-system paths. To evaluate the expression, the preprocessor first expands macros, and then executes commands, and then does the operations. It evaluates operations in order of explicit grouping in parentheses, and then in order of operator precedence. The result is a constant value.
@@ -96,7 +96,7 @@ Expressions can use the following operators. The operators of equal precedence a
| **`~`** | Unary one's complement. |
| **`-`** | Unary negation. |
| | |
-| **`*`*** | Multiplication. |
+| **`*`** | Multiplication. |
| **`/`** | Division. |
| **`%`** | Modulus (remainder). |
| | |
@@ -120,12 +120,12 @@ Expressions can use the following operators. The operators of equal precedence a
| | |
| **`&&`** | Logical AND. |
| | |
-| **` | | `** | Logical OR. |
+| **` || `** | Logical OR. |
> [!NOTE]
> The bitwise XOR operator (**`^`**) is the same as the escape character, and must be escaped (as **`^^`**) when it's used in an expression.
-## Executing a program in preprocessing
+## Executing a program in preprocessing
To use a command's exit code during preprocessing, specify the command, with any arguments, within brackets (**`[ ]`**). Any macros are expanded before the command is executed. NMAKE replaces the command specification with the command's exit code, which can be used in an expression to control preprocessing.
diff --git a/docs/build/reference/managing-a-library.md b/docs/build/reference/managing-a-library.md
index 12b8cb236a..5ea56fcb14 100644
--- a/docs/build/reference/managing-a-library.md
+++ b/docs/build/reference/managing-a-library.md
@@ -1,49 +1,47 @@
---
description: "Learn more about: Managing a Library"
title: "Managing a Library"
-ms.date: "11/04/2016"
+ms.date: 03/02/2022
f1_keywords: ["VC.Project.VCLibrarianTool.OVERWRITEAllDefaultLibraries", "VC.Project.VCLibrarianTool.AdditionalDependencies", "VC.Project.VCLibrarianTool.RemoveObjects", "VC.Project.VCLibrarianTool.LibraryPaths", "VC.Project.VCLibrarianTool.OutputFile", "VC.Project.VCLibrarianTool.OVERWRITEDefaultLibraryNames", "VC.Project.VCLibrarianTool.AdditionalLibraryDirectories", "VC.Project.VCLibrarianTool.ListContentsFile", "VC.Project.VCLibrarianTool.ListContents", "VC.Project.VCLibrarianTool.SubSystemVersion", "VC.Project.VCLibrarianTool.OVERWRITEDefaultLibraryName", "VC.Project.VCLibrarianTool.SubSystem"]
helpviewer_keywords: ["/LIBPATH library manager option", "OUT library manager option", "CONVERT library manager option", "LIBPATH library manager option", "/LIST library manager option", "object files, building and modifying", "-LINK50COMPAT library manager option", "REMOVE library manager option", "SUBSYSTEM library manager option", "/LINK50COMPAT library manager option", "/OUT library manager option", "LIB [C++], managing COFF libraries", "-CONVERT library manager option", "LINK50COMPAT library manager option", "-OUT library manager option", "-REMOVE library manager option", "-LIST library manager option", "/SUBSYSTEM library manager option", "-SUBSYSTEM library manager option", "/REMOVE library manager option", "-LIBPATH library manager option", "object files", "LIST library manager option", "/CONVERT library manager option"]
ms.assetid: f56a8b85-fbdc-4c09-8d8e-00f0ffe1da53
---
# Managing a Library
-The default mode for LIB is to build or modify a library of COFF objects. LIB runs in this mode when you do not specify /EXTRACT (to copy an object to a file) or /DEF (to build an import library).
+The default mode for LIB is to build or modify a library of COFF objects. LIB runs in this mode when you don't specify **`/EXTRACT`** (to copy an object to a file) or **`/DEF`** (to build an import library).
To build a library from objects and/or libraries, use the following syntax:
-```
-LIB [options...] files...
-```
+> **`LIB`** [*`options...`*] *`files...`*
-This command creates a library from one or more input *files*. The *files* can be COFF object files, 32-bit OMF object files, or existing COFF libraries. LIB creates one library that contains all objects in the specified files. If an input file is a 32-bit OMF object file, LIB converts it to COFF before building the library. LIB cannot accept a 32-bit OMF object that is in a library created by the 16-bit version of LIB. You must first use the 16-bit LIB to extract the object; then you can use the extracted object file as input to the 32-bit LIB.
+This command creates a library from one or more input files, *`files`*. The *`files`* can be COFF object files, 32-bit OMF object files, or existing COFF libraries. LIB creates one library that contains all objects in the specified files. If an input file is a 32-bit OMF object file, LIB converts it to COFF before building the library. LIB can't accept a 32-bit OMF object that's in a library created by the 16-bit version of LIB. You must first use the 16-bit LIB to extract the object; then you can use the extracted object file as input to the 32-bit LIB.
-By default, LIB names the output file using the base name of the first object or library file and the extension .lib. The output file is put in the current directory. If a file already exists with the same name, the output file replaces the existing file. To preserve an existing library, use the /OUT option to specify a name for the output file.
+By default, LIB names the output file using the base name of the first object or library file and the extension *`.lib`*. The output file is put in the current directory. If a file already exists with the same name, the output file replaces the existing file. To preserve an existing library, use the **`/OUT`** option to specify a name for the output file.
The following options apply to building and modifying a library:
-**/LIBPATH:** *dir*
-Overrides the environment library path. For details, see the description of the LINK [/LIBPATH](libpath-additional-libpath.md) option.
+**`/LIBPATH:`** *`dir`*\
+Overrides the environment library path and sets it to *`dir`*. For details, see the description of the LINK [`/LIBPATH`](libpath-additional-libpath.md) option.
-**/LIST**
-Displays information about the output library to standard output. The output can be redirected to a file. You can use /LIST to determine the contents of an existing library without modifying it.
+**`/LIST`**\
+Displays information about the output library to standard output. The output can be redirected to a file. You can use **`/LIST`** to determine the contents of an existing library without modifying it.
-**/NAME:** *filename*
-When building an import library, specifies the name of the DLL for which the import library is being built.
+**`/NAME:`** *`filename`*\
+When building an import library, *`filename`* specifies the name of the DLL for which the import library is being built.
-**/NODEFAULTLIB**
-Removes one or more default libraries from the list of libraries it searches when resolving external references. See [/NODEFAULTLIB](nodefaultlib-ignore-libraries.md) for more information.
+**`/NODEFAULTLIB`**\
+Removes one or more default libraries from the list of libraries it searches when resolving external references. For more information, see [`/NODEFAULTLIB`](nodefaultlib-ignore-libraries.md).
-**/OUT:** *filename*
-Overrides the default output filename. By default, the output library is created in the current directory, with the base name of the first library or object file on the command line and the extension .lib.
+**`/OUT:`** *`filename`*\
+Overrides the default output filename and replaces it with *`filename`*. By default, the output library is created in the current directory, with the base name of the first library or object file on the command line and the extension *`.lib`*.
-**/REMOVE:** *object*
-Omits the specified *object* from the output library. LIB creates an output library by combining all objects (whether in object files or libraries), and then deleting any objects specified with /REMOVE.
+**`/REMOVE:`** *`object`*\
+Omits the specified *`object`* from the output library. LIB creates an output library by combining all objects (whether in object files or libraries), and then deleting any objects specified with **`/REMOVE`**.
-**/SUBSYSTEM:**{**CONSOLE** | **EFI_APPLICATION** | **EFI_BOOT_SERVICE_DRIVER** | **EFI_ROM** | **EFI_RUNTIME_DRIVER** | **NATIVE** | **POSIX** | **WINDOWS** | **WINDOWSCE**}[,#[.##]]
-Tells the operating system how to run a program created by linking to the output library. For more information, see the description of the LINK [/SUBSYSTEM](subsystem-specify-subsystem.md) option.
+**`/SUBSYSTEM:`**{**`CONSOLE`** \| **`EFI_APPLICATION`** \| **`EFI_BOOT_SERVICE_DRIVER`** \| **`EFI_ROM`** \| **`EFI_RUNTIME_DRIVER`** \| **`NATIVE`** \| **`POSIX`** \| **`WINDOWS`** \| **`WINDOWSCE`**}[,#[.##]]\
+Tells the operating system how to run a program created by linking to the output library. For more information, see the description of the LINK [`/SUBSYSTEM`](subsystem-specify-subsystem.md) option.
-LIB options specified on the command line are not case sensitive.
+LIB options specified on the command line aren't case sensitive.
You can use LIB to perform the following library-management tasks:
@@ -56,7 +54,7 @@ You can use LIB to perform the following library-management tasks:
- To delete a member from a library, use the /REMOVE option. LIB processes any specifications of /REMOVE after combining all input objects, regardless of command-line order.
> [!NOTE]
-> You cannot both delete a member and extract it to a file in the same step. You must first extract the member object using /EXTRACT, then run LIB again using /REMOVE. This behavior differs from that of the 16-bit LIB (for OMF libraries) provided in other Microsoft products.
+> You can't both delete a member and extract it to a file in the same step. You must first extract the member object using **`/EXTRACT`**, then run LIB again using **`/REMOVE`**. This behavior differs from that of the 16-bit LIB (for OMF libraries) provided in other Microsoft products.
## See also
diff --git a/docs/build/reference/manifest-create-side-by-side-assembly-manifest.md b/docs/build/reference/manifest-create-side-by-side-assembly-manifest.md
index 6b8a9ce9ea..0cfe26b687 100644
--- a/docs/build/reference/manifest-create-side-by-side-assembly-manifest.md
+++ b/docs/build/reference/manifest-create-side-by-side-assembly-manifest.md
@@ -1,44 +1,46 @@
---
-description: "Learn more about: /MANIFEST (Create Side-by-Side Assembly Manifest)"
-title: "/MANIFEST (Create Side-by-Side Assembly Manifest)"
+description: "Learn more about: /MANIFEST (Create side-by-side assembly manifest)"
+title: "/MANIFEST (Create side-by-side assembly manifest)"
ms.date: "11/04/2016"
-f1_keywords: ["VC.Project.VCLinkerTool.GenerateManifest"]
+f1_keywords: ["VC.Project.VCLinkerTool.GenerateManifest", "VC.Project.VCLinkerTool.ManifestEmbed"]
helpviewer_keywords: ["-MANIFEST linker option", "/MANIFEST linker option", "MANIFEST linker option"]
ms.assetid: 98c52e1e-712c-4f49-b149-4d0a3501b600
---
-# /MANIFEST (Create Side-by-Side Assembly Manifest)
+# `/MANIFEST` (Create side-by-side assembly manifest)
-```
-/MANIFEST[:{EMBED[,ID=#]|NO}]
-```
+Specifies whether the linker should create a side-by-side manifest file.
+
+## Syntax
+
+> **`/MANIFEST`**\[**`:`**{**`EMBED`**\[**`,ID=`***`resource_id`*]\|**`NO`**}]
## Remarks
-/MANIFEST specifies that the linker should create a side-by-side manifest file. For more information about manifest files, see [Manifest Files Reference](/windows/win32/SbsCs/manifest-files-reference).
+The **`/MANIFEST`** linker option tells the linker to create a side-by-side manifest file. For more information about manifest files, see [Manifest files reference](/windows/win32/SbsCs/manifest-files-reference).
-The default is /MANIFEST.
+The default is **`/MANIFEST`**.
-The /MANIFEST:EMBED option specifies that the linker should embed the manifest file in the image as a resource of type RT_MANIFEST. The optional `ID` parameter is the resource ID to use for the manifest. Use a value of 1 for an executable file. Use a value of 2 for a DLL to enable it to specify private dependencies. If the `ID` parameter is not specified, the default value is 2 if the /DLL option is set; otherwise, the default value is 1.
+The **`/MANIFEST:EMBED`** option specifies that the linker should embed the manifest file in the image as a resource of type `RT_MANIFEST`. The optional `ID` parameter sets the resource ID to use for the manifest. Use a *`resource_id`* value of 1 for an executable file. Use a value of 2 for a DLL to enable it to specify private dependencies. If the `ID` parameter isn't specified, the default value is 2 if the **`/DLL`** option is set; otherwise, the default value is 1.
-Beginning with Visual Studio 2008, manifest files for executables contain a section that specifies User Account Control (UAC) information. If you specify /MANIFEST but specify neither [/MANIFESTUAC](manifestuac-embeds-uac-information-in-manifest.md) nor [/DLL](dll-build-a-dll.md), a default UAC fragment that has the UAC level set to *asInvoker* is inserted into the manifest. For more information about UAC levels, see [/MANIFESTUAC (Embeds UAC information in manifest)](manifestuac-embeds-uac-information-in-manifest.md).
+Beginning with Visual Studio 2008, manifest files for executables contain a section that specifies User Account Control (UAC) information. If you specify **`/MANIFEST`** but don't specify either [`/MANIFESTUAC`](manifestuac-embeds-uac-information-in-manifest.md) or [`/DLL`](dll-build-a-dll.md), a default UAC fragment that has the UAC level set to *`asInvoker`* is inserted into the manifest. For more information about UAC levels, see [`/MANIFESTUAC` (Embeds UAC information in manifest)](manifestuac-embeds-uac-information-in-manifest.md).
-To change the default behavior for UAC, do one of these:
+To change the default behavior for UAC, set one of these options:
-- Specify the /MANIFESTUAC option and set the UAC level to the desired value.
+- Specify the **`/MANIFESTUAC`** option and set the UAC level to the desired value.
-- Or specify the /MANIFESTUAC:NO option if you do not want to generate a UAC fragment in the manifest.
+- Or, specify the **`/MANIFESTUAC:NO`** option if you don't want to generate a UAC fragment in the manifest.
-If you do not specify /MANIFEST but do specify [/MANIFESTDEPENDENCY](manifestdependency-specify-manifest-dependencies.md) comments, a manifest file is created. A manifest file is not created if you specify /MANIFEST:NO.
+If you don't specify **`/MANIFEST`** but do specify [`/MANIFESTDEPENDENCY`](manifestdependency-specify-manifest-dependencies.md) attributes, a manifest file is created. A manifest file isn't created if you specify **`/MANIFEST:NO`**.
-If you specify /MANIFEST, the name of the manifest file is the same as the name of your output file, but with .manifest appended to the file name. For example, if your output file name is MyFile.exe, the manifest file name is MyFile.exe.manifest. If you specify /MANIFESTFILE:*name*, the name of the manifest is what you specify in *name*.
+If you specify **`/MANIFEST`**, the name of the manifest file is the same as the full name of your output file, but with *`.manifest`* appended to the file name. For example, if your output file name is *`MyFile.exe`*, the manifest file name is *`MyFile.exe.manifest`*. If you specify **`/MANIFESTFILE:`***`name`*, the name of the manifest is what you specify in *`name`*.
### To set this linker option in the Visual Studio development environment
-1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
+1. Open the project's **Property Pages** dialog box. For more information, see [Set compiler and build properties](../working-with-project-properties.md).
1. Select the **Configuration Properties** > **Linker** > **Manifest File** property page.
-1. Modify the **Generate Manifest** property.
+1. Modify the **Generate Manifest** property. Choose **OK** or **Apply** to save your changes.
### To set this linker option programmatically
@@ -46,5 +48,9 @@ If you specify /MANIFEST, the name of the manifest file is the same as the name
## See also
-[MSVC linker reference](linking.md)
-[MSVC Linker Options](linker-options.md)
+[Manifest files reference](/windows/win32/SbsCs/manifest-files-reference)\
+[`/MANIFESTDEPENDENCY` (Specify manifest dependencies)](./manifestdependency-specify-manifest-dependencies.md)\
+[`/MANIFESTFILE` (Name manifest file)](./manifestfile-name-manifest-file.md)\
+[`/MANIFESTUAC` (Embeds UAC information in manifest)](./manifestuac-embeds-uac-information-in-manifest.md)\
+[MSVC linker reference](linking.md)\
+[MSVC linker options](linker-options.md)
diff --git a/docs/build/reference/manifest-tool-property-pages.md b/docs/build/reference/manifest-tool-property-pages.md
index 144a37acfb..cdf705d3d8 100644
--- a/docs/build/reference/manifest-tool-property-pages.md
+++ b/docs/build/reference/manifest-tool-property-pages.md
@@ -22,7 +22,6 @@ f1_keywords:
- VC.Project.VCManifestTool.ReplacementsFile
- VC.Project.VCManifestTool.UpdateFileHashes
- VC.Project.VCManifestTool.UpdateFileHashesSearchPath
- - vc.project.AdditionalOptionsPage
---
# Manifest Tool Property Pages
diff --git a/docs/build/reference/manifestfile-name-manifest-file.md b/docs/build/reference/manifestfile-name-manifest-file.md
index acd17845b9..32a06f368e 100644
--- a/docs/build/reference/manifestfile-name-manifest-file.md
+++ b/docs/build/reference/manifestfile-name-manifest-file.md
@@ -4,26 +4,28 @@ title: "/MANIFESTFILE (Name Manifest File)"
ms.date: "11/04/2016"
f1_keywords: ["VC.Project.VCLinkerTool.ManifestFile"]
helpviewer_keywords: ["MANIFESTFILE linker option", "-MANIFESTFILE linker option", "/MANIFESTFILE linker option"]
-ms.assetid: befa5ab2-a9cf-4c9b-969a-e7b4a930f08d
---
# /MANIFESTFILE (Name Manifest File)
-```
-/MANIFESTFILE:filename
-```
+Change the default name of the manifest file.
-## Remarks
+## Syntax
+
+> `/MANIFESTFILE:`**filename**
-/MANIFESTFILE lets you change the default name of the manifest file. The default name of the manifest file is the file name with .manifest appended.
+## Arguments
-/MANIFESTFILE will have no effect if you do not also link with [/MANIFEST](manifest-create-side-by-side-assembly-manifest.md).
+**filename**\
+The default name of the manifest file is *filename* with `.manifest` appended.
+
+## Remarks
+
+`/MANIFESTFILE` has no effect if you do not also link with [/MANIFEST](manifest-create-side-by-side-assembly-manifest.md).
### To set this linker option in the Visual Studio development environment
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
-
1. Select the **Configuration Properties** > **Linker** > **Manifest File** property page.
-
1. Modify the **Manifest File** property.
### To set this linker option programmatically
@@ -32,5 +34,5 @@ ms.assetid: befa5ab2-a9cf-4c9b-969a-e7b4a930f08d
## See also
-[MSVC linker reference](linking.md)
+[MSVC linker reference](linking.md)\
[MSVC Linker Options](linker-options.md)
diff --git a/docs/build/reference/manifestinput-specify-manifest-input.md b/docs/build/reference/manifestinput-specify-manifest-input.md
index 3b71cd47df..df8b326f7d 100644
--- a/docs/build/reference/manifestinput-specify-manifest-input.md
+++ b/docs/build/reference/manifestinput-specify-manifest-input.md
@@ -1,8 +1,8 @@
---
description: "Learn more about: /MANIFESTINPUT (Specify Manifest Input)"
title: "/MANIFESTINPUT (Specify Manifest Input)"
-ms.date: "07/24/2019"
-ms.assetid: a0b0c21e-1f9b-4d8c-bb3f-178f57fa7f1b
+ms.date: 03/27/2025
+f1_keywords: ["VC.Project.VCLinkerTool.ManifestInput"]
---
# /MANIFESTINPUT (Specify Manifest Input)
@@ -10,22 +10,20 @@ Specifies a manifest input file to include in the manifest that's embedded in th
## Syntax
-```
-/MANIFESTINPUT:filename
-```
+> `/MANIFESTINPUT:`*filename*
### Parameters
-*filename*
-The manifest file to include in the embedded manifest.
+*filename*\
+The manifest file to include in the embedded manifest. When expanded, the fully qualified filename must not exceed `MAX_PATH` (260 characters).
## Remarks
-The **/MANIFESTINPUT** option specifies the path of an input file to use to create the embedded manifest in an executable image. If you have multiple manifest input files, use the switch multiple times—once for each input file. The manifest input files are merged to create the embedded manifest. This option requires the **/MANIFEST:EMBED** option.
+The **`/MANIFESTINPUT`** option specifies the path of an input file to use to create the embedded manifest in an executable image. If you have multiple manifest input files, use the switch multiple times: once for each input file. The manifest input files are merged to create the embedded manifest. This option requires the **`/MANIFEST:EMBED`** option.
-This option can't be set directly in Visual Studio. Instead, use the **Additional Manifest Files** property of the project to specify additional manifest files to include. For more information, see [Manifest Tool Property Pages](manifest-tool-property-pages.md).
+This option can't be set directly in Visual Studio. Instead, use the **Additional Manifest Files** property of the project to specify other manifest files to include. For more information, see [Manifest Tool Property Pages](manifest-tool-property-pages.md).
## See also
-[MSVC linker reference](linking.md)
+[MSVC linker reference](linking.md)\
[MSVC Linker Options](linker-options.md)
diff --git a/docs/build/reference/md-mt-ld-use-run-time-library.md b/docs/build/reference/md-mt-ld-use-run-time-library.md
index 0db8d589cb..0867d33ed0 100644
--- a/docs/build/reference/md-mt-ld-use-run-time-library.md
+++ b/docs/build/reference/md-mt-ld-use-run-time-library.md
@@ -1,14 +1,13 @@
---
-description: "Learn more about: /MD, /MT, /LD (Use Run-Time Library)"
-title: "/MD, -MT, -LD (Use Run-Time Library)"
-ms.date: "07/17/2019"
+title: "/MD, /MT, /LD (Use runtime library)"
+description: "Learn more about: /MD, /MT, /LD (Use runtime library)"
+ms.date: "01/13/2025"
f1_keywords: ["/ld", "/mt", "VC.Project.VCCLWCECompilerTool.RuntimeLibrary", "VC.Project.VCCLCompilerTool.RuntimeLibrary", "/md", "/ml"]
helpviewer_keywords: ["/MT compiler option [C++]", "-MD compiler option [C++]", "threading [C++], multithread compiler option", "MSVCRTD.lib", "MSVCRT.lib", "LIBCMT.lib", "MD compiler option [C++]", "/MD compiler option [C++]", "MT compiler option [C++]", "LD compiler option [C++]", "MDd compiler option [C++]", "-MDd compiler option [C++]", "LIBCD.lib", "-MTd compiler option [C++]", "MTd compiler option [C++]", "/MTd compiler option [C++]", "-LD compiler option [C++]", "/MDd compiler option [C++]", "multithread compiler option", "_STATIC_CPPLIB symbol", "LIBC.lib", "/LD compiler option [C++]", "DLLs [C++], compiler options", "LIBCMTD.lib", "-MT compiler option [C++]"]
-ms.assetid: cf7ed652-dc3a-49b3-aab9-ad60e5395579
---
-# /MD, /MT, /LD (Use Run-Time Library)
+# /MD, /MT, /LD (Use runtime library)
-Indicates whether a multithreaded module is a DLL and specifies retail or debug versions of the run-time library.
+Indicates whether a multithreaded module is a DLL and specifies retail or debug versions of the runtime library.
## Syntax
@@ -22,27 +21,25 @@ Indicates whether a multithreaded module is a DLL and specifies retail or debug
|Option|Description|
|------------|-----------------|
-|**/MD**|Causes the application to use the multithread-specific and DLL-specific version of the run-time library. Defines `_MT` and `_DLL` and causes the compiler to place the library name MSVCRT.lib into the .obj file.
Applications compiled with this option are statically linked to MSVCRT.lib. This library provides a layer of code that enables the linker to resolve external references. The actual working code is contained in MSVCR*versionnumber*.DLL, which must be available at run time to applications linked with MSVCRT.lib.|
-|**/MDd**|Defines `_DEBUG`, `_MT`, and `_DLL` and causes the application to use the debug multithread-specific and DLL-specific version of the run-time library. It also causes the compiler to place the library name MSVCRTD.lib into the .obj file.|
-|**/MT**|Causes the application to use the multithread, static version of the run-time library. Defines `_MT` and causes the compiler to place the library name LIBCMT.lib into the .obj file so that the linker will use LIBCMT.lib to resolve external symbols.|
-|**/MTd**|Defines `_DEBUG` and `_MT`. This option also causes the compiler to place the library name LIBCMTD.lib into the .obj file so that the linker will use LIBCMTD.lib to resolve external symbols.|
-|**/LD**|Creates a DLL.
Passes the **/DLL** option to the linker. The linker looks for, but does not require, a `DllMain` function. If you do not write a `DllMain` function, the linker inserts a `DllMain` function that returns TRUE.
Links the DLL startup code.
Creates an import library (.lib), if an export (.exp) file is not specified on the command line. You link the import library to applications that call your DLL.
Interprets [/Fe (Name EXE File)](fe-name-exe-file.md) as naming a DLL rather than an .exe file. By default, the program name becomes *basename*.dll instead of *basename*.exe.
Implies **/MT** unless you explicitly specify **/MD**.|
-|**/LDd**|Creates a debug DLL. Defines `_MT` and `_DEBUG`.|
+|**/MD**|Use the multithread-specific and DLL-specific version of the runtime library. Defines `_MT` and `_DLL`. The linker uses the `MSVCRT.lib` import library to resolve runtime symbols.|
+|**/MDd**|Use the debug multithread-specific and DLL-specific version of the runtime library. Defines `_DEBUG`, `_MT`, and `_DLL`. The linker uses the `MSVCRTD.lib` import library to resolve runtime symbols.|
+|**/MT**| Use the multithread, static version of the runtime library. Defines `_MT`. The linker uses `LIBCMT.lib` to resolve runtime symbols.|
+|**/MTd**| Use the debug multithread, static version of the runtime library. Defines `_DEBUG` and `_MT`. The linker uses `LIBCMTD.lib` to resolve runtime symbols.|
+|**/LD**|Create a DLL.
Passes the **/DLL** option to the linker. The linker looks for, but does not require, a `DllMain` function. If you don't write a `DllMain` function, the linker inserts a `DllMain` function that returns TRUE.
Links the DLL startup code.
Creates an import library (`.lib`), if an export (`.exp`) file is not specified on the command line. You link the import library to applications that call your DLL.
Interprets [/Fe (Name EXE File)](fe-name-exe-file.md) as naming a DLL rather than an `.exe` file. By default, the program name becomes *basename*.dll instead of *basename*.exe.
Implies **/MT** unless you explicitly specify **/MD**.|
+|**/LDd**|Create a debug DLL. Defines `_MT` and `_DEBUG`.|
-For more information about C run-time libraries and which libraries are used when you compile with [/clr (Common Language Runtime Compilation)](clr-common-language-runtime-compilation.md), see [CRT Library Features](../../c-runtime-library/crt-library-features.md).
+For more information about C runtime libraries and which libraries are used when you compile with [/clr (Common Language Runtime Compilation)](clr-common-language-runtime-compilation.md), see [CRT Library Features](../../c-runtime-library/crt-library-features.md).
-All modules passed to a given invocation of the linker must have been compiled with the same run-time library compiler option (**/MD**, **/MT**, **/LD**).
+All modules passed to a given invocation of the linker must have been compiled with the same runtime library compiler option (**/MD**, **/MT**, **/LD**).
-For more information about how to use the debug versions of the run-time libraries, see [C Run-Time Library Reference](../../c-runtime-library/c-run-time-library-reference.md).
+For more information about how to use the debug versions of the runtime libraries, see [C runtime Library Reference](../../c-runtime-library/c-run-time-library-reference.md).
For more about DLLs, see [Create C/C++ DLLs in Visual Studio](../dlls-in-visual-cpp.md).
### To set this compiler option in the Visual Studio development environment
1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
-
1. Select the **Configuration Properties** > **C/C++** > **Code Generation** property page.
-
1. Modify the **Runtime Library** property.
### To set this compiler option programmatically
@@ -51,5 +48,6 @@ For more about DLLs, see [Create C/C++ DLLs in Visual Studio](../dlls-in-visual-
## See also
-[MSVC Compiler Options](compiler-options.md)
-[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
+[MSVC Compiler Options](compiler-options.md)\
+[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)\
+[The Great C Runtime (CRT) Refactoring](https://devblogs.microsoft.com/cppblog/the-great-c-runtime-crt-refactoring/)
\ No newline at end of file
diff --git a/docs/build/reference/microsoft-extensions-to-c-and-cpp.md b/docs/build/reference/microsoft-extensions-to-c-and-cpp.md
index 17f74d81fd..77eceff58e 100644
--- a/docs/build/reference/microsoft-extensions-to-c-and-cpp.md
+++ b/docs/build/reference/microsoft-extensions-to-c-and-cpp.md
@@ -1,108 +1,103 @@
---
description: "Learn more about: Microsoft extensions to C and C++"
title: "Microsoft extensions to C and C++"
-ms.date: "06/14/2018"
+ms.date: 03/15/2022
helpviewer_keywords: ["or_eq operator", "~ operator, extensions to C/C++", "& operator, extensions to C/C++", "&= operator", "iso646.h header", "Xor operator, Microsoft extensions to C/C++", "!= operator", "! operator, extension to C++", "Or operator, Microsoft extensions to C/C++", "^ operator, extensions to C/C++", "^= operator, C++ extensions", "xor_eq operator", "and_eq operator", "Microsoft extensions to C/C++", "|= operator", "|| operator", "And operator, extensions to C/C++", "NOT operator", "&& operator", "extensions, C language", "Visual C++, extensions to C/C++", "| operator, extensions", "not_eq operator", "Visual C, Microsoft extensions", "extensions", "compl method"]
-ms.assetid: e811a74a-45ba-4c00-b206-2f2321b8689a
---
# Microsoft extensions to C and C++
-Visual C++ extends the ANSI C and ANSI C++ standards as follows.
+Microsoft Visual C++ (MSVC) extends the C and C++ language standards in several ways, detailed in this article.
-## Keywords
-
-Several keywords are added. In the list in [Keywords](../../cpp/keywords-cpp.md), the keywords that have two leading underscores are Visual C++ extensions.
+The MSVC C++ compiler defaults to support for ISO C++14 with some ISO C++17 features and some Microsoft-specific language extensions. For more information on supported features, see [Microsoft C/C++ language conformance by Visual Studio version](../../overview/visual-cpp-language-conformance.md). You can use the **`/std`** compiler option to enable full support for ISO C++17 and ISO C++20 language features. For more information, see [`/std` (Specify language standard version)](std-specify-language-standard-version.md).
-## Out of class definition of static const integral (or enum) members
+Where specified, some MSVC C++ language extensions can be disabled by use of the **`/Za`** compiler option. In Visual Studio 2017 and later versions, the **`/permissive-`** compiler option disables Microsoft-specific C++ language extensions. The **`/permissive-`** compiler option is implicitly enabled by the **`/std:c++20`** and **`/std:c++latest`** compiler options.
-Under the standard (**/Za**), you must make an out-of-class definition for data members, as shown here:
+By default, when MSVC compiles code as C, it implements ANSI C89 with Microsoft-specific language extensions. Some of these MSVC extensions are standardized in ISO C99 and later. Most MSVC C extensions can be disabled by use of the **`/Za`** compiler option, as detailed later in this article. You can use the **`/std`** compiler option to enable support for ISO C11 and C17. For more information, see [`/std` (Specify language standard version)](std-specify-language-standard-version.md).
-```cpp
-class CMyClass {
- static const int max = 5;
- int m_array[max];
-}
-// . . .
-const int CMyClass::max; // out of class definition
-```
+The standard C runtime library is implemented by the Universal C runtime library (UCRT) in Windows. The UCRT also implements many POSIX and Microsoft-specific library extensions. The UCRT supports the ISO C11 and C17 C runtime library standards, with certain implementation-specific caveats. It doesn't support the full ISO C99 standard C runtime library. For more information, see [compatibility](../../c-runtime-library/compatibility.md) in the Universal C runtime library documentation.
-Under **/Ze**, the out-of-class definition is optional for static, const integral, and const enum data members. Only integrals and enums that are static and const can have initializers in a class; the initializing expression must be a const expression.
+## Keywords
-To avoid errors when an out-of-class definition is provided in a header file and the header file is included in multiple source files, use [selectany](../../cpp/selectany.md). For example:
-
-```cpp
-__declspec(selectany) const int CMyClass::max = 5;
-```
+MSVC adds several Microsoft-specific keywords to C and C++. In the list in [Keywords](../../cpp/keywords-cpp.md), the keywords that have two leading underscores are MSVC extensions.
## Casts
-Both the C++ compiler and C compiler support these kinds of non-ANSI casts:
+Both the C++ compiler and C compiler support these kinds of non-standard casts:
-- Non-ANSI casts to produce l-values. For example:
+- The C compiler supports non-standard casts to produce l-values. For example:
```C
char *p;
(( int * ) p )++;
+ // In C with /W4, both by default and under /Ze:
+ // warning C4213: nonstandard extension used: cast on l-value
+ // Under /TP or /Za:
+ // error C2105: '++' needs l-value
```
> [!NOTE]
- > This extension is available in the C language only. You can use the following ANSI C standard form in C++ code to modify a pointer as if it is a pointer to a different type.
+ > This extension is available in the C language only. You can use the following C standard form in C++ code to modify a pointer as if it's a pointer to a different type.
- The preceding example could be rewritten as follows to conform to the ANSI C standard.
+ The preceding example could be rewritten as follows to conform to the C standard.
```C
p = ( char * )(( int * )p + 1 );
```
-- Non-ANSI casts of a function pointer to a data pointer. For example:
+- Both the C and C++ compilers support non-standard casts of a function pointer to a data pointer. For example:
```C
int ( * pfunc ) ();
int *pdata;
pdata = ( int * ) pfunc;
- ```
-
- To perform the same cast and also maintain ANSI compatibility, you can cast the function pointer to a `uintptr_t` before you cast it to a data pointer:
-
- ```C
- pdata = ( int * ) (uintptr_t) pfunc;
+ /* No diagnostic at any level, whether compiled with default options or under /Za */
```
## Variable-length argument lists
-Both the C++ compiler and C compiler support a function declarator that specifies a variable number of arguments, followed by a function definition that provides a type instead:
+Both C and C++ compilers support a function declarator that specifies a variable number of arguments, followed by a function definition that provides a type instead:
```cpp
void myfunc( int x, ... );
void myfunc( int x, char * c )
{ }
+// In C with /W4, either by default or under /Ze:
+// warning C4212: nonstandard extension used: function declaration used ellipsis
+// In C with /W4, under /Za:
+// warning C4028: formal parameter 2 different from declaration
+// In C++, no diagnostic by default or under /Za.
```
## Single-line comments
-The C compiler supports single-line comments, which are introduced by using two forward slash (//) characters:
+The C compiler supports single-line comments, which are introduced by using two forward slash (`//`) characters:
```C
// This is a single-line comment.
```
+Single-line comments are a C99 feature. They're unaffected by **`/Za`** and cause no diagnostic at any level.
+
## Scope
The C compiler supports the following scope-related features.
-- Redefinitions of extern items as static:
+- Redefinitions of `extern` items as `static`:
```C
extern int clip();
- static int clip()
- {}
+ static int clip() {}
+ // In C and C++ with /W4, either by default or under /Ze:
+ // warning C4211: nonstandard extension used: redefined extern to static
+ // In C and C++ under /Za:
+ // error C2375: 'clip': redefinition; different linkage
```
- Use of benign typedef redefinitions within the same scope:
```C
typedef int INT;
- typedef int INT;
+ typedef int INT; // No diagnostic at any level in C or C++
```
- Function declarators have file scope:
@@ -110,7 +105,8 @@ The C compiler supports the following scope-related features.
```C
void func1()
{
- extern int func2( double );
+ extern double func2( double );
+ // In C at /W4: warning C4210: nonstandard extension used: function given file scope
}
int main( void )
{
@@ -118,7 +114,7 @@ The C compiler supports the following scope-related features.
} // /Za passes 4 as type int
```
-- Use of block-scope variables that are initialized by using nonconstant expressions:
+- Use of block-scope variables that are initialized by using non-constant expressions:
```C
int clip( int );
@@ -144,7 +140,11 @@ The C compiler supports the following data declaration and definition features.
- Mixed character and string constants in an initializer:
```C
- char arr[5] = {'a', 'b', "cde"};
+ char arr[6] = {'a', 'b', "cde"};
+ // In C with /W4, either by default or under /Ze:
+ // warning C4207: nonstandard extension used: extended initializer form
+ // Under /Za:
+ // error C2078: too many initializers
```
- Bit fields that have base types other than **`unsigned int`** or **`signed int`**.
@@ -153,6 +153,10 @@ The C compiler supports the following data declaration and definition features.
```C
x;
+ // By default or under /Ze, /Za, /std:c11, and /std:c17, when /W4 is specified:
+ // warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int
+ // warning C4218: nonstandard extension used: must specify at least a storage class or a type
+ */
int main( void )
{
x = 1;
@@ -166,6 +170,10 @@ The C compiler supports the following data declaration and definition features.
{
char *c;
int zarray[];
+ // In C with /W4, either by default, under /Ze, /std:c11, and /std:c17:
+ // warning C4200: nonstandard extension used: zero-sized array in struct/union
+ // Under /Za:
+ // error C2133: 'zarray': unknown size
};
```
@@ -177,6 +185,10 @@ The C compiler supports the following data declaration and definition features.
int i;
char *s;
};
+ // By default or under /Ze, /std:c11, and /std:c17, when /W4 is specified:
+ // warning C4094: untagged 'struct' declared no symbols
+ // Under /Za:
+ // error C2059: syntax error: 'empty declaration'
```
- Unnamed (anonymous) unions:
@@ -187,88 +199,38 @@ The C compiler supports the following data declaration and definition features.
int i;
float fl;
};
- ```
-
-- Unnamed members:
-
- ```C
- struct s
- {
- unsigned int flag : 1;
- unsigned int : 31;
- }
+ // By default or under /Ze, /std:c11, and /std:c17, when /W4 is specified:
+ // warning C4094: untagged 'union' declared no symbols
+ // Under /Za:
+ // error C2059: syntax error: 'empty declaration'
```
## Intrinsic floating-point functions
-Both the x86 C++ compiler and C compiler support inline generation of the `atan`, `atan2`, `cos`, `exp`, `log`, `log10`, `sin`, `sqrt`, and `tan` functions when **/Oi** is specified. For the C compiler, ANSI conformance is lost when these intrinsics are used, because they do not set the `errno` variable.
-
-## Passing a non-const pointer parameter to a function that expects a reference to a const pointer parameter
-
-This is an extension to C++. This code will compile with **/Ze**:
+Both the x86 C++ compiler and C compiler support inline generation of the `atan`, `atan2`, `cos`, `exp`, `log`, `log10`, `sin`, `sqrt`, and `tan` functions when **`/Oi`** is specified. These intrinsics don't conform to the standard, because they don't set the `errno` variable.
-```cpp
-typedef int T;
-
-const T acT = 9; // A constant of type 'T'
-const T* pcT = &acT; // A pointer to a constant of type 'T'
-
-void func2 ( const T*& rpcT ) // A reference to a pointer to a constant of type 'T'
-{
- rpcT = pcT;
-}
-
-T* pT; // A pointer to a 'T'
-
-void func ()
-{
- func2 ( pT ); // Should be an error, but isn't detected
- *pT = 7; // Invalidly overwrites the constant 'acT'
-}
-```
-
-## ISO646.H not enabled
-
-Under **/Ze**, you have to include iso646.h if you want to use text forms of the following operators:
-
-- && (and)
-
-- &= (and_eq)
-
-- & (bitand)
+## *`ISO646.H`* not enabled
-- | (bitor)
+Under **`/Ze`**, you have to include *`iso646.h`* if you want to use text forms of the following operators:
-- ~ (compl)
+| Operator | Text form |
+|--|--|
+| `&&` | `and` |
+| `&=` | `and_eq` |
+| `&` | `bitand` |
+| `|` | `bitor` |
+| `~` | `compl` |
+| `!` | `not` |
+| `!=` | `not_eq` |
+| `||` | `or` |
+| `|=` | `or_eq` |
+| `^` | `xor` |
+| `^=` | `xor_eq` |
-- ! (not)
-
-- != (not_eq)
-
-- || (or)
-
-- |= (or_eq)
-
-- ^ (xor)
-
-- ^= (xor_eq)
-
-## Address of string literal has type const char [], not const char (*) []
-
-The following example will output `char const (*)[4]` under **/Za**, but `char const [4]` under **/Ze**.
-
-```cpp
-#include
-#include
-
-int main()
-{
- printf_s("%s\n", typeid(&"abc").name());
-}
-```
+These text forms are available as C++ keywords under **`/Za`** or when **`/permissive-`** is specified or implied.
## See also
-- [/Za, /Ze (Disable Language Extensions)](za-ze-disable-language-extensions.md)
-- [MSVC Compiler Options](compiler-options.md)
-- [MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md)
+[`/Za`, `/Ze` (Disable language extensions)](za-ze-disable-language-extensions.md)\
+[MSVC compiler options](compiler-options.md)\
+[MSVC compiler command-line syntax](compiler-command-line-syntax.md)
diff --git a/docs/build/reference/midl-property-pages.md b/docs/build/reference/midl-property-pages.md
index 612fa24307..66c3955c39 100644
--- a/docs/build/reference/midl-property-pages.md
+++ b/docs/build/reference/midl-property-pages.md
@@ -47,7 +47,6 @@ f1_keywords:
- VC.Project.VCMidlTool.StructMemberAlignment
- VC.Project.VCMidlTool.RedirectOutputAndErrors
- VC.Project.VCMidlTool.MinimumTargetSystem
- - vc.project.AdditionalOptionsPage
---
# MIDL Property Pages
diff --git a/docs/build/reference/module-exportheader.md b/docs/build/reference/module-exportheader.md
index a6e1cc2cf3..5c1b8a839c 100644
--- a/docs/build/reference/module-exportheader.md
+++ b/docs/build/reference/module-exportheader.md
@@ -53,11 +53,19 @@ cl . . . /std:c++latest /exportHeader /headerName:quote util/util.h
### To set this compiler option in the Visual Studio development environment
-You normally shouldn't set this in the Visual Studio development environment. It is set by the build system.
+You normally shouldn't set this option in the Visual Studio development environment unless you use a different extension for your header files. By default, the build system applies this option to compiled files that have a *`.h`* extension, or no extension.
+
+1. To apply the **`/exportHeader`** option to a file explicitly in the IDE, select the file in **Solution Explorer**. Right-click to open the context menu and select **Properties** to open the Property Pages dialog.
+
+1. Set the **Configuration** dropdown to **All Configurations**. Set the **Platform** dropdown to **All Platforms**.
+
+1. Open the **Configuration Properties** > **C/C++** > **Advanced** property page.
+
+1. Use the dropdown control to modify the **Compile As** property to **Compile as C++ Header Unit (/exportHeader)**. Choose **OK** or **Apply** to save your changes.
## See also
-[`/headerName (Build a header unit from the specified header)`](headername.md)\
+[`/headerName` (Build a header unit from the specified header)](headername.md)\
[`/headerUnit` (Use header unit IFC)](headerunit.md)\
[`/reference` (Use named module IFC)](module-reference.md)\
[`/translateInclude` (Translate include directives into import directives)](translateinclude.md)
diff --git a/docs/build/reference/module-reference.md b/docs/build/reference/module-reference.md
index 6abe5a1758..10f51331a9 100644
--- a/docs/build/reference/module-reference.md
+++ b/docs/build/reference/module-reference.md
@@ -1,8 +1,8 @@
---
title: "/reference (Use named module IFC)"
description: "Use the /reference compiler option to create module header units for the header-name or include files specified."
-ms.date: 04/13/2020
-f1_keywords: ["/reference"]
+ms.date: 02/17/2022
+f1_keywords: ["/reference", "VC.Project.VCCLCompilerTool.AdditionalModuleDependencies"]
helpviewer_keywords: ["/reference", "Use named module IFC"]
---
# `/reference` (Use named module IFC)
@@ -24,7 +24,7 @@ A valid name of an exported primary module interface unit name or full module pa
## Remarks
-In most cases you won't need to specify this switch because the project system discovers module dependencies within a solution automatically.
+In most cases, you won't need to specify this switch because the project system discovers module dependencies within a solution automatically.
The **`/reference`** compiler option requires you enable the [`/std:c++20`](std-specify-language-standard-version.md) or later compiler option (such as **`/std:c++latest`**). The **`/reference`** option is available starting in Visual Studio 2019 version 16.10.
@@ -76,6 +76,7 @@ cl ... /std:c++latest /reference m=m.ifc /reference M:Part1=m-part.ifc /referenc
## See also
+[`/scanDependencies` (List module dependencies in standard form)](scandependencies.md)\
[`/sourceDependencies:directives` (List module and header unit dependencies)](sourcedependencies-directives.md)\
[`/headerUnit` (Use header unit IFC)](headerunit.md)\
[`/exportHeader` (Create header units)](module-exportheader.md)
diff --git a/docs/build/reference/mp-build-with-multiple-processes.md b/docs/build/reference/mp-build-with-multiple-processes.md
index b63a912e7b..de05d5234b 100644
--- a/docs/build/reference/mp-build-with-multiple-processes.md
+++ b/docs/build/reference/mp-build-with-multiple-processes.md
@@ -1,122 +1,122 @@
---
-description: "Learn more about: /MP (Build with Multiple Processes)"
-title: "/MP (Build with Multiple Processes)"
-ms.date: "04/08/2019"
+description: "Learn more about: /MP (Build with multiple processes)"
+title: "/MP (Build with multiple processes)"
+ms.date: 06/13/2022
f1_keywords: ["VC.Project.VCCLCompilerTool.MultiProcessorCompilation"]
helpviewer_keywords: ["-MP compiler option (C++)", "/MP compiler option (C++)", "MP compiler option (C++)", "cl.exe compiler, multi-process build"]
---
-# /MP (Build with Multiple Processes)
+# `/MP` (Build with multiple processes)
-The **/MP** option can reduce the total time to compile the source files on the command line. The **/MP** option causes the compiler to create one or more copies of itself, each in a separate process. Then these copies simultaneously compile the source files. Consequently, the total time to build the source files can be significantly reduced.
+The **`/MP`** option can reduce the total time to compile the source files on the command line. The **`/MP`** option causes the compiler to create one or more copies of itself, each in a separate process. Then these instances simultaneously compile the source files. In some cases, the total time to build the source files can be reduced significantly.
## Syntax
-> **/MP**[*processMax*]
+> **`/MP`**[*`processMax`*]
## Arguments
-*processMax*
+*`processMax`*\
(Optional) The maximum number of processes that the compiler can create.
-The *processMax* argument must range from 1 through 65536. Otherwise, the compiler issues warning message **D9014**, ignores the *processMax* argument, and assumes the maximum number of processes is 1.
+The *`processMax`* argument must range from 1 through 65536. Otherwise, the compiler issues warning message **D9014**, ignores the *`processMax`* argument, and assumes the maximum number of processes is 1.
-If you omit the *processMax* argument, the compiler retrieves the number of [effective processors](#effective_processors) on your computer from the operating system, and creates a process for each processor.
+If you omit the *`processMax`* argument, the compiler retrieves the number of [effective processors](#effective_processors) on your computer from the operating system, and creates a process for each processor.
## Remarks
-The **/MP** compiler option can significantly reduce build time when you compile many files. To improve build time, the compiler creates up to *processMax* copies of itself, and then uses those copies to compile your source files at the same time. The **/MP** option applies to compilations, but not to linking or link-time code generation. By default the **/MP** option is off.
+The **`/MP`** compiler option can significantly reduce build time when you compile many files. To improve build time, the compiler creates up to *`processMax`* copies of itself, and then uses those copies to compile your source files at the same time. The **`/MP`** option applies to compilations, but not to linking or link-time code generation. By default the **`/MP`** option is off.
-The improvement in build time depends on the number of processors on a computer, the number of files to compile, and the availability of system resources, such as I/O capacity. Experiment with the **/MP** option to determine the best setting to build a particular project. For advice to help you make that decision, see [Guidelines](#guidelines).
+The improvement in build time depends on the number of processors on a computer, the number of files to compile, and the availability of system resources, such as I/O capacity. Experiment with the **`/MP`** option to determine the best setting to build a particular project. For advice to help you make that decision, see [Guidelines](#guidelines).
-## Incompatible Options and Language Features
+## Incompatible options and language features
-The **/MP** option is incompatible with some compiler options and language features. If you use an incompatible compiler option with the **/MP** option, the compiler issues warning **D9030** and ignores the **/MP** option. If you use an incompatible language feature, the compiler issues error [C2813](../../error-messages/compiler-errors-2/compiler-error-c2813.md) then ends or continues depending on the current compiler warning level option.
+The **`/MP`** option is incompatible with some compiler options and language features. If you use an incompatible compiler option with the **`/MP`** option, the compiler issues warning **D9030** and ignores the **`/MP`** option. If you use an incompatible language feature, the compiler issues error [C2813](../../error-messages/compiler-errors-2/compiler-error-c2813.md) then ends or continues depending on the current compiler warning level option.
> [!NOTE]
> Most options are incompatible because if they were permitted, the concurrently executing compilers would write their output at the same time to the console or to a particular file. As a result, the output would intermix and be garbled. In some cases, the combination of options would make the performance worse.
-The following table lists compiler options and language features that are incompatible with the **/MP** option:
+The following table lists compiler options and language features that are incompatible with the **`/MP`** option:
-|Option or Language Feature|Description|
-|--------------------------------|-----------------|
-|[#import](../../preprocessor/hash-import-directive-cpp.md) preprocessor directive|Converts the types in a type library into C++ classes, and then writes those classes to a header file.|
-|[/E](e-preprocess-to-stdout.md), [/EP](ep-preprocess-to-stdout-without-hash-line-directives.md)|Copies preprocessor output to the standard output (**stdout**).|
-|[/Gm](gm-enable-minimal-rebuild.md)|Deprecated. Enables an incremental rebuild.|
-|[/showIncludes](showincludes-list-include-files.md)|Writes a list of include files to the standard error (**stderr**).|
-|[/Yc](yc-create-precompiled-header-file.md)|Writes a precompiled header file.|
+| Option or Language Feature | Description |
+|--|--|
+| [`#import`](../../preprocessor/hash-import-directive-cpp.md) preprocessor directive | Converts the types in a type library into C++ classes, and then writes those classes to a header file. |
+| [`/E`](e-preprocess-to-stdout.md), [`/EP`](ep-preprocess-to-stdout-without-hash-line-directives.md) | Copies preprocessor output to the standard output (**`stdout`**). |
+| [`/Gm`](gm-enable-minimal-rebuild.md) | Deprecated. Enables an incremental rebuild. |
+| [`/showIncludes`](showincludes-list-include-files.md) | Writes a list of include files to the standard error (**`stderr`**). |
+| [`/Yc`](yc-create-precompiled-header-file.md) | Writes a precompiled header file. |
-## Diagnostic Messages
+## Diagnostic messages
-If you specify an option or language feature that is incompatible with the **/MP** option, you will receive a diagnostic message. The following table lists the messages and the behavior of the compiler:
+If you specify an option or language feature that is incompatible with the **`/MP`** option, you'll receive a diagnostic message. The following table lists the messages and the behavior of the compiler:
-|Diagnostic Message|Description|Compiler Behavior|
-|------------------------|-----------------|-----------------------|
-|**C2813**|The **#import** directive is not compatible with the **/MP** option.|The compilation ends unless a [compiler warning level](compiler-option-warning-level.md) option specifies otherwise.|
-|**D9014**|An invalid value is specified for the *processMax* argument.|The compiler ignores the invalid value and assumes a value of 1.|
-|**D9030**|The specified option is incompatible with **/MP**.|The compiler ignores the **/MP** option.|
+| Diagnostic Message | Description | Compiler Behavior |
+|--|--|--|
+| **C2813** | The **`#import`** directive isn't compatible with the **`/MP`** option. | The compilation ends unless a [compiler warning level](compiler-option-warning-level.md) option specifies otherwise. |
+| **D9014** | An invalid value is specified for the *`processMax`* argument. | The compiler ignores the invalid value and assumes a value of 1. |
+| **D9030** | The specified option is incompatible with **`/MP`**. | The compiler ignores the **`/MP`** option. |
## Guidelines
-### Measure Performance
+### Measure performance
Use total build time to measure performance. You can measure the build time with a physical clock, or you can use software that calculates the difference between when the build starts and stops. If your computer has multiple processors, a physical clock might yield more accurate results than a software time measurement.
-### Effective Processors
+### Effective processors
A computer can have one or more virtual processors, which are also known as *effective processors*, for each of its physical processors. Each physical processor can have one or more cores, and if the operating system enables hyperthreading for a core, each core appears to be two virtual processors.
For example, a computer has one effective processor if it has one physical processor that has one core, and hyperthreading is disabled. In contrast, a computer has eight effective processors if it has two physical processors, each of which has two cores, and all the cores have hyperthreading enabled. That is, (8 effective processors) = (2 physical processors) x (2 cores per physical processor) x (2 effective processors per core because of hyperthreading).
-If you omit the *processMax* argument in the **/MP** option, the compiler obtains the number of effective processors from the operating system, and then creates one process per effective processor. However, the compiler cannot guarantee which process executes on a particular processor; the operating system makes that decision.
+If you omit the *`processMax`* argument in the **`/MP`** option, the compiler obtains the number of effective processors from the operating system, and then creates one process per effective processor. However, the compiler can't guarantee which process executes on a particular processor; the operating system makes that decision.
-### Number of Processes
+### Number of processes
-The compiler calculates the number of processes that it will use to compile the source files. That value is the lesser of the number of source files that you specify on the command line, and the number of processes that you explicitly or implicitly specify with the **/MP** option. You can explicitly set the maximum number of processes if you provide the *processMax* argument of the **/MP** option. Or you can use the default, which is equal to the number of effective processors in a computer, if you omit the *processMax* argument.
+The compiler calculates the number of processes that it will use to compile the source files. That value is the lesser of the number of source files that you specify on the command line, and the number of processes that you explicitly or implicitly specify with the **`/MP`** option. You can explicitly set the maximum number of processes if you provide the *`processMax`* argument of the **`/MP`** option. Or you can use the default, which is equal to the number of effective processors in a computer, if you omit the *`processMax`* argument.
For example, suppose you specify the following command line:
`cl /MP7 a.cpp b.cpp c.cpp d.cpp e.cpp`
-In this case the compiler uses five processes because that is the lesser of five source files and a maximum of seven processes. Alternatively, suppose your computer has two effective processors and you specify the following command line:
+In this case, the compiler uses five processes because that is the lesser of five source files and a maximum of seven processes. Alternatively, suppose your computer has two effective processors and you specify the following command line:
`cl /MP a.cpp b.cpp c.cpp`
-In this case the operating system reports two processors; therefore, the compiler uses two processes in its calculation. As a result, the compiler will execute the build with two processes because that is the lesser of two processes and three source files.
+In this case, the operating system reports two processors, so the compiler uses two processes in its calculation. As a result, the compiler uses two processes to execute the build because that's the lesser of two processes and three source files.
-### Source Files and Build Order
+### Source files and build order
-The source files might not be compiled in the same order in which they appear on the command line. Although the compiler creates a set of processes that contain copies of the compiler, the operating system schedules when each process executes. Consequently, you cannot guarantee that the source files will be compiled in a particular order.
+The source files might not be compiled in the same order in which they appear on the command line. Although the compiler creates a set of processes that contain copies of the compiler, the operating system schedules when each process executes. The **`/MP`** option can't guarantee that the source files will be compiled in a particular order.
A source file is compiled when a process is available to compile it. If there are more files than processes, the first set of files is compiled by the available processes. The remaining files are processed when a process finishes handling a previous file and is available to work on one of the remaining files.
-Do not specify the same source file multiple times on a command line. This might occur, for example, if a tool automatically creates a [makefile](contents-of-a-makefile.md) that is based on dependency information in a project. If you do not specify the **/MP** option, the compiler processes the list of files sequentially and recompiles each occurrence of the file. However, if you specify the **/MP** option, different compilers might compile the same file at the same time. Consequently, the different compilers will try to write to the same output file at the same time. One compiler will acquire exclusive write access to the output file and succeed, and the other compilers will fail with a file access error.
+Don't specify the same source file multiple times on a command line. Multiple specifications could occur, for example, if a tool automatically creates a [makefile](contents-of-a-makefile.md) that's based on dependency information in a project. If you don't specify the **`/MP`** option, the compiler processes the list of files sequentially and recompiles each occurrence of the file. However, if you specify the **`/MP`** option, different compiler instances might compile the same file at the same time. The different instances may try to write to the same output file at the same time. One compiler instance acquires exclusive write access to the output file and succeed, and the other compiler instances fail with a file access error.
-### Using Type Libraries (#import)
+### Using type libraries (`#import`)
-The compiler does not support the use of the [#import](../../preprocessor/hash-import-directive-cpp.md) directive with the **/MP** switch. If possible, follow these steps to work around this problem:
+The compiler doesn't support the use of the [`#import`](../../preprocessor/hash-import-directive-cpp.md) directive with the **`/MP`** switch. If possible, follow these steps to work around this problem:
-- Move all the `#import` directives in your various source files to one or more files, and then compile those files without the **/MP** option. The result is a set of generated header files.
+- Move all the `#import` directives in your various source files to one or more files, and then compile those files without the **`/MP`** option. The result is a set of generated header files.
-- In your remaining source files, insert [#include](../../preprocessor/hash-include-directive-c-cpp.md) directives that specify the generated headers, and then compile your remaining source files by using the **/MP** option.
+- In your remaining source files, insert [`#include`](../../preprocessor/hash-include-directive-c-cpp.md) directives that specify the generated headers, and then compile your remaining source files by using the **`/MP`** option.
-### Visual Studio Project Settings
+### Visual Studio Project settings
-#### The MSBUILD.exe Tool
+#### The MSBuild tool
-Visual Studio uses the [MSBuild.exe](/visualstudio/msbuild/msbuild-reference) tool to build solutions and projects. The **/maxcpucount:**_number_ (or **/m:**_number_) command-line option of the MSBuild.exe tool can build multiple projects at the same time. And the **/MP** compiler option can build multiple compilation units at the same time. If it is appropriate for your application, improve your solution's build time by using either or both **/MP** and **/maxcpucount**.
+Visual Studio uses the [`MSBuild`](/visualstudio/msbuild/msbuild-reference) tool (`msbuild.exe`) to build solutions and projects. The **`/maxcpucount:number`** (or **`/m:number`**) command-line option of the MSBuild tool can build multiple projects at the same time. And the **`/MP`** compiler option can build multiple compilation units at the same time. If it's appropriate for your application, improve your solution's build time by using either or both **`/MP`** and **`/maxcpucount`**.
-The build time of your solution partly depends on the number of processes that perform the build. The *number* argument of the [/maxcpucount](/visualstudio/msbuild/msbuild-command-line-reference) MSBuild option specifies the maximum number of projects to build at the same time. Similarly, the *processMax* argument of the **/MP** compiler option specifies the maximum number of compilation units to build at the same time. If the **/maxcpucount** option specifies *P* projects and the **/MP** option specifies *C* processes, a maximum of *P* x *C* processes execute at the same time.
+The build time of your solution partly depends on the number of processes that perform the build. The *`number`* argument of the [`/maxcpucount`](/visualstudio/msbuild/msbuild-command-line-reference) MSBuild option specifies the maximum number of projects to build at the same time. Similarly, the *`processMax`* argument of the **`/MP`** compiler option specifies the maximum number of compilation units to build at the same time. If the **`/maxcpucount`** option specifies *P* projects and the **`/MP`** option specifies *C* processes, a maximum of *P* x *C* processes execute at the same time.
-The guideline for deciding whether to use MSBuild or **/MP** technology is as follows:
+The guideline for deciding whether to use MSBuild or **`/MP`** technology is as follows:
-- If there are many projects with few files in each project, use the MSBuild tool.
+- If there are many projects with few files in each project, use the MSBuild tool with the **`/maxcpucount`** option.
-- If there are few projects with many files in each project, use the **/MP** option.
+- If there are few projects with many files in each project, use the **`/MP`** option.
-- If the number of projects and files per project is balanced, use both MSBuild and **/MP**. Initially set the **/maxcpucount** option to the number of projects to build and the **/MP** option to the number of processors on your computer. Measure performance and then adjust your settings to yield the best results. Repeat that cycle until you are satisfied with the total build time.
+- If the number of projects and files per project is balanced, use both MSBuild and **`/MP`**. Initially set the **`/maxcpucount`** option to the number of projects to build and the **`/MP`** option to the number of processors on your computer. Measure performance and then adjust your settings to yield the best results. Repeat that cycle until you're satisfied with the total build time.
## See also
-[#import Directive](../../preprocessor/hash-import-directive-cpp.md)
-[Command-Line Reference](/visualstudio/msbuild/msbuild-command-line-reference)
-[/Zf (Faster PDB generation)](zf.md)
+[`#import` directive](../../preprocessor/hash-import-directive-cpp.md)\
+[MSBuild command-line reference](/visualstudio/msbuild/msbuild-command-line-reference)\
+[`/Zf` (Faster PDB generation)](zf.md)
diff --git a/docs/build/reference/msbuild-reference-cpp.md b/docs/build/reference/msbuild-reference-cpp.md
index e779a699b2..bbc889a922 100644
--- a/docs/build/reference/msbuild-reference-cpp.md
+++ b/docs/build/reference/msbuild-reference-cpp.md
@@ -1,7 +1,7 @@
---
-description: "Learn more about: MSBuild reference for C++ projects"
title: "MSBuild reference for C++ projects in Visual Studio"
-ms.date: "12/08/2018"
+description: "Learn more about: MSBuild reference for C++ projects"
+ms.date: 12/08/2018
helpviewer_keywords: ["MSBuild reference [C++]"]
---
# MSBuild reference for C++ projects
@@ -12,25 +12,25 @@ If for some reason you wish to use MSBuild directly from the command line, see [
## In this section
-[MSBuild internals for C++ projects](msbuild-visual-cpp-overview.md)
+[MSBuild internals for C++ projects](msbuild-visual-cpp-overview.md)\
Information about how properties and targets are stored and consumed.
-[Common macros for build commands and properties](common-macros-for-build-commands-and-properties.md)
+[Common macros for build commands and properties](common-macros-for-build-commands-and-properties.md)\
Describes macros (compile-time constants) that can be used to define properties such as paths and product versions.
-[File types created for C++ projects](file-types-created-for-visual-cpp-projects.md)
+[File types created for C++ projects](file-types-created-for-visual-cpp-projects.md)\
Describes the various kinds of files that Visual Studio creates for different project types.
-[Visual Studio C++ project templates](visual-cpp-project-types.md)
+[Visual Studio C++ project templates](visual-cpp-project-types.md)\
Describes the MSBuild-based project types that are available for C++.
-[C++ new item templates](using-visual-cpp-add-new-item-templates.md)
+[C++ new item templates](using-visual-cpp-add-new-item-templates.md)\
Describes source files and other items you can add to a Visual Studio project.
-[Precompiled header files](../creating-precompiled-header-files.md)
+[Precompiled header files](../creating-precompiled-header-files.md)\
How to use precompiled header files and how to create your own custom precompiled code to speed up build times.
-[Visual Studio project property reference](property-pages-visual-cpp.md)
+[Visual Studio project property reference](property-pages-visual-cpp.md)\
Reference documentation for project properties that are set in the Visual Studio IDE.
## See also
diff --git a/docs/build/reference/msbuild-visual-cpp-overview.md b/docs/build/reference/msbuild-visual-cpp-overview.md
index 85b0314b00..e614f2f98a 100644
--- a/docs/build/reference/msbuild-visual-cpp-overview.md
+++ b/docs/build/reference/msbuild-visual-cpp-overview.md
@@ -1,7 +1,7 @@
---
title: "MSBuild internals for C++ projects in Visual Studio"
description: "The support files, properties, and targets used by MSBuild for Visual Studio C++ projects."
-ms.date: 10/14/2020
+ms.date: 02/10/2022
helpviewer_keywords: ["MSBuild overview"]
---
# MSBuild internals for C++ projects
@@ -16,11 +16,11 @@ By default, the primary Visual Studio support files are located in the following
::: moniker range=">=msvc-160"
-### Visual Studio 2019
+### Visual Studio 2022 and 2019
- *`%VSINSTALLDIR%MSBuild\Microsoft\VC\\`*
- Contains the primary target files (.targets) and property files (.props) that are used by the targets. By default, the $(VCTargetsPath) macro references this directory. The *``* placeholder refers to the Visual Studio version: v160 for Visual Studio 2019, v150 for Visual Studio 2017.
+ Contains the primary target files (*`.targets`*) and property files (*`.props`*) that are used by the targets. By default, the `$(VCTargetsPath)` macro references this directory. The *``* placeholder refers to the Visual Studio version: v170 for Visual Studio 2022, v160 for Visual Studio 2019, or v150 for Visual Studio 2017.
- *`%VSINSTALLDIR%MSBuild\Microsoft\VC\\Platforms\\`*
@@ -52,19 +52,19 @@ By default, the primary Visual Studio support files are located in the following
### Visual Studio 2015 and earlier
-- *`:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\\`*
+- *`:\Program Files[ (x86)]\MSBuild\Microsoft.Cpp\v4.0\\`*
- Contains the primary target files (.targets) and property files (.props) that are used by the targets. By default, the $(VCTargetsPath) macro references this directory.
+ Contains the primary target files (*`.targets`*) and property files (*`.props`*) that are used by the targets. By default, the $(VCTargetsPath) macro references this directory.
-- *`:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\\Platforms\\`*
+- *`:\Program Files[ (x86)]\MSBuild\Microsoft.Cpp\v4.0\\Platforms\\`*
Contains platform-specific target and property files that override targets and properties in its parent directory. This directory also contains a DLL that defines the tasks that are used by the targets in this directory. The *`