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
Category Archives: MFC
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.
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
Simple Multithreading in C++ / MFC
Right now I am just starting with a very simple example – no fancy stuff – just a single thread to demonstrate a sequence that updates a counter 20 times per second. Continue reading
‘Blitting’ a Bitmap Image to the Screen.
I recently needed to revisit this to create simple monochrome bitmaps representing the sets of nozzles turned off/on on a Xaar microarrayer printhead. Sample code here. Essential steps are outlined in the following code
Continue reading
Creating Bitmap Files from Raw Pixel Data
Creating the byte array
I needed a means of representing binary array values (inkjet printhead nozzles turned ON/OFF) as a set of colored ‘squares’ or pixels, so that nozzles switched ON/OFF could be represented by two different colours. 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
How to Create Resizable Dialogs in MFC
Example 1: Using Paulo Messina’s Code Project sample
A minimalist use of the CResizeableDialog class as described by Paulo Messina at CodeProject . Hope you find the following recipe useful. Visual Studio 2003 source code is downloadable from here.
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