Free book - C++ Windows programming
Written by Mike James   
Tuesday, 02 August 2011

A series of six articles that amount to a book on the topic of writing Windows applications in C++ is available for free from Microsoft.

As if you needed any more proof that Microsoft is just mad about C++ at the moment we have - “Developing Windows Applications in C++”,  a new series of articles authored by Kate Gregory available on the MSDN site.

 

msdnlogo

It's all about getting C++ programmers to understand how to write Windows applications. You might think that if you know how to program in C++ then you know how to create a Windows application, but it isn't quite that simple. You can create a console application without much worry but for Windows you need to master the API and discover how to create windows and manage message loops. This short series doesn't teach you the basics but it will get you started on creating Windows apps in C++ in the old style.

There are six chapters:

  1. The tools you need
    In this chapter you will learn about the Windows SDK and how to get it. You can use full Visual Studio but it all works with the, free to download, Express version. This really is about getting started and if you already know how to use Visual Studio then move on to chapter 2.
  2. Windows basics
    Here you will see how Windows works under the hood. You’ll meet words like “message” and “handle” that are everywhere for Windows programmers. This really is basic Windows API stuff without any help from a framework - i.e. the MFC, ATL and managed code is ignored - this is raw Windows. This chapter sets the scene for doing something practical in the next.
  3. A simple Windows application
    In this chapter you create the simplest-possible Windows application and find out how it works. These concepts will recur in every Windows The manually constructed program is also compared to the starter application that is generated by Visual Studio to see how it differs from the simplest-possible application. This is the real meat of the book that actually produces some code that creates a Windows application./
  4. Typical Windows tasks
    This chapter  transforms the starter application from chapter 3 from a C-style collection of functions into a more object-oriented C++ application. Then it uses Direct2D to paint a simple UI. The sample is further refined by adding reactions to mouse and keyboard events, and then a control is added. You can also see how to show a message box to your users. This gives you all the building blocks for a user interface.
  5. Working with COM
    At chapter 5 we suddenly get a bit more advanced. A lot of Windows functionality is provided through COM, the Component Object Model. This chapter focuses on consuming Windows COM based APIs. It covers COM concepts, demonstrates calling the Text-to-Speech capabilities of Windows through COM.
  6. Taking the next steps
    This chapter describes some of the other core Windows-related technologies - you get a quick overview of DirectX, web services, the file system, parallel programming, xml, hardware and a few other things. Not enough to use any of them but enough to make you aware that they exist. 

There are some problems with this text - the main one is that the program layout at terrible - double line spacing makes it difficult to read. Let's hope someone can fix it. It also doesn't really go far enough, but it is nice to see a simple guide to consuming COM - a lost art among many programmers who moved away from C++ to managed code.

Take a look at it and, if you still think that there is a future in C++ and a managed code approach, look also at Getting started with Managed C++.

 

 

Banner


Chainguard Joins Docker Verified Publisher Program
15/03/2024

Chainguard has joined the Docker Verified Publisher (DVP) program, meaning its Chainguard Developer Images are now officially available on Docker's container image registry.



JetBrains Announces TeamCity Pipelines
19/03/2024

JetBrains has released a public beta of TeamCity Pipelines, a cloud-based Continuous Integration/Continuous Deployment (CI/CD) service for small and medium-sized engineering teams.


More News

 

Last Updated ( Tuesday, 02 August 2011 )