The MFC Professional Out-of-this-world wallpaper for your PC
Source Code and Classes

At the moment, this list is grouped by web site, since this is the easiest way to maintain the data. In the future, when the list becomes so large that this grouping becomes a burden, it will be split into categories.

WEB SITE DESCRIPTION
Zafir Anjum
Home Page

Zafir's "Code Guru" site contains a good amount of source code (with explanations and instructions on how to use them). He's compiled a number of topics on CListCtrl and CTreeCtrl, and he's actively adding/seeking more.
Jason McGuiness
Math classes

Jason has developed an MFC Extension DLL that contains various math classes. It has over 300 functions in it that cover many mathematical number systems: complex numbers, 4-vectors, 5x4 matrices to name just a few. It is currently in development and at alpha release.

Also on this page is an ultimate system timer. This is an MFC extension class that wraps the Pentium RDTSC assembler instruction. Basically this provides you with a counter that increment's at the host processor's clock core frequency (!).

Ulrich von Zadow's
paintlib
Paintlib is a C++ class library for image file decoding and manipulation. It currently supports the TGA, TIFF, JPEG/JFIF, Windows BMP, and Mac PICT formats. Data source and destination formats can be tailored as nessesary. Additionally, format-independent but fast bitmap manipulation classes are available.

Although there are a few Windows-specific functions, the library is portable. Makefiles are included for Microsoft Visual C++ (Win32) and GNU C++ (DOS and SunOS). Prerequisite is a C++-compiler with standard C libraries and support for exception handling. The library also requires support for 32-bit memory addressing.

Bartosz Milewski's
Win32 tutorials and sample C++ code Site

Fast Fourier Transform app and FFT source.

Windows controls, device contexts, pens, brushes, etc.

A tutorial on the acquisition of sound samples using Win32 API.

The game of Battleship.

Arkady Elterman's Site

Spin Control Library.

Hypercube Freebies Page

Hypercube has broken out some classes from its HyperView++ for MFC extension class library:

CCustToolBar -- A customizable toolbar class. CCustToolBar encapsulates the Win95 toolbar common control into an MFC toolbar class. Extra features include the ability to serialize the toolbar to the registry or to disk, and the ability to handle customization of toolbars with controls other than buttons and reserved painting areas. You can also pop up a customization dialog that allows the user to add or remove any icons he chooses.

COCXInsertDialog -- An MFC class for selecting an OLE control from a dialog containing all of the OCX's (represented by their small bitmaps and text descriptions) available from the registry.

Very professional, very slick. Highly recommended.

David Carballo Escudero's Home Page

Date Calendar Extension -- Offers an edit for input of dates (times are not allowed). Also offers a pop-up window that shows a calendar, allowing the user to select a date. All aspects of calendar and edit control depends on regional settings. Changes in regional settings are detected.

P.J. Naughter's Home Page

Mr. Naughter has written a few interesting classes and components:

  • DTime - A Collection of Date and Time classes
  • Notpad - An improved text editor for Windows 95 and NT
  • DtWinVer - A comprehensive OS detection routine
  • PushPin - A pushpin button class
  • Splasher - An improved splash screen component for MFC 4.x
Poul A. Costinsky's Programmer's Archive

Mr. Costinsky is a very prolific programmer, and lucky for us, he's also a very generous one! There's lots and lots of stuff at this site. The best thing to do is visit it, and see for yourself. Here are some of the categories his efforts have encompassed:

  • Pointer Classes
  • Win32 Memory API Wrappers
  • File Management Classes
  • String Classes
  • Storage Classes
  • Algorithms
  • Multithreading
  • Client-Server
  • MFC Extensions
NanoSoft Home Page

NSViews C++ Library -- MFC extension classes (that live in a DLL called NSViews.dll) for Flexible Dialogs, Flexible Property Sheets, Flexible Form Views, and Flexible Property Sheet Views. Now your users can dynamically resize your dialogs, and all the controls within are automatically sized the way you want them to be.

The site has several graphic examples, plus sample code to show how it's all put together.

Julian Smart's Site

Command/undo classes -- A little framework for implementing Undo/Redo in MFC applications. It consists of two classes, CCommand and CCommandProcessor. The supplied example is a doodling program with two undoable/redoable actions: Add segment, and Cut segment.

DDE classes -- MFC classes for doing DDE: CDDEServer, CDDEClient and CDDEConnection.

CImage -- A beta class for manipulating images: JPEG/BMP/PNG saving and loading, GIF loading, and iteration over the image data.

CTimer -- A timer class for MFC, which unaccountably omits one.

CExpr -- Classes for reading and writing structured ASCII files. Do you ever get a little frustrated with maintaining binary file formats? Things like not being able to edit your data files in a text editor, or the trouble it takes to maintain changes in your file formats. This class makes prototyping file formats a lot easier and more maintainable than using MFC serialisation, allowing you to save a file of 'objects' with named attribute/value pairs. If you need to add or remove attributes in the next version of your application, old files are still easily readable without loads of if statements.

