If you’re developing native applications for Windows using Win32 or MFC and you want to support high DPIs so that the application looks crisp on any display, you have to do a lot of things by hand. That is because the technologies for building native UIs, that is MFC, GDI, GDI+, do not provide DPI scaling support. In this article, I will walk through some of the problems of supporting DPI scaling and the solutions for them.
In the previous articles, we learned how to perform navigation in a Windows desktop application and how navigation events work. However, until recently, it was not possible to perform POST or GET request using custom headers or content. This feature was added in version 705.50. In this fourth article of the series, we will look in detail at how to perform POST requests with custom headers and content.
I recently migrated an old VC++ project to use the Visual Studio 2017 toolset and when compiling I run into the following errors about redefining the structure tagTOUCHINPUT.
Unit testing is usually used for testing public types and members. However, there are cases when you might need to test types or members that are not public. These could be internal classes or private helper methods, for instance. Whether that is proper unit testing or beyond its scope is not a discussion that I want to get into here. However, in this post, I will show how you can unit test non-public types and members from .NET assemblies.
When faced with the need for testing non-public types and members you can use several approaches:
- change the accessibility to public; you can do that perhaps only for debug builds and keep the intended accessibility in release builds by using conditional compilation.
- provide public members of a class that invoke private ones;
- use reflection.
The first solutions involve changing the API only for the sake of the testing. The last solution avoids that but requires more work. To help with that, the Visual Studio unit testing framework provides some helper types that enable you to focus on the actual testing and be less concerned about the reflection details.
I recently installed a fresh copy of Visual Studio 2017 on a new machine and went on to build several projects some of them being VC++. The trouble was that I immediately run into a problem (actually the first problem was that MFC & ATL were missing because I forgot to check that in the list of Individual components so I had to install them separately). The problem was an error with a missing new.h header:
1>c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.15.26726\atlmfc\include\afx.h(62): fatal error C1083: Cannot open include file: 'new.h': No such file or directory
Here is my list of good reads from June:
Here is my list of good reads from May: Non-Ownership and Generic Programming and Regular types, oh my! Using C++17 std::optional Error Handling and std::optional std::accumulate vs. std::reduce How to Make SFINAE Pretty – Part 1: What SFINAE Brings to Code How to Make SFINAE Pretty – Part 2: the Hidden Beauty of SFINAE How…
curl is a project containing a command line tool and a library that can be used to transfer data using a variety of protocols, including, of course, HTTP and HTTPS. The library API is written in C, but there are various C++ wrappers on top of it. One of those is curlcpp. In this article, I will show how to build these libraries for Windows with Visual Studio.
I used to have several open-source projects available on CodePlex. At the end of 2017, the site was put in read-only mode and it will probably be closed at some point. Therefore, I have decided to move the projects that could still be useful to GitHub.
You may have multiple versions of the .NET framework installed and used on your machine. The framework has two components: the set of assemblies that provide functionalities for your application, and the common language runtime (CLR) that handles the execution of the application. These two components are versioned separately. If you what to see what…