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 >…
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() {…
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…
![](https://techprofile.blob.core.windows.net/images/P9lwKcAJKUWy1Mb_13eoDw.png?8DB035)
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…
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
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.…
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.
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…
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…
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…
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…
![](https://techprofile.blob.core.windows.net/images/K747RUFoqkahjX7_nKUlcw.png?8D8E9F)
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…
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,…
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…
Error code "exited with code -1073741819"
I copied my C code from one window and paste it to another window of VS2019, then i debugged the program and i got the message "Test.exe exited with code -1073741819". I am unable to run the program so please help me out.
![](https://techprofile.blob.core.windows.net/images/Lg0FUg18lEeLq9rG475g5A.png?8DC89A)
How to use DrvDeviceCapabilities in winddiui.h (WITH winspool.lib added but LNK2019 unresolved external symbol STILL occured )
Function DrvDeviceCapabilities(winddiui.h) should be used if I want to identify a printer's color capability according to this link. But there is always a link error (LNK2019 unresolved external symbol ) though I added winspool.lib to Library Directories…
![](https://techprofile.blob.core.windows.net/images/_5e-jRvlCkWlkMrV8cdbJg.png?8D8365)
Cannot find how to get to this "Project Defaults" section "in the General pane in the Property Pages."
On this page in the documentation, it describes a "Project Defaults" section on some ephemeral "Debug Property Pages" page in some properties setting dialog, shown below: However, the documentation gives no explanation…
Database credential saved in memory.
Hello team, While testing thick client application. I dumped the memory from task manager and process hacker tools and I got database credentials. So How can I mitigate this issues in C++, C# and .net application. Please suggest and explain in details so…
Mitigation for Dll hijacking
Hello Team, I found dll injection in c#, .net and c++thick client applications. So what will be the standard mitigation to prevent dll injection. Please explain in details so that we can mitigate properly C#, .net, C++.
setting visual studio variables, such as VC_LibraryPath_x64 (AGAIN)
I asked this question previously. I received two replies, both of which suggested that the poster had not carefully read my question (and one of which provided incorrect and irrelevant feedback). So, I am reposting. To be clear. A) I have never…