Microsoft Q&A

C++

2,626 questions

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.

Browse all C++ tags

2,626 questions with C++-related tags

Sort by: Updated
0 answers

MSVC compiler hangs on user defined operator overload

I have header which sets some identifier and also holds some sub class also and for interoperability we have defined operator overloads for main class and all its sub classes. And sample code like below, it takes lot of time to compile this. And some…

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.
2,626 questions
Microsoft Build
Microsoft Build
A Microsoft platform for building applications with Visual Studio and .NET on Windows.
370 questions
asked 2023-02-02T12:37:30.34+00:00
Mohammad Mohsin Siddiqui 5 Reputation points
commented 2023-02-02T15:04:48.03+00:00
David Lowndes 4,231 Reputation points Microsoft MVP
1 answer One of the answers was accepted by the question author.

Windows Portable Devices can't re-create directory after deletion

Hi, I am using the documentation provided here: [https://learn.microsoft.com/en-us/windows/win32/wpd_sdk/wpd-application-programming-interface to create an interface to portable devices (Android device and memory sticks). I have implemented the provided…

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.
1,895 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.
2,626 questions
asked 2023-01-26T16:19:53.83+00:00
Guillaume Doucet 0 Reputation points
accepted 2023-02-02T11:59:46.1266667+00:00
Guillaume Doucet 0 Reputation points
2 answers

Bug in WIN32 API ReadConsoleW for UTF-16 surrogate pairs for echoed output ?!

Hello, I am developing an command line application which shall be able to fully support Unicode. To be able to do this, the application a) runs in modern "Windows Terminal" b) uses ReadConsoleW / WriteConsoleW instead of the C and C++…

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.
2,626 questions
asked 2023-01-12T17:53:08.0966667+00:00
Florian Thake 5 Reputation points
answered 2023-02-02T09:43:21.8733333+00:00
Xiaopo Yang - MSFT 5,851 Reputation points Microsoft Employee
2 answers

Error encrypting with CALG_AES_256

#include <wincrypt.h> #include <iostream> #include <system_error> #pragma comment(lib, "Crypt32.lib") unsigned char key[] = "123456789012"; int keylen=sizeof(key); int AES(const char * data, int data_len) { …

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.
1,895 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.
2,626 questions
asked 2023-01-31T23:19:06.1266667+00:00
Angel Gil 0 Reputation points
edited a comment 2023-02-02T08:50:43.8666667+00:00
Tong Xu - MSFT 101 Reputation points Microsoft Employee
3 answers

Class usage error- C++ Winforms

Hi friends I adapted a class that was in C# to C++ Winforms, but as I don't have much knowledge of classes, it's giving a problem using the class. Below is the class code. In the main program, I put this command line - ListViewColumnSorter…

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.
2,626 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
2,425 questions
asked 2023-01-31T21:58:45.4166667+00:00
José Carlos Souza 201 Reputation points
edited a comment 2023-02-02T08:27:03.6833333+00:00
Minxin Yu 3,096 Reputation points Microsoft Employee
0 answers

How to solve IE11 browser no response when i use activex plugin to show a modal dialog

