3,608 questions with C++-related tags

Sort by: Updated
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,608 questions
asked 2024-06-20T05:49:21.9566667+00:00
mc 4,006 Reputation points
accepted 2024-06-20T13:21:44.6033333+00:00
mc 4,006 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,491 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,608 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,608 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,781 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,491 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,608 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,608 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,491 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,608 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,807 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,608 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,781 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,608 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,781 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,491 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,608 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,391 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,807 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,608 questions
asked 2024-06-16T06:08:44.82+00:00
zzzhhh 40 Reputation points
answered 2024-06-16T08:52:08.86+00:00
RLWA32 42,286 Reputation points
2 answers One of the answers was accepted by the question author.

Why isn't my c++ dll properly loading into my c# exe?

I'm continually getting this error message but I can't find the source. Here's a link to the .dll class I want to utilize: link And here's the c# class I'm calling it from: link

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,556 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,608 questions
asked 2024-06-13T13:31:40.4133333+00:00
Forrest Crawford 60 Reputation points
accepted 2024-06-14T22:23:38.3766667+00:00
Forrest Crawford 60 Reputation points
0 answers

Sending PCIe Message TLP (Vendor Defined Message) from windows Kernel mode driver

Hi, I'm trying to write a custom driver on windows 10 (with KMDF) to frame & send PCIe TLP packets to PCIe EndPoint with user-defined payload. I'm able to do PCIe CfgRead, CfgWrite operations with READ_REGISTER_ULONG and WRITE_REGISTER_ULONG APIs.…

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,807 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,608 questions
Windows Driver Kit (WDK)
Windows Driver Kit (WDK)
A set of Microsoft tools that are used to develop, test, and deploy Windows drivers.
42 questions
asked 2024-06-11T17:01:52.9166667+00:00
Srinath Prakash 0 Reputation points
edited the question 2024-06-14T09:19:58.2066667+00:00
Srinath Prakash 0 Reputation points
1 answer

Control Flow guard

Hello Team, Control flow guard is only for visual c++ based application or for all c++ compilers or it will works for all like c#, .net based application.

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,562 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,556 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,608 questions
asked 2024-06-07T11:13:32.64+00:00
Mashuk Raza 20 Reputation points
commented 2024-06-14T01:55:26.78+00:00
Minxin Yu 10,781 Reputation points Microsoft Vendor
0 answers

Problem signing a hash using the Wincrypt lib

Hello devs. I need to read the user certificates installed in Windows and use them to make a signature in a hash of a file previously calculated in sha256 with the private key of the chosen certificate. To do this, I developed the following code inspired…

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,608 questions
asked 2024-06-13T18:30:13.1666667+00:00
William Coelho 0 Reputation points
commented 2024-06-14T01:52:27.8266667+00:00
Minxin Yu 10,781 Reputation points Microsoft Vendor
1 answer

MAPIInitialize() fails with MS outlook 365

Hi I have an VC++ application which reads the emails from the MS outlook. Till now it was working fine till I was using MS outlook 2019/2016. But as soon as I upgraded my outlook to office 365 app, my application fails with outlook. below is the code…

Outlook
Outlook
A family of Microsoft email and calendar products.
3,304 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,608 questions
asked 2023-01-13T10:20:04.8566667+00:00
Mayank Agarwal 21 Reputation points
commented 2024-06-13T14:16:43.2066667+00:00
Subhasis Ghosh 0 Reputation points
2 answers One of the answers was accepted by the question author.

How to use c++ 20 modules in shared libraries ?

Hello everyone, I am currently working on a test-project where I want to use shared libraries and I would like to leverage the new C++20 modules feature. However, I am having some difficulty understanding how to properly set up my code to use C++20…

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,608 questions
asked 2024-05-10T19:22:17.17+00:00
Michael Brunner 40 Reputation points
commented 2024-06-13T09:44:16.2733333+00:00
Michael Brunner 40 Reputation points
1 answer

NotifyIpInterfaceChange function (netioapi.h) does not notify on manual DNS changes

I work on the c-ares open source asynchronous DNS library (https://c-ares.org) and we have recently added automatic configuration reloading when we detect a network configuration change has occurred. We get notifications properly when network…

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,989 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.
2,491 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,608 questions
asked 2024-06-05T16:21:55.43+00:00
Brad House 0 Reputation points
commented 2024-06-12T08:40:04.97+00:00
Gary Nebbett 5,841 Reputation points
1 answer

How to diable keyboard

I want to disable keyboard using toggle switch and these are my code I don't know what the command is to disable keyboard using toggle Switch. please help me I am beginner in Win UI (C++/CX & C++/WinRT). <! --xaml --> <ToggleSwitch…

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,608 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.
780 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,747 questions
asked 2024-06-08T14:59:37.5266667+00:00
Raman Singh 0 Reputation points
commented 2024-06-12T01:49:59.4466667+00:00
Minxin Yu 10,781 Reputation points Microsoft Vendor
1 answer One of the answers was accepted by the question author.

Why do I get this error when I run my project as a .DLL but not as a .EXE

I've got a .dll project in which I'm utilizing Direct 2D to draw on a window. For some reason, one line is continually giving me errors when I attempt to run it: // Create a Direct2D factory. hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED,…

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,491 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,608 questions
asked 2024-06-10T22:16:12.87+00:00
Forrest Crawford 60 Reputation points
commented 2024-06-11T10:31:13.3666667+00:00
David Lowndes 2,470 Reputation points MVP
1 answer

Why is my panning in Direct 2D drifting at the edge of the window?

I'm going through a windows tutorial for Direct 2D drawing a small picture on a render target and I decided to try to add pan and zoom capabilities. All is working mostly fine but I'm having an issue with the pan. My is supposed to move in sync with…

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,491 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,608 questions
asked 2024-06-07T01:27:46.7733333+00:00
Forrest Crawford 60 Reputation points
answered 2024-06-11T02:55:05.2066667+00:00
Xiaopo Yang - MSFT 12,071 Reputation points Microsoft Vendor