I’ve published a few more articles over the last month:
An API for Simple HTTP Requests (Visual Studio Magazine)
I’ve written in the past about HTTP, how to perform asynchronous HTTP requests efficiently and how to use WebSockets in various ways, but sometimes it pays to keep it simple. There’s certainly a growing need for more sophisticated libraries that handle HTTP requests and that do so in an asynchronous manner, allowing developers to write responsive applications more easily. On the other hand, such libraries tend to be more difficult to use in simple scenarios where I might not need asynchrony. What if I just need a console application to download a file from the Web? A sophisticated asynchronous programming model is often overkill and can add a lot of complexity. Also, responsiveness isn’t really an issue, although some form of progress reporting might still be important. It turns out that, in these situations, some older APIs can come in handy.
Applying the Range-for Statement in C++ (Visual Studio Magazine)
The simplest way to iterate through a sequence with C++11 is to use the range-for statement. Next to auto and nullptr, it’s one of the simplest constructs introduced by the C++11 standard. However, to appreciate where it can take us, we need to remember where we’ve been.
Exploring Fonts with DirectWrite and Modern C++ (MSDN Magazine)
DirectWrite is an incredibly powerful text layout API. It powers practically all of the leading Windows applications and technologies, from the Windows Runtime (WinRT) implementation of XAML and Office 2013, to Internet Explorer 11 and more. It’s not a rendering engine in itself, but has a close relationship with Direct2D, its sibling in the DirectX family. Direct2D is, of course, the premier hardware-accelerated, immediate-mode graphics API.
You can use DirectWrite with Direct2D to provide hardware-accelerated text rendering. To avoid any confusion, I haven’t written too much about DirectWrite in the past. I didn’t want you to think Direct2D is just the DirectWrite rendering engine. Direct2D is so much more than that. Still, DirectWrite has a lot to offer, and in this month’s column I’ll show you some of what’s possible with DirectWrite and look at how modern C++ can help simplify the programming model.