Microsoft Q&A

C++

2,622 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,622 questions with C++-related tags

Sort by: Updated
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…

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
2,414 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,622 questions
asked 2023-01-31T21:58:45.4166667+00:00
José Carlos Souza 201 Reputation points
answered 2023-02-01T10:40:52.9633333+00:00
José Carlos Souza 201 Reputation points
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,622 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
0 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,893 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,622 questions
asked 2023-01-31T23:19:06.1266667+00:00
Angel Gil 0 Reputation points
commented 2023-02-01T08:10:03.6733333+00:00
Tong Xu - MSFT 101 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,414 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,622 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

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,893 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,622 questions
asked 2023-01-26T16:19:53.83+00:00
Guillaume Doucet 0 Reputation points
commented 2023-02-01T01:48:52.4933333+00:00
Jeanine Zhang-MSFT 4,891 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…

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,622 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,893 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,622 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,622 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,651 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…

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,622 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.
432 questions
asked 2022-12-28T12:55:38.893+00:00
Anonymous
answered 2023-01-31T06:48:23.1933333+00:00
Junjie Zhu - MSFT 5,961 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,622 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,622 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…

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.
432 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,622 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.
557 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 5,961 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,414 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,622 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 12,921 Reputation points Microsoft Employee
1 answer

how to change font of dialog title in mfc application

I want to change font of all the dialog elements of a MFC application including menu and title bar, without effecting icons and close button on the title bar. overriding WM_NCPAINT requires title bar to be repainted. is it posible to change only font of…

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,622 questions
asked 2023-01-27T08:35:33.4466667+00:00
Roshni 21 Reputation points
commented 2023-01-30T08:18:08.08+00:00
YujianYao-MSFT 3,521 Reputation points Microsoft Employee
0 answers

visual studio 2013 not installed environment error

Error 0xc000007b when running the application. It is an application made with c++ MFC, and the error occurred when only visual studio 2019 was installed and used after being built and used in the visual studio 2013 environment. Even after installing…

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,622 questions
asked 2023-01-10T00:33:37.217+00:00
jihun kang 1 Reputation point
edited the question 2023-01-30T07:55:07.4333333+00:00
Jayce Yang-MSFT 161 Reputation points Microsoft Employee
1 answer

Netusergetinfo API works only if the user has Admin or group access. Is there any other Microsoft API which works without this privileges?

In general, the user must have admin access or group access for using Windows Active Directory. From customer log, we confirmed that they do not have such access.  Since the user do not have the privileges, it fails in the NetUSerGetInfo API call and…

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,893 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,622 questions
asked 2023-01-20T13:54:03.3033333+00:00
Cmp Sowmya 0 Reputation points
edited an answer 2023-01-30T07:54:59.3366667+00:00
Junjie Zhu - MSFT 5,961 Reputation points Microsoft Employee
1 answer

VS C++ converting int to char (string)

Hello. I have a problem with such thing. Output is as show at the bottom of page. Can anyone know how to show text inside the edit window as number? (and how to get a number from window as text) Help pages on the internet are not readable. The output is…

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,893 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,622 questions
asked 2023-01-28T11:40:41.69+00:00
Wojciech Sobiesiak 21 Reputation points
edited the question 2023-01-30T05:08:21.13+00:00
Tianyu Sun-MSFT 12,921 Reputation points Microsoft Employee
3 answers

Error loading design. C++ Winform

Hi, I am not able to load the design of a form, but the program works perfectly. It gives error object reference not set to instance of an object. But it doesn't show what error, line, etc. How to see the design again? Tkd

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,622 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,414 questions
asked 2023-01-26T17:35:46.89+00:00
José Carlos Souza 201 Reputation points
answered 2023-01-30T03:02:54.25+00:00
Minxin Yu 3,096 Reputation points Microsoft Employee
0 answers

Visibility of class in the function argument

Hello This code below does not compile with VC++, although it compiles fine with gcc foo.h template<int TDegree> class Base { public: static const int dim = 3; }; template<int TDim> class Vector {}; template<int TDegree> class Foo…

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,622 questions
asked 2023-01-18T15:27:48.87+00:00
Hoang-Giang Bui 0 Reputation points
commented 2023-01-30T02:46:48.29+00:00
YujianYao-MSFT 3,521 Reputation points Microsoft Employee
0 answers

System.exception when I create a CUDA Runtime project in VS 2022

When i try to create a CUDA 12.0 Runtime project i get System.exception. If I look in the directory there are only the .sln and the .vcxprj files. Cuda seems to work fine. cuda version: 12.0 windows 10

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
2,414 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,622 questions
asked 2023-01-29T14:13:52.6866667+00:00
Parents99 0 Reputation points
commented 2023-01-30T01:54:40.4033333+00:00
Minxin Yu 3,096 Reputation points Microsoft Employee