3,629 questions with C++-related tags

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

How can I get apps on different platforms to communicate?

I wonder if there is anyone out there who can help me with a solution to an application I want to create.  This solution will contain two separate platforms, communicating with each other via network, serial ports, or something else. The first platform…

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,627 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,629 questions
asked 2024-06-24T15:11:27.5633333+00:00
Chuck Kvasnicka 40 Reputation points
accepted 2024-06-27T17:12:29.2533333+00:00
Chuck Kvasnicka 40 Reputation points
2 answers

VS can't find the header file located at obvious position

As you can see, I placed game.h in the header file filter and hecate.cpp in the source file filter. The hecate.cpp file includes game.h, but it shows an error indicating that the game.h file is not found. How can Visual Studio make such an obvious…

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,871 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,629 questions
asked 2024-06-27T05:58:12.2966667+00:00
凌辉 丁 0 Reputation points
answered 2024-06-27T10:44:05.1733333+00:00
RLWA32 43,051 Reputation points
1 answer One of the answers was accepted by the question author.

Need to get real OS Version

Hi need to get the real OS Version of the current machine in C++. Essentially I need something similar to "GetVersionExW", but a version of it that: Is not deprecated Does not require the application to be explicitly manifested…

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,515 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,629 questions
asked 2021-10-19T07:34:36.423+00:00
t miguel 21 Reputation points
commented 2024-06-26T17:15:09.58+00:00
RLWA32 43,051 Reputation points
2 answers One of the answers was accepted by the question author.

Disabling autocompletion from anything else than Tab in VS 2022

Although I set "Default IntelliSense completion mode" to Tab-only in Text Editor/Advanced, Visual Studio keeps replacing text as I type with its first suggestion when I press e.g. space or dot. I do not want the editor to ever autocomplete…

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,871 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,629 questions
asked 2024-06-18T09:34:12.84+00:00
Coco_l_asticot 20 Reputation points
accepted 2024-06-25T08:23:54.19+00:00
Coco_l_asticot 20 Reputation points
4 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.
383 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,629 questions
asked 2024-05-28T14:57:32.6533333+00:00
Robin Holenweger 0 Reputation points
answered 2024-06-25T08:05:48.2566667+00:00
Robin Holenweger 0 Reputation points
1 answer One of the answers was accepted by the question author.

error C2039: 'string_view': is not a member of 'std'

I have installed a fresh VS2022 (community). I created a MFC app, and I compiled and worked fine. I put the following line of code, in a header, lets say class CMFCApplication1Doc : public CDocument: // MFCApplication1Doc.h : interface of the…

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,629 questions
asked 2024-06-24T13:36:57.3133333+00:00
Flaviu_ 971 Reputation points
accepted 2024-06-25T07:24:46.0533333+00:00
Flaviu_ 971 Reputation points
2 answers One of the answers was accepted by the question author.

System.IO.SerialPort throws System.PlatformNotSupportedException when calling from c++, but not from c#.

I have a perplexing issue with the System.io.Ports package in a Class Library I built using c#/.NET6. I suspect it is a misconfiguration, but I'm not seeing much helpful documentation thus far on StackOverflow. As some background, I must support an old…

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,627 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,629 questions
asked 2023-04-21T16:22:45.1233333+00:00
Michael Bower [emkaTech] 20 Reputation points
commented 2024-06-24T16:22:51.4+00:00
Edi Ben 0 Reputation points
1 answer One of the answers was accepted by the question author.

how to reduce size in c++?

I used just one func in lib. but if I do not use this func the size may be 30kb if I use it is 150kb but I just use one not all. the .h file is very big. 331kb how to reduce unused codes? I am creating dll

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,629 questions
asked 2024-06-22T02:38:27.61+00:00
mc 4,111 Reputation points
accepted 2024-06-23T05:22:10.3866667+00:00
mc 4,111 Reputation points
1 answer One of the answers was accepted by the question author.

C++20 Modules in Shared Libraries

Hello, Follow-up question to https://learn.microsoft.com/en-us/answers/questions/1665106/how-to-use-c-20-modules-in-shared-libraries I’ve been exploring the use of C++20 modules in shared libraries and I understand the typical approach involves providing…

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,629 questions
asked 2024-06-13T09:43:29.3+00:00
Michael Brunner 40 Reputation points
edited a comment 2024-06-21T05:58:18.0433333+00:00
Minxin Yu 10,871 Reputation points Microsoft Vendor
2 answers 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,871 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,629 questions
asked 2024-05-26T23:35:26.9733333+00:00
OldIslander 25 Reputation points
edited an answer 2024-06-20T17:57:51.18+00:00
Rajesh Rohan 0 Reputation points
1 answer One of the answers was accepted by the question author.

can not use static library (.lib) which is created by .net?

I created static library using .net with publishAOT dotnet publish -r -win-x64 -release /p:NativeLib=Static then I create dynamic library in c++ (.dll) and want to use this library but it seems can not . #pragma…

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,629 questions
asked 2024-06-20T05:49:21.9566667+00:00
mc 4,111 Reputation points
accepted 2024-06-20T13:21:44.6033333+00:00
mc 4,111 Reputation points
0 answers