CEnhStatusBar -- An enhanced status bar class for MFC. Adds scrollable status messages, pane tooltips and a progress control.

Paul Gerhart's Site

SockTest -- A Sockets (winsock) Tester

GridList -- An Owner-draw CListCtrl Example

Richard's Programming Page

The CParagraph class -- Takes care of the sizing and displaying of a block of text in a graphic display. I found that I often needed to display a block of text within another graphical shape that was resizable and the text would need to fit inside the shape at all times. The problem was that I would need to check if the text fitted correctly, I would then need to break up the words according to the available space, and so on, it required a bit of effort. This class takes care of word breaks and sizing, all it requires is that you tell it the width and height of the block.

Mike Blaszczak's Site

apibrow.zip -- This project is designed to be used with Visual C++ 4.1. The project demonstrates the use of common control callback items in an MFC application that manages a CListCtrl control in a CListView. The sample parses any comma-separated variable file, such as the WIN32API.CSV file found in your \MSDEV\LIB directory.

doodads.zip -- This project is designed to be used with Visual C++ 4.1. The project demonstrates many Windows common controls, including the extensive use of image lists. The project was used in the book "The Revolutionary Guide To MFC 4 Programming With Visual C++", published by Wrox Press. The sample was also used during the talk "Using Windows Common Controls", offered at Boston University's WinDev conference.

fully.zip -- FULLY shows how to make an MFC application make one of its views go full-screen active. It was written to be published in one of the staple-bound newsletter-style journals on Visual C++. After the editor for the magazine requested it, he summarily ignored my communication surrounding the program and its supporting article. The article, completely unedited, is included in this archive and describes the sample. Complete source for the program is included. This sample was written with a beta version of VC++ 4.1 and tested with the shipping version of VC++ 4.2. The sample was not tested to work correctly under Windows NT 3.51: it's only been tested for "new shell" versions of Windows: namely, Windows NT 4.0 and Windows 95.

mfctalk.zip -- MFCTALK was originally published with Mike's article on ISPAI programming with MFC in the May, 1996 issue of Microsoft Systems Journal. The sample demonstrates how to write an ISAPI application with the MFC classes introduced in MFC version 4.1. The sample shows how to use synchronization objects (specifically, a CCriticalSection) to protect data handled by individual requests from corruption across threads.

stealth.zip -- This SDI application shows how to create an application that doesn't show up in the task bar in Windows 95 or Windows NT 4.0. (The application shouldn't show up in the task list in Windows NT 3.51, either, but I'm not at liberty to test that, I'm afraid.) The application shows how to override PreCreateWindow() for your CMainFrame, using AfxRegisterWndClass() for your own windows, and stresses the difference between a parent window and an owner window. the changes in this application, above and beyond what the AppWizard produces for an SDI application, are all marked with //SAMPLE: comments. This is an VC++ 4.2 project.

Sam Blackburn's Site

WFC (Win32 Foundation Classes) -- extends MFC to do NT specific things. Very extensive: contains lots and lots of classes.

FTP

pushpin.zip -- Source code for a complete class to implement push pin buttons as seen on the OpenLook Window manager on X-Windows and property dialogs in Developer Studio in MS VC 4.X.

FTP

Tabbed Dialog Box in VC++ 1.5x

CICA Archives

A wide variety of sample code, but it's mostly older stuff. Still, with some diligence, you might find some gems. Here are a few that look interesting:

bstate.zip -- CBStateButton, an MFC class based on PushButton.

cktblmfc.zip -- Spreadsheet Control for MFC 2.5.

cstr22.zip -- String Studio, an MFC 2.5 CString extension.

Ed's Windows Libraries

Appbar MFC class -- "An MFC class that implements appbars. Appbars are windows that stick to the sides of the desktop. The task bar is an example of one. The class isn't very useful by itself, it's meant to be a starting point for real applications."

Color quantization DLL -- "This is an old dll that I threw together over one weekend to perform color quantization on 24-bit device-independent bitmaps. It's very disorganized and really needs to be rewritten. I may actually get around to it one day."

TabDlg Custom Control -- "This is a custom control that I wrote to implement Word 6.0 style tabbed dialog boxes. I've thought of better ways of implementing it since I wrote this version, but I've since moved on to 32-bit programming so I just use the native implementations."

Per Ghosh

Text class -- A class that is very similar to CString but is not in the MFC so you can add the functions that you want.

ActiveX -- shows how you can use the ATL (ActiveX Template Library).

Modal window -- Shows how to make your own window modal. The sample uses a frame.

Tab view -- Have you ever looked at Excel or some other program that can switch views by clicking on a tab. This approach makes it more easy for a user to work with a document that can't be manageable in just one single view.

Custom control -- Shows how you can develop controls that extends the functionality of standard controls, and how to develop a control from scratch.

PropertySheet -- shows how a properysheet can be placed in a window and how you can set the position and size.



Seen any good MFC / C++ source code lately?

Back to The MFC Professional