Visual Studio 2015 & 2017 doesn't recognize std
Hello, I've written simple piece of code which compiles and works perfectly on any other program which can compile and run C++, but when I try to run it from VS 2015 on my laptop or on VS 2017 from my other laptop, it won't build it - I get an error…
[Asan] Getting assert on launch of application "The application was unable to start correctly(0xc0000142). Click OK to close the application."
[Asan] Getting assert on launch of application "The application was unable to start correctly(0xc0000142). Click OK to close the application." Assert Image mentioned below: image_assert.png Resolved Call Stack mentioned in Microsoft Visual…
The QueryVirtualMemoryInformation function fails in 32-bit mode because the WIN32_MEMORY_REGION_INFORMATION structure is defined incorrectly.
For the record, I have Windows 11, "Version 10.0.22631 Build 22631". The WIN32_MEMORY_REGION_INFORMATION structure is defined in "memoryapi.h" as the following: typedef struct WIN32_MEMORY_REGION_INFORMATION { PVOID…
![](https://techprofile.blob.core.windows.net/images/_5e-jRvlCkWlkMrV8cdbJg.png?8D8365)
How to detect scale factor in Windows 10 in C++
I am trying to detect the display scale factor in Windows 10 in C++. Below is the code I am using. //Code to detect scale void getDisplayScale(double &h_Scale, double &v_Scale) { //auto activeWindow = GetActiveWindow(); HWND…
Device Manager does not show 'Bus Reported Device Description'
Hi, i need the device description for my APP, but unfortunately appropriate API calls does not return anything and by investigating the device manager it does not show up either. I am searching the USB enumeration list until the correct vid pid and a…
Windows API's CreateFile with CFile gives invalid path error if used drives created with SUBST
A drive is created for a folder using SUBST command. We have a Windows application which reads contents of the and performs some operations. Application does not give any error when read the file path is from actual drive. But when try to read from drive…
How do I display a transparent custom bitmap on a toolbar button in a Win32 C++ app?
I'm trying to add a button with a custom transparent bitmap to a toolbar in my Win32 C++ app. I'm using the following code to create and populate the toolbar. toolBar = CreateWindowEx(0, TOOLBARCLASSNAME, nullptr, WS_CHILD, 0, 0, 0, 0, hwnd,…
![](https://techprofile.blob.core.windows.net/images/uTGXggAAAwAAAAAAAAAAAA.png?8D9E5E)
Application crash even on a try catch block
When i comment out the line GetViewsByZOrder i get the following exception: Exception thrown at 0x00007FF96E36EE19 (rpcrt4.dll) in : 0xC0000005: Access violation reading location 0x00000000094F0122. On the line if (collection->GetViewForHwnd(hwnd,…
Porting SetTransform function in DirectX 9 to DirectX 11 or 12
Iam porting an existing project with DirectX 9 to DirectX 11 or 12, I am trying to port the function SetTransform from DirectX 9, there is no reference found in DirectX 11 or 12, please kindly suggest where to find the above function and how to define…
GDI+ PrivateFontCollection::AddMemoryFont failed to load fonts
GDI+ PrivateFontCollection::AddMemoryFont fails to load fonts and returns a status of InvalidParameter = 2. I made sure that my resources were correct as I also saved them locally, but the ttf fonts are correct. What is the problem please? My code and…
![](https://techprofile.blob.core.windows.net/images/1P-HevJX50CFOQJZsnsiMg.png?8D86C2)
Disable windows shortcuts for high contrast and mouse keys
I need to block keyboard shortcuts "alt + shift + prtscr" and "alt + shift + numlk". How to do it with LL Keyboard hook? Help much appreciated !
Expected behavior of an application launched through SSH in two different scenarios
Hi, I have a C++ application which can also runs as a Service. I am trying to launch my application on a remote machine from a client machine. For this, I am using the 'Open SSH' software. Want to understand what is the expected behaviour from the OS…
Program output is correct, but VS reports an error during step-by-step debugging
The C++ code snippet is: class A { public: A(const std::string& ss, const std::string& tt) : s(ss), t(tt) {} void func1() const { std::cout << s; } void func2() const { std::cout << t; } using Action = void (A::*)()…
How to get Code Coverage in Visual Studio 2022 with CMake Cpp Projects with a Windows Compiler
I have a Cpp project that is being built with the MSVC compiler and using CMake. I need a code coverage solution, preferably one that either provides detailed reports or in Visual Studio code highlighting that is possible using CMake. So far I have tried…
winrt::Windows::Devices::Usb::UsbDevice::FromIdAsync throws exception on get
code sample: #include <guiddef.h> #include <windows.h> #include <ppltasks.h> #include <winrt/Windows.Foundation.Collections.h> #include <winrt/Windows.Foundation.h> #include…
How to resolve debug assertion error when calling dialog create function in mfc extension dll
I have code like below: m_pPreviewDlg.Create(IDD_DIALOG_PREVIEW); The error below occurs in this code. What is the solution? I am using visual studio 2022
MFC Debug Assertion Failed (DLL Dialog Create Error)
I am trying to CREATE a dialog as MODALESS in a DLL. When DEBUGING is attempted, DEBUG ASSERTION FAILED LINE24 is output. What should I do? Code Example : extern "C" __declspec(dllexport) int CreateDlg() { CTestDlg *pDlg = new…
Count logical liines in a text control
Hi, ALL, There is a EM_GETLINECOUNT, but it will count the number of text lines. I'm looking for to count the displayed lines (or wrapped lines) in a text control. Either using WinAPI or C++. Thank you.
![](https://techprofile.blob.core.windows.net/images/_5e-jRvlCkWlkMrV8cdbJg.png?8D8365)
.net8 windows form design view problem.
I am developing Revit addin in Vidual Studio in c++/cli as class library. Before moving to .net platform everyhing was working fine. But in .net Windows form design views doesnt work. Though when I add form element by code. It compiles and works. The…
How to get list of all programs on system PATH that countain some characters in powershell/batch
So, i want to make a builder file for my C code, i use Clang compiler and wanted to link the Windows SDK's headers and make it multiplatform, so even VS 2015 is supported. I thought the easiest and best way will be to just find the programs that…
![](https://techprofile.blob.core.windows.net/images/jlnP0GQIrkyC1UBAGTIvLA.png?8DC7D8)
![](https://techprofile.blob.core.windows.net/images/pxpvXcfHUkGs_31NHERBiA.png?8D83C7)