From 7ec77589c127fbf09d32a50fcf3fd9bebc08aa0a Mon Sep 17 00:00:00 2001 From: Taojunshen Date: Fri, 22 Apr 2022 01:34:29 +0800 Subject: [PATCH] 4/21/2022 AM Publish (#4237) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update open-wopen.md Clarify that _O_TEMPORARY sets FILE_SHARE_DELETE. * Update other pages that mention _O_TEMPORARY effects. * New article - IDL method wizard * update after review * update after review * Update after review * Update after review * Updating - Add property wizard for VS2022 * Updating broken links * Update after review * New article - Add an IDL Property * link updation * Update after review * update after review * update after review * New article - IDL MFC property wizard * Broken link fixed * Broken link fixed * Update virtual-functions.md * update for links * Updating links * Address cpp-docs 3780 3782 3790 3791 3805 * Attempt correction of table format * Add documentation for compiler error C2956 and update error text (#4176) * Add documentation for compiler error C2956 and update error text * Add TOC entry * Update for grammar and my own comprehension. Sometimes, you just get carried away. This version could use some simplification. * Simplify. Address remarks, attempt simplification. Acrolinx all the things. * More updates per review Co-authored-by: Colin Robertson * Address cpp-docs 3816 * Address non-blocking issues from 4207 * fix for sample program. * edits * edit pass. Move to ide location * minor edit * fix link * Final update * final update * final update * resolving blocking issue * resolving blocking issue * ToC update for new article * ToC update * link update * Correct inconsistent formatting for the `_O_EXCL` constant in the docs for the open functions * Update c28195.md * Update in alt-text * Update in alt-text * Final Update- See also section * edit pass * edit pass * more cleanup * typo * small edit * Final update * edit pass * edit pass * formatting for scannability * acrolinx * one more try at spacing * final update * VMCS -> VMXON According to the intel IA32 development manual (Volume 3 C3 23.7): "Before executing VMXON, software should allocate a naturally aligned 4-KByte region of memory that a logical processor may use to support VMX operation. This region is called the VMXON region." * edit and add links * fix links * add code example * click->tick * Update date, link to Intel docs * Another go at updating the description * Fix stray double-quote * Address issue in DD PR 1393452 * add /interface and /internal-partition - draft (#4227) * add /interface and /internal-partition - draft * add example * fix formatting * update text regarding example * tech review * link updates * fix switch name and link * edits * reorder version info * cleanup * add /tp flag * fix command line Co-authored-by: TylerMSFT * Update os-ot-favor-small-code-favor-fast-code.md Change "minimize or maximize size" to "minimize size or maximize speed" * Expand into a whole SEO-friendly sentence * Clarify when _matherr will be invoked (#4230) Customer here https://developercommunity.visualstudio.com/t/_matherr-example-does-not-work-for-me/1676341#T-ND10016474 expressed confusion over when _matherr is called. This change points out that the only setting that will enable/disable this is the presence of _matherr, but it will not be triggered when using intrinsics. * acrolinx and other fixes * fix typo * more code escape * another code escape * better formatting for retval possibilities * fix backslashes * incorp feedback * SEO work * acrolinx * SEO work (#4234) * SEO work * acrolinx Co-authored-by: TylerMSFT * SEO work * incorp feedback * better link description * incorp review feedback * fix location of graphic Co-authored-by: Steve Wishnousky Co-authored-by: rachana-satao <83084319+rachana-satao@users.noreply.github.com> Co-authored-by: opbld15 Co-authored-by: Colin Robertson Co-authored-by: opbld16 Co-authored-by: opbld17 Co-authored-by: atikmapari <31974726+atikmapari@users.noreply.github.com> Co-authored-by: PRMerger19 Co-authored-by: Ming Ho <94572161+homing1@users.noreply.github.com> Co-authored-by: PRMerger5 Co-authored-by: Regan Downer <97987445+v-regandowner@users.noreply.github.com> Co-authored-by: Jonathan Emmett Co-authored-by: Tamara K <93546702+tamarakhader@users.noreply.github.com> Co-authored-by: TylerMSFT Co-authored-by: PRMerger17 Co-authored-by: Paula Miller Co-authored-by: Martin Storsjö Co-authored-by: Sunny Chatterjee Co-authored-by: Tyler Whitney Co-authored-by: Colin Cooper <72402153+v-ccolin@users.noreply.github.com> Co-authored-by: krispy Co-authored-by: PRMerger8 Co-authored-by: PRMerger10 Co-authored-by: Tech Stuff <103606018+teknixstuff@users.noreply.github.com> Co-authored-by: Dennis Rea Co-authored-by: Anna Huff <92125952+AnnaMHuff@users.noreply.github.com> --- ...eating-and-managing-visual-cpp-projects.md | 28 +++++++++---- docs/overview/visual-cpp-in-visual-studio.md | 40 +++++++++++-------- 2 files changed, 43 insertions(+), 25 deletions(-) diff --git a/docs/build/creating-and-managing-visual-cpp-projects.md b/docs/build/creating-and-managing-visual-cpp-projects.md index 318af9d3c64..d8014dfeff2 100644 --- a/docs/build/creating-and-managing-visual-cpp-projects.md +++ b/docs/build/creating-and-managing-visual-cpp-projects.md @@ -1,31 +1,37 @@ --- description: "Learn more about: creating and configuring Visual Studio C++ projects" title: "Visual Studio Projects - C++" -ms.date: 04/19/2022 +ms.date: 04/20/2022 helpviewer_keywords: ["Visual Studio C++ projects, creating", "projects [C++], creating", "Visual Studio C++ projects"] --- # Visual Studio projects - C++ 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 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). + +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) in Visual Studio 2017 and later. + ## Create a Visual Studio C++ project ::: moniker range=">=msvc-160" 1. Create a C++ project by choosing **File** > **New** > **Project**. -1. Set the **Language** to C++. -1. In the results list, you'll see a list of project templates. Filter the templates them by setting the **Platform** or **Project Type** and then by typing keywords into the search box. +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. ![Screenshot of the Create a new project wizard. The Console App project template is selected.](../build/media/vs2019-choose-console-app.png) +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" 1. Create a C++ project by choosing **File** > **New** > **Project**. -1. Choose **Visual C++** in the left pane. In the center pane, a list of project templates will appear: +1. Choose **Visual C++** in the left pane. In the center pane, a list of project templates appears: ![Screenshot of the New Project dialog, showing available project templates for C++ such as Windows Console Application.](../overview/media/vs2017-new-project.png "Visual Studio 2017 New Project Dialog") @@ -47,9 +53,13 @@ The solution file coordinates build dependencies when you have multiple related 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**. -## Add third party libraries to a 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. +## Add third-party libraries to a project + +Over 900 C++ open source libraries are available via 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. + + +There are also commercial third-party libraries that you can install. Follow their installation instructions. ## Set compiler options and build properties @@ -59,7 +69,9 @@ To configure build settings for a project, right-click on the project in **Solut 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). -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 doesn't. All errors and warnings will appear both in the Output Window and in the Error List when you build the 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 doesn't. All errors and warnings appear both in the Output Window and in the Error List when you build the project. + ![Screenshot of the Output window and Error list.](../overview/media/vs2017-output-error-list.png) diff --git a/docs/overview/visual-cpp-in-visual-studio.md b/docs/overview/visual-cpp-in-visual-studio.md index 2c58a4d8172..12a0c14023e 100644 --- a/docs/overview/visual-cpp-in-visual-studio.md +++ b/docs/overview/visual-cpp-in-visual-studio.md @@ -1,7 +1,7 @@ --- title: "C and C++ in Visual Studio" -description: "Learn how to use the Microsoft C/C++ compiler, code editor, and related tools in Visual Studio to develop programs for Windows, Linux, Android and iOS." -ms.date: 09/20/2021 +description: "Learn how to use the Microsoft C/C++ compiler and related tools to develop C++ and assembly programs for Windows, Linux, Android, and iOS." +ms.date: 04/20/2022 ms.technology: "cpp-ide" helpviewer_keywords: ["Visual C++, home page"] --- @@ -45,9 +45,9 @@ helpviewer_keywords: ["Visual C++, home page"] Microsoft Visual C++ (MSVC) refers to the C++, C, and assembly language development tools and libraries available as part of Visual Studio on Windows. These tools and libraries let you create Universal Windows Platform (UWP) apps, native Windows desktop and server applications, cross-platform libraries and apps that run on Windows, Linux, Android, and iOS, as well as managed apps and libraries that use the .NET Framework. You can use MSVC to write anything from simple console apps to the most sophisticated and complex apps for Windows desktop, from device drivers and operating system components to cross-platform games for mobile devices, and from the smallest IoT devices to multi-server high performance computing in the Azure cloud. -Visual Studio 2015, 2017 and 2019 can be installed side-by-side. You can use Visual Studio 2019 (compiler toolset v142) or Visual Studio 2017 (v141) to edit and build programs using the toolset from Visual Studio 2017 (v141) and Visual Studio 2015 (v140). +Visual Studio 2015, 2017, 2019, and 2022 can be installed side-by-side. You can use Visual Studio 2019 (compiler toolset v142) or Visual Studio 2017 (v141) to edit and build programs using the toolset from Visual Studio 2017 (v141) and Visual Studio 2015 (v140). -## What's New and Conformance History +## What's new for C++ in Visual Studio [What's New for C++ in Visual Studio](what-s-new-for-visual-cpp-in-visual-studio.md)\ Find out what's new in Visual Studio. @@ -64,7 +64,7 @@ Find feature-level language conformance status in the MSVC compiler by Visual St [Microsoft C/C++ change history 2003 - 2015](../porting/visual-cpp-change-history-2003-2015.md)\ Learn about the breaking changes in previous versions. -## Install Visual Studio and upgrade from earlier versions +## Install Visual Studio C++ and upgrade from earlier versions [Install C++ support in Visual Studio](../build/vscpp-step-0-installation.md)\ Download Visual Studio and install the Microsoft C/C++ toolset. @@ -78,7 +78,7 @@ Find out about different Visual Studio editions. [Supported platforms](supported-platforms-visual-cpp.md)\ Find out which platforms the Microsoft C/C++ compiler supports. -## Learn C++ +## Learn C++ using Visual Studio [Welcome back to C++](../cpp/welcome-back-to-cpp-modern-cpp.md)\ Learn more about modern C++ programming techniques based on C++11 and later that enable you to write fast, safe code and avoid many of the pitfalls of C-style programming. @@ -92,7 +92,7 @@ Start learning how to write C++ in Visual Studio. [Visual Studio C++ samples](visual-cpp-samples.md)\ Information about the C++ code samples provided by Microsoft. -## C++ development tools +## Visual Studio C/C++ development tools [Overview of C++ development in Visual Studio](overview-of-cpp-development.md)\ How to use the Visual Studio IDE to create projects, edit code, link to libraries, compile, debug, create unit tests, do static analysis, deploy, and more. @@ -112,10 +112,7 @@ Use SAL annotations or the C++ Core Guidelines checkers to perform static analys [Write unit tests for C/C++ in Visual Studio](/visualstudio/test/writing-unit-tests-for-c-cpp)\ Create unit tests using the Microsoft Unit Testing Framework for C++, Google Test, Boost.Test, or CTest. -## Write applications in C++ - -[Universal Windows Apps (C++)](../cppcx/universal-windows-apps-cpp.md)\ -Find guides and reference content on the Windows Developer Center. For information about developing UWP apps, see [Intro to the Universal Windows Platform](/windows/uwp/get-started/universal-application-platform-guide) and [Create your first UWP app using C++](/windows/uwp/get-started/create-a-basic-windows-10-app-in-cpp). +## Write C/C++ applications using Visual Studio [Desktop applications (C++)](../windows/desktop-applications-visual-cpp.md)\ Learn how to create traditional native C++ desktop applications for Windows. @@ -123,6 +120,9 @@ Learn how to create traditional native C++ desktop applications for Windows. [.NET programming with C++/CLI](../dotnet/dotnet-programming-with-cpp-cli-visual-cpp.md)\ Learn how to create DLLs that enable interoperability between native C++ and .NET programs written in languages such as C# or Visual Basic. +[Universal Windows Apps (C++)](../cppcx/universal-windows-apps-cpp.md)\ +Find guides and reference content on the Windows Developer Center. For information about developing UWP apps, see [Intro to the Universal Windows Platform](/windows/uwp/get-started/universal-application-platform-guide) and [Create your first UWP app using C++](/windows/uwp/get-started/create-a-basic-windows-10-app-in-cpp). + [Linux programming](../linux/index.yml)\ Use the Visual Studio IDE to code and deploy to a remote Linux machine for compilation with GCC. @@ -144,21 +144,27 @@ Connect to databases using ODBC and OLE DB. [Text and strings](../text/text-and-strings-in-visual-cpp.md)\ Learn about working with different text and string formats and encodings for local and international development. -## Languages reference +## C/C++ language reference [C++ language reference](../cpp/cpp-language-reference.md)\ The reference guide to the Microsoft implementation of the C++ programming language. +[C language reference](../c-language/c-language-reference.md)\ +The reference guide to the Microsoft implementation of the C programming language. + [C/C++ preprocessor reference](../preprocessor/c-cpp-preprocessor-reference.md)\ A common reference to the shared C and C++ language preprocessor. -[C language reference](../c-language/c-language-reference.md)\ -The reference guide to the Microsoft implementation of the C programming language. +[C++/CX language reference](/cpp/cppcx/visual-c-language-reference-c-cx)\ +The reference guide to the Microsoft extensions to the C++ language for creating C++ Universal Windows Platform apps, C++ Windows runtime components that can be consumed by JavaScript-based Windows apps, and Windows DirectX games and graphics-intensive apps. + +[C++/CLI language reference](https://www.ecma-international.org/wp-content/uploads/ECMA-372_1st_edition_december_2005.pdf)\ +The ECMA standard for the C++/CLI programming language. [Compiler intrinsics and assembly language](../intrinsics/compiler-intrinsics-and-assembly-language.md)\ Guides to the compiler intrinsics supported or implemented by the Microsoft C/C++ compilers on each platform. -## C++ Libraries in Visual Studio +## C/C++ libraries available in Visual Studio The following sections provide information about the different C and C++ libraries that are included in Visual Studio. @@ -186,11 +192,11 @@ Universal Windows Platform (UWP) apps and components. [.NET programming with C++/CLI](../dotnet/dotnet-programming-with-cpp-cli-visual-cpp.md)\ Programming for the common language runtime (CLR). -## Third-party open source C++ libraries +## Third-party open source C++ libraries in Visual Studio The cross-platform **vcpkg** command-line tool greatly simplifies the discovery and installation of over 900 C++ open source libraries. For more information, see [vcpkg](https://vcpkg.io/). -## Feedback and community +## Visual Studio C++ feedback and community [Microsoft Docs Q&A](/answers/topics/c%2B%2B.html)\ Microsoft Docs hosts searchable forums for questions and answers. Add a `C++` tag to your post for community assistance on C++-related issues.