3,569 questions with C++-related tags

Sort by: Updated
1 answer One of the answers was accepted by the question author.

Program output is correct, but VS reports an error during step-by-step debugging

The C++ code snippet is: class A { public: A(const std::string& ss, const std::string& tt) : s(ss), t(tt) {} void func1() const { std::cout << s; } void func2() const { std::cout << t; } using Action = void (A::*)()…

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,711 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
954 questions
asked 2024-05-29T01:58:25.83+00:00
zzzhhh 20 Reputation points
accepted 2024-05-29T07:36:29.5333333+00:00
zzzhhh 20 Reputation points
3 answers

How does Windows' 'Game Controllers' properties connect to a joystick?

The situation: We need to use a new game controller (with a joystick only) hardware on Windows 10 IoT. In the properties of "Game Controllers", moving the joystick is visible in the displayed rectangle with the '+'. Our software using DirectX8…

Windows for IoT
Windows for IoT
A family of Microsoft operating systems designed for use in Internet of Things (IoT) devices.
382 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
asked 2024-05-28T14:57:32.6533333+00:00
Robin Holenweger 0 Reputation points
answered 2024-05-28T21:29:35.26+00:00
kwikc 131 Reputation points
2 answers

How to Detect Initial DPI changes in a WPF Application while Scaling according to Per Monitor Aware in Variable Dynamic Screen Resolution?

In daily life we have to deal with a lot of different types of display size it may be mobile or may be a 4k monitor. The screen resolution vary from display to display. Here another important factor is DPI (Display per inch) which is mainly a scaling…

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
4,864 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,689 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,404 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
asked 2024-05-27T23:46:16.7233333+00:00
MERUN KUMAR MAITY 531 Reputation points
commented 2024-05-28T20:28:49.73+00:00
MERUN KUMAR MAITY 531 Reputation points
1 answer

Expected behavior of an application launched through SSH in two different scenarios

Hi, I have a C++ application which can also runs as a Service. I am trying to launch my application on a remote machine from a client machine. For this, I am using the 'Open SSH' software. Want to understand what is the expected behaviour from the OS…

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
asked 2024-05-28T15:14:06.4566667+00:00
Rohan Pande 335 Reputation points
edited an answer 2024-05-28T16:16:34.89+00:00
Bruce (SqlWork.com) 58,126 Reputation points
0 answers

How to get Code Coverage in Visual Studio 2022 with CMake Cpp Projects with a Windows Compiler

I have a Cpp project that is being built with the MSVC compiler and using CMake. I need a code coverage solution, preferably one that either provides detailed reports or in Visual Studio code highlighting that is possible using CMake. So far I have tried…

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
332 questions
asked 2024-05-28T09:01:11.2366667+00:00
Hoad, Tom 0 Reputation points
commented 2024-05-28T13:37:45.93+00:00
Tianyu Sun-MSFT 27,981 Reputation points Microsoft Vendor
0 answers

winrt::Windows::Devices::Usb::UsbDevice::FromIdAsync throws exception on get

code sample: #include <guiddef.h> #include <windows.h> #include <ppltasks.h> #include <winrt/Windows.Foundation.Collections.h> #include <winrt/Windows.Foundation.h> #include…

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
asked 2024-05-28T08:54:29.7266667+00:00
Tunghohin 0 Reputation points
edited a comment 2024-05-28T11:44:51.5833333+00:00
Minxin Yu 10,436 Reputation points Microsoft Vendor
0 answers

How to access registry items under driver service registry key path of Win11 24H2 in a WDF driver?

I am currently utilizing a Kernel Mode Driver Framework (KMDF) driver, employing the RtlQueryRegistryValues function with parameters (RTL_REGISTRY_ABSOLUTE, L"\Registry\Machine\System\CurrentControlSet\Services...") to access specific registry…

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,557 questions
Windows Driver Kit (WDK)
Windows Driver Kit (WDK)
A set of Microsoft tools that are used to develop, test, and deploy Windows drivers.
20 questions
asked 2024-05-22T01:22:02.8666667+00:00
Jingshan Song (Jingshan) 5 Reputation points
edited a comment 2024-05-28T11:36:39.61+00:00
RLWA32 41,206 Reputation points
0 answers

Windows API's CreateFile with CFile gives invalid path error if used drives created with SUBST

A drive is created for a folder using SUBST command. We have a Windows application which reads contents of the and performs some operations. Application does not give any error when read the file path is from actual drive. But when try to read from drive…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,452 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
asked 2024-05-03T12:58:05.9266667+00:00
Dada Khalandhar Gooty 0 Reputation points
commented 2024-05-28T06:54:30.22+00:00
Jeanine Zhang-MSFT 9,266 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

How to resolve debug assertion error when calling dialog create function in mfc extension dll

I have code like below: m_pPreviewDlg.Create(IDD_DIALOG_PREVIEW); The error below occurs in this code. What is the solution? I am using visual studio 2022

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
asked 2024-05-23T06:32:49.1433333+00:00
채문석(jim) 41 Reputation points
commented 2024-05-28T06:40:36.9466667+00:00
채문석(jim) 41 Reputation points
2 answers One of the answers was accepted by the question author.

MFC Debug Assertion Failed (DLL Dialog Create Error)

I am trying to CREATE a dialog as MODALESS in a DLL. When DEBUGING is attempted, DEBUG ASSERTION FAILED LINE24 is output. What should I do? Code Example : extern "C" __declspec(dllexport) int CreateDlg() { CTestDlg *pDlg = new…

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
asked 2022-11-08T04:53:27.717+00:00
채문석(jim) 41 Reputation points
accepted 2024-05-28T06:38:54.35+00:00
채문석(jim) 41 Reputation points
1 answer One of the answers was accepted by the question author.

Visual Studio 2022- Couldn't install Microsoft.VisualCpp.Redist.14

I'm trying to install Desktop development with C++ for Visual Studio 2022. Attempting to install this using the Visual Studio Installer returns an error stating: Couldn't install Microsoft.VisualCpp.Redist.14 The log file mentions another log file that…

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,711 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
asked 2024-05-26T23:35:26.9733333+00:00
OldIslander 20 Reputation points
commented 2024-05-27T20:31:50.2966667+00:00
OldIslander 20 Reputation points
3 answers

Count logical liines in a text control

Hi, ALL, There is a EM_GETLINECOUNT, but it will count the number of text lines. I'm looking for to count the displayed lines (or wrapped lines) in a text control. Either using WinAPI or C++. Thank you.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
asked 2024-03-12T05:03:09.4833333+00:00
Igor Korot 6 Reputation points
edited a comment 2024-05-27T20:18:33.9933333+00:00
RLWA32 41,206 Reputation points
2 answers One of the answers was accepted by the question author.

.net8 windows form design view problem.

I am developing Revit addin in Vidual Studio in c++/cli as class library. Before moving to .net platform everyhing was working fine. But in .net Windows form design views doesnt work. Though when I add form element by code. It compiles and works. The…

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,711 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
asked 2024-05-04T19:10:34.6166667+00:00
Ahmet Haluk UZUNER 20 Reputation points
answered 2024-05-27T16:10:38.4833333+00:00
Ahmet Haluk UZUNER 20 Reputation points
1 answer One of the answers was accepted by the question author.

How to get list of all programs on system PATH that countain some characters in powershell/batch

So, i want to make a builder file for my C code, i use Clang compiler and wanted to link the Windows SDK's headers and make it multiplatform, so even VS 2015 is supported. I thought the easiest and best way will be to just find the programs that…

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,173 questions
asked 2024-05-24T07:33:56.0666667+00:00
Freziyt223 20 Reputation points
commented 2024-05-26T23:56:30.48+00:00
MotoX80 32,326 Reputation points
2 answers One of the answers was accepted by the question author.

Mixing net standard and visual c++

Hello Using VS 2017, can one have both net standard 2.0 and visual c++ projects in the same solution with the net standard project referencing the visual c++ project (.vsxproj)? If I create one solution containing two projects of this kind using VS 2017…

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,468 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
asked 2024-05-21T08:47:24.7566667+00:00
Flade, David 20 Reputation points
commented 2024-05-24T14:49:26.4533333+00:00
Flade, David 20 Reputation points
1 answer

How to Disable/Enable Audio Hardware Acceleration in Windows 11?

Hi there, I would like to Disable/Enable Audio Hardware Acceleration programmatically in Windows 11. Is there any way to implement it? Thanks. Best regards, Hank

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,404 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
asked 2024-05-21T07:19:37.4966667+00:00
Hank 0 Reputation points
commented 2024-05-23T13:30:04.0133333+00:00
Castorix31 82,126 Reputation points
1 answer

Application crashing -The process was terminated due to an unhandled exception.

Environment : OS Microsoft Windows Server 2019 Dotnet framework: 4.7 SQL : SQL Server 2019 Note: Previously our application was working fine in 2016 OS. Once we upgraded to OS 2019 we are facing below issue Application level - Event viewer log Faulting…

Windows Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,514 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
asked 2024-05-14T12:55:48.1233333+00:00
Chandra Bujankar 0 Reputation points
answered 2024-05-23T10:05:18.0633333+00:00
Wesley Li 5,485 Reputation points
0 answers

I got the error 0xc0000207 when calling FwpsConstructIpHeaderForTransportPacket

Hi , I am implementing a filter driver . I got the error 0xc0000207 when calling FwpsConstructIpHeaderForTransportPacket , I tried to rewrite the source IP of some packets, I could not find many documents to tell me what could cause this error . Could…

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,557 questions
asked 2024-05-23T08:11:41.15+00:00
Thao Hoang 0 Reputation points
edited the question 2024-05-23T08:31:24.2233333+00:00
Minxin Yu 10,436 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

NCryptCreatePersistedKey - Any property to set User Reauthentication before Access?

NCryptCreatePersistedKey has ability to set properties on the key. I have tested with UI settings for prompting for Allow/Deny. Also I have seen UI settings for PIN/Password. But I simply want the ability for a user to validate themselves like UAC before…

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,452 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
asked 2022-11-04T16:19:47.753+00:00
Merlin Avery 21 Reputation points
accepted 2024-05-23T02:06:56.3033333+00:00
Merlin Avery 21 Reputation points
1 answer One of the answers was accepted by the question author.

Get RecycleBin path

I am trying to get the RecycleBin path with the following code: std::wstring GetRecycleBinPath() { std::wstring path{}; SHGetSpecialFolderPathW(NULL, path.data(), CSIDL_BITBUCKET, FALSE); std::clog << ::GetLastError() << std::endl; return…

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,569 questions
asked 2024-05-21T14:36:52.1966667+00:00
Flaviu_ 931 Reputation points
accepted 2024-05-22T08:25:22.75+00:00
Flaviu_ 931 Reputation points