Hello,I develop a Activex plugin with MFC and duilib。The main window is a class named PlayerCtrl,Inherit from COleControl。When I show a Modal Dialog with UI_WNDSTYLE_DIALOG style(show the dialog success) call a method of PlayerCtrl,IE11 browser(inclue…

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.
2,626 questions
asked 2023-02-02T03:12:11.06+00:00
俊杰 陈 0 Reputation points
edited the question 2023-02-02T06:34:13.8333333+00:00
ShiJieLi-MSFT 1,746 Reputation points Microsoft Employee
0 answers

MFC Background color

hi, I have a question about the background color of MFC. My code is as follows Mainfrm.h class C_MainFrame : public CFrameWnd { public: C_MainFrame(); // Declear Constructor }; Mainfrm.cpp include "MFCAppRun.h" include…

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.
1,895 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.
2,626 questions
asked 2023-01-09T20:13:23.133+00:00
bodhisatwa bhattacharya 1 Reputation point
commented 2023-02-02T02:49:41.1733333+00:00
bodhisatwa bhattacharya 1 Reputation point
0 answers

Firefox cannot run in an AppContainer

I have written a program with AppContainer, but when I try to run browsers in it, it doesn't run despite the permissions I gave.

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.
2,626 questions
asked 2023-02-01T12:16:32.6+00:00
Taha_r 0 Reputation points
commented 2023-02-02T02:25:48.32+00:00
Minxin Yu 3,096 Reputation points Microsoft Employee
0 answers

improper indention for c++ lambda in visual studio when auto formatting code

I have a function "func" which takes another function as its parameter. If I define a function with more than one line using lambda expression when calling "func", the auto formatting (ctrl+k,ctrl+d) seems to get confused. This is…

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.
2,626 questions
asked 2023-01-16T07:36:40.5733333+00:00
孟轩 郝 1 Reputation point
edited a comment 2023-02-02T01:45:55.66+00:00
YujianYao-MSFT 3,521 Reputation points Microsoft Employee
1 answer

Standard serial over Bluetooth link - select COM port

Hello, As mentioned in https://blog.bachi.net/?p=9700, Bluetooth SPP opens two ports when pairing a device: An incoming port is used when a remote device established a connection to your device, and is exposed as the SerialPort service to the remote…

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.
2,626 questions
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.
1,895 questions
asked 2023-02-01T16:53:27.3+00:00
Carlos Viescas 0 Reputation points
answered 2023-02-02T01:36:52.35+00:00
Jeanine Zhang-MSFT 4,966 Reputation points Microsoft Employee
1 answer

rcxdti.dll is required to compile DESIGNINFO resources

I've been using VS 2019 and 2017 with no issues until a few days ago, and there were no issues with dialog editing. But today suddenly to fix the dialog in VS 2019 and 2017 When I try to open a resource file, the following message appears. …

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.
2,626 questions
asked 2023-01-06T10:48:32.903+00:00
Kim, Dongsun 1 Reputation point
edited a comment 2023-02-01T09:40:33.7733333+00:00
YujianYao-MSFT 3,521 Reputation points Microsoft Employee
1 answer

Reinicialização espontânea sem permissão do usuário após atualização do Microsoft Visual C++ 2013 x86 Minimum Runtime - 12.0.40664

Boa tarde!   Na empresa em que trabalho, alguns computadores começaram a reinicializar sem a permissão do usuário e sem avisar antes. Investigando, em todos esses computador pudemos verificar a atualização do Microsoft Visual C++ 2013 x86 Minimum Runtime…

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
2,425 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.
2,626 questions
asked 2023-01-31T13:30:27.1166667+00:00
Gabriel Sager 0 Reputation points
answered 2023-02-01T02:12:37.5866667+00:00
YujianYao-MSFT 3,521 Reputation points Microsoft Employee
1 answer

Why microsoft publishes such uncomplete code?

https://learn.microsoft.com/en-us/windows/win32/controls/create-a-simple-list-box People are wasting time by reading this. Plesa make it complete or remove. `` typedef struct { TCHAR achName[MAX_PATH]; TCHAR achPosition[12]; int…

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.
1,895 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.
2,626 questions
asked 2023-01-31T09:57:14.5733333+00:00
Wojciech Sobiesiak 21 Reputation points
edited the question 2023-02-01T01:35:07.9+00:00
YujianYao-MSFT 3,521 Reputation points Microsoft Employee
4 answers

MS Rich Edit Control ("RICHEDIT50W") bug? Control does unnecessary font substitutions.

I am using the MS Rich Edit Control in my MFC Visual C++ application. Users can select certain symbols to insert into the text. I have had complaints that when they try to insert certain characters into the text, it switches to a different font, which…

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.
2,626 questions
asked 2022-12-06T14:28:00.727+00:00
simonx 86 Reputation points
commented 2023-01-31T18:37:05.21+00:00
simonx 86 Reputation points
1 answer

Windbg shows info dialog that it cannot open MFC code from devdiv.visualstudio.com

Windbg show this info dialog with below message when single stepping through MFC code: The file…

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.
2,626 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.
696 questions
asked 2023-01-31T07:31:16.9433333+00:00
Dev Stability 7 Reputation points
commented 2023-01-31T15:22:51.6333333+00:00
RLWA32 28,656 Reputation points
2 answers

WinUI3 : How to detect when user toggles aeroplane mode

Hi, I'm working of WinUI3 desktop application. Is there any way where we can detect when user toggles aeroplane mode. Is there any event which gets triggered when aeroplane mode is toggled I tried searching online but was not able to find any…

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
433 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.
2,626 questions
asked 2022-12-28T12:55:38.893+00:00
Anonymous
answered 2023-01-31T06:48:23.1933333+00:00
Junjie Zhu - MSFT 6,036 Reputation points Microsoft Employee
1 answer

Is there any way i can write a struct's default constructor in C++/CLI

// C3417.cpp // compile with: /clr /c value class VC { VC(){} // C3417 // OK static VC(){} VC(int i){} }; Here is the sample MS show us about error C3417.But in a spcial case, I have to write the struct's default constructor like…

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.
2,626 questions
asked 2023-01-18T19:10:29.7833333+00:00
Mage Luzdia 0 Reputation points
commented 2023-01-31T02:57:22.3533333+00:00
YujianYao-MSFT 3,521 Reputation points Microsoft Employee
2 answers

C++ array Designator Initializer does not work with MSVC compiler

I have code like below which gets compiled successfully with LLVM clang-cl but fails with MSVC compiler. I believe MSVS supports designator initializers for array and struct initialization. Please let us know how we can use designator initialization for…

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.
2,626 questions
asked 2023-01-30T05:06:57.45+00:00
Mohammad Mohsin Siddiqui 5 Reputation points
edited a comment 2023-01-30T09:42:31.16+00:00
Minxin Yu 3,096 Reputation points Microsoft Employee
0 answers

Bound ComboBox within a page and frame not working as expected - WinUI 3

Hi, i have a bound ComboBox which i've already posted here. I'm adding a separator by a TemplateSelector but to disable the separator, I have to iterate the ComboBoxItems in the Tapped event and set the IsEnabled property to false. This has to be…

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.
2,626 questions
Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
433 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
558 questions
asked 2023-01-24T18:47:43.97+00:00
youki 846 Reputation points
commented 2023-01-30T09:24:00.27+00:00
Junjie Zhu - MSFT 6,036 Reputation points Microsoft Employee
1 answer

How to see branch-misses and cache misses in Visual Studio 2022 C++?

In linux, we have "perf" command to see branch-misses. On windows, is there a corresponding tool to see branch-misses and cache misses of a C++ program?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
2,425 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.
2,626 questions
asked 2023-01-28T02:57:52.46+00:00
卉航 林 0 Reputation points
answered 2023-01-30T08:54:17.6866667+00:00
Tianyu Sun-MSFT 13,071 Reputation points Microsoft Employee