Microsoft C++, C, and Assembler Documentation

repository·main·Indexed 23 days ago

https://github.com/microsoftdocs/cpp-docs

Technical documentation for Microsoft C++, C, and Assembler. Includes guides for the Microsoft Macro Assembler (MASM) for x64 (ml64.exe), including Unwind Version 3 and address size overrides, as well as ATL reference material such as the CRegKey class for Windows system registry manipulation.

Tokens
213.2K
Snippets
613
Records
1.2K
Agent score
81%

What's inside Microsoft C++, C, and Assembler

  1. Overview of Microsoft C++ (MSVC) development

    main

    Microsoft C++ (MSVC) provides the C++, C, and assembly language development tools and libraries used within Visual Studio on Windows.

    Key Capabilities:

    • Application Types: Create native Windows desktop and server applications, Universal Windows Platform (UWP) apps, or managed apps/libraries using the .NET Framework.
    • Cross-Platform: Develop libraries and apps that run on Windows, Linux, Android, and iOS.
    • Target Hardware: Supports everything from small IoT devices to high-performance computing in the Azure cloud.
    • Side-by-Side Installation: You can install multiple versions of Visual Studio (e.g., 2015, 2017, 2019, 2022) side-by-side. This allows you to use a newer IDE to edit and build projects using older compiler toolsets (e.g., using Visual Studio 2019 to build with the v140 toolset from Visual Studio 2015).
  2. CGopherFileFind Class Overview

    main

    The CGopherFileFind class is used to aid in Internet file searches on Gopher servers. It inherits from CFileFind and provides a mechanism to locate files, retrieve file metadata (like creation and access times), and iterate through search results on a Gopher server.

    Note: This class and its related classes (CGopherConnection, CGopherFile, CGopherLocator) are deprecated because they do not work on the Windows XP platform, though they remain functional on earlier platforms. The MFC library is supported but no new features are being added.

  3. Use the C++ REST SDK (Casablanca) for cross-platform REST services

    main

    The C++ REST SDK (code name "Casablanca") provides a modern, asynchronous API for interacting with REST services across multiple platforms (Windows, Linux, OSX, Android, and iOS).

    Key capabilities:

    • REST Calls: Perform calls against any HTTP server with built-in JSON parsing and serialization.
    • Authentication: Supports OAuth 1 and 2, including a local redirect listener.
    • WebSockets: Establish WebSocket connections against remote services.
    • Asynchronous Model: Uses a fully asynchronous task API based on PPL (Parallel Patterns Library) with a built-in thread pool.
  4. Use the CRegKey class to manipulate the system registry

    main

    CRegKey is an ATL class used to create, open, delete, and modify entries in the Windows system registry. It provides a wrapper around registry handles (HKEY).

    Key Capabilities

    • Key Management: Create new keys (Create), open existing keys (Open), delete keys (DeleteSubKey), or delete keys and all their subkeys (RecurseDeleteKey).
    • Value Management: Retrieve data of various types (QueryDWORDValue, QueryStringValue, QueryBinaryValue, etc.) and set new values (SetDWORDValue, SetStringValue, etc.).
    • Lifecycle: Attach an existing HKEY to the object (Attach), or detach the handle without closing it (Detach).

    Important Constraints

    • Windows Runtime: This class and its members cannot be used in applications executing in the Windows Runtime.
    • Security: When using methods that specify registry locations, ensure you validate the data, as it may be untrusted. Methods using RegQueryValueEx do not explicitly handle null-terminated strings; your code must check for this.
    • Flushing: When you call Close(), registry data is flushed to the disk. This can take several seconds. Avoid calling RegFlushKey unless absolutely necessary as it is resource-intensive.
    class CRegKey
  5. C++ IntelliSense improvements

    main

    Recent updates to C++ IntelliSense include:

    • Improved navigation and syntax highlighting for types from imported Modules and Header Units.
    • Optimized cached header usage and symbol database access for faster load times.
    • The IntelliSense Code Linter for C++ is enabled by default, providing real-time suggestions and fixes.
    • Support for CMake projects using presets with a display name.
  6. CFtpFileFind Class

    main

    CFtpFileFind is an MFC class used to aid in Internet file searches on FTP servers. It inherits from CFileFind and provides specialized functionality for locating files via the FTP protocol. It can be used to begin a search, iterate through files, and retrieve the URL of found files.

    Requirements:

    • Header: afxinet.h
    • Inheritance: CObject -> CFileFind -> CFtpFileFind
  7. Supported C++ Platforms in Visual Studio

    main

    Visual Studio supports development for the following platforms:

    • Windows Desktop
    • Universal Windows Platform (UWP): Targets tablet, PC, Xbox, IoT, and HoloLens.
    • Linux
    • Android
    • iOS
    IMPORTANT

    Starting with Visual Studio 2026 (version 18.0), the Mobile development with C++ workload for iOS and Android, as well as Embedded and IoT tools (RTOS Viewer, Serial Monitor, Peripheral Viewer, and ST Project Import), are no longer supported and will be removed in a future update. However, the Android NDKs included in the Mobile development with C++ workload remain supported.

  8. Benefits of GitHub Copilot agents for C++ modernization

    main

    GitHub Copilot agents (Modernization and Debugger agents) accelerate the upgrade of legacy C++ projects by providing:

    • Automated problem detection: Systematically identifying breaking changes, deprecations, and compatibility issues.
    • Intelligent solutions: Proposing code changes tailored to your specific codebase context rather than generic fixes.
    • Efficiency: Reducing manual effort by handling both build-time errors and runtime issues.
    • Flexible modes: Supporting both guided (hands-on) and fully automated execution.
    • Adaptive learning: Discovering hidden issues and adjusting the approach as the modernization progresses.