Documentation clarification for MF_MT_AUDIO_AVG_BYTES_PER_SECOND for AAC encoder

The documentation here: https://learn.microsoft.com/en-us/windows/win32/medfound/aac-encoder States that for AAC encoding the valid values for **MF_MT_AUDIO_AVG_BYTES_PER_SECOND **are 12000, 16000, 20000, 24000. It then says that * 6 those values should…

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,515 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,629 questions
asked 2024-06-19T03:01:32.6166667+00:00
mb 0 Reputation points
commented 2024-06-20T02:54:33.68+00:00
Jeanine Zhang-MSFT 9,431 Reputation points Microsoft Vendor
2 answers

How to initialize inner class that has a c-tor with more than one parameter

Hi to all, I'm trying to write a simple code and it won't compile! Any ideas? #include <stdio.h> class RegClass { public: RegClass(int param, char * theName) { printf("c-tor (%d,%s)\r\n", param, theName); } }; class Test { public: 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.
3,629 questions
asked 2024-06-18T14:25:23.7266667+00:00
S. Beniashvili 20 Reputation points
edited an answer 2024-06-19T01:16:49.1366667+00:00
Minxin Yu 10,871 Reputation points Microsoft Vendor
2 answers One of the answers was accepted by the question author.

Direct2D drawing quality is inconsistent

This is the result drawn in the window(HwndRenderTarget) This is the result of drawing in WicBitmapRenderTarget

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,515 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,629 questions
asked 2024-06-17T03:24:16.3466667+00:00
HoWe Yu 41 Reputation points
accepted 2024-06-18T17:43:56.8966667+00:00
HoWe Yu 41 Reputation points
1 answer One of the answers was accepted by the question author.

How to initialize inner class that has a c-tor with parameters

Hi to all, I'm trying to write a simple code and it won't compile! Any ideas? #include <stdio.h> class RegClass { public: RegClass(int param) { printf("c-tor (%d)\r\n", param); } }; class Test { public: int a; RegClass Reg(5); }; 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.
3,629 questions
asked 2024-06-18T12:50:32.0766667+00:00
S. Beniashvili 20 Reputation points
commented 2024-06-18T13:14:35.3733333+00:00
S. Beniashvili 20 Reputation points
0 answers

Finding window element using MSAA

I'm trying to detect the "Previous" and "Next" buttons of the Spofity MiniPlayer window using MSAA, however, sometimes these buttons don't get detected, I don't understand why, it's like luck, I need to reopen the window uncountable…

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,515 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,629 questions
asked 2024-06-14T20:07:42.4333333+00:00
Laila 0 Reputation points
commented 2024-06-18T07:55:27.1+00:00
Jeanine Zhang-MSFT 9,431 Reputation points Microsoft Vendor
2 answers

How to modify the value of a preprocessor based on the value returned by a command or script?

On visual Studio 2022 how to have a preprocessor value defined based on the result returned by a script? What i tried: Solution Explorer > Properties > Build Events > Pre-Build Event > Command Line > "python script.py >…

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,871 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,629 questions
asked 2024-06-14T00:07:35.4566667+00:00
Leo Purktz 0 Reputation points
commented 2024-06-18T06:53:51.6766667+00:00
Minxin Yu 10,871 Reputation points Microsoft Vendor
2 answers

C++ Inner class construction problem

Hi to all, I can't figure out what is the problem with the following simple C++ code! the inner RegClass class within Test class won't construct. Any ideas? #include <stdio.h> class RegClass { public: RegClass() {…

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,629 questions
asked 2024-06-17T15:32:34.9566667+00:00
S. Beniashvili 20 Reputation points
answered 2024-06-18T02:17:27.5266667+00:00
Minxin Yu 10,871 Reputation points Microsoft Vendor
0 answers

How to Utilize SetColor(Windows::UI::Colors::Red) from a Non-UWP and Non-C++/WinRT DLL File

Hi, I have developed a C++ DLL without utilizing UWP or C++/WinRT. Within this DLL, I am employing Windows::Devices::Lights::LampArray^ lamp to retrieve information about the lamp, such as lamp->IsConnected, lamp->LampCount, and…

Universal Windows Platform (UWP)
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,515 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,629 questions
asked 2024-06-16T19:14:55.05+00:00
sunil maurya 21 Reputation points
edited a comment 2024-06-17T09:52:58.8666667+00:00
Junjie Zhu - MSFT 16,551 Reputation points Microsoft Vendor
3 answers

There is a red wavy line but there is no error. Bug or settings?

void ff(int* p) { std::cout<< *p; }; void ff(unsigned int i) { i++; } void func(void (&&fp)(int*)) { int i = 6; fp(&i); } //no other overloaded versions of func ...... func(ff); I compiled with no error or warning, but there is 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,871 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,629 questions
asked 2024-06-16T06:08:44.82+00:00
zzzhhh 40 Reputation points
answered 2024-06-16T08:52:08.86+00:00
RLWA32 43,051 Reputation points