How to create a simple list view in C++ / MFC

These instructions pertain to the use of Visual Studio 2010, but barring one or two differences should be reasonably applicable to other versions of Visual Studio as well. Much of these instruction can also be found over at the functionx site, but more screenshots are included here to give a clearer understanding.
Continue reading

Getting started with Windows GDI graphics applications in C++

A guide to getting started with Windows graphics applications for the very first time. The Windows Graphics Device Interface (GDI) forms the basis of drawing lines and objects, and from this device contexts. I will not go into any detail about these concepts in this post. I just want to show a simple means of getting started with things like the drawing of lines and objects in Windows applications. There is nothing stopping you from reading further on the subject to increase your understanding.
Continue reading

Creating a Tabbed Dialog using MFC Property Sheets

This post assumes that you are working on an existing MFC project and wish to add a tabbed dialog to your application. This example was created in Visual Studio 2008. Like most of the other postings here, there is not much in the way of extra bells and whistles, just a very simple example to get you started… VS2003 download available here.

Continue reading

Dynamically Created MFC Controls and their Notifications

I was required to create a dialog application with dynamically created checkboxes (CButtons).  Given that selection of a certain hardware types in the software would result in completely different checkbox layouts.  In these situations, it is the software that has to automatically do the work normally done by using the Dialog Editor toolbox to insert static controls. This involves the following steps: Continue reading

Maintaining Recent File Lists in MFC Applications

A simple application in Visual Studio 2003 that builds on the “MyPad” application provided by Jeff Prosise in Programming Windows with MFC. Alternatively you could probably create the same by running the AppWizard to create a standard view-based application, but making sure to uncheck the Document/View architecture box, as well as the ActiveX Controls box to avoid unnecessary code. Continue reading

Finding Minimal Spanning Trees using Kruskal’s Algorithm in MFC / C++ / Boost libraries

Kruskal’s algorithm is used to find the minimal spanning tree for a network with a set of weighted links. This might be a telecoms network, or the layout for planning pipes and cables, or one of many other applications. Continue reading