Search Wiki:
Resource Page Description
.
Contains samples that demonstrate Microsoft Foundation Classes (MFC) functionality.

Visual Studio 2008 C++ Samples can be found here.

Please submit bugs through Connect, or provide comments in the discussion section of this site.

MFC Samples All
Sample Name Download Link Description
All MFC Samples MFC Samples All All MFC Samples

MFC Samples - Advanced
Sample Name Download Link Description
All MFC Advanced Samples MFC Advanced Samples All All MFC Advanced Samples
Collect Collect Demonstrates MFC C++ template-based collection classes and standard prebuilt collection classes.
Cube Cube OpenGL application using MFC device contexts along with OpenGL's resource contexts.
DLLHusk DLLHusk Sharing the DLL version of the Foundation class library with an application and custom DLL.
DLLScreenCap DLLScreenCap A regular DLL that can be statically or dynamically linked to the Microsoft Foundation Class Library.
MTGDI MTGDI Demonstration of sharing GDI resources among multiple threads using the framework's single document interface (SDI) support for documents and views.
MTMDI MTMDI Multithread illustration, where user-interface events are processed in a separate user-interface thread.
MTRecalc MTRecalc Multithread illustration, where recalculations are performed in a worker thread.
Mutexes Mutexes Dialog-based application that creates two CWinThread objects and uses them to perform a simple task under the user's control.
Speakn Speakn Demonstrates Multimedia Sound Using User-Defined Resources.

MFC Samples - Controls
Sample Name Download Link Description
All MFC Control Samples MFC Control Samples All All MFC Control Samples
Button Button Demonstrates use of an in-place active menu, a stock property page, and the About box control option.
Circ Circ Demonstrates ActiveX control basics, including control painting, stock and custom properties, stock and custom events, use of colors and fonts, the stock Font property page, the default property page, and versioning.
CmnCtrl CmnCtrl Demonstrates some of the new controls available with MFC on wiprlhext, including the command link button (CButton), the pager control (CPagerCtrl), the split button (CSplitButton), and the network address control (CNetAddressCtrl).
Contain Contain Demonstrates a Visual Editing Container Application.
Image Image Demonstrates how to use MFC to build an ActiveX control that is capable of downloading data asynchronously.
Licensed Licensed A control that enforces use of a design-time and run-time license.
Localize Localize A control with a localized user interface that demonstrates use of separate type libraries and resource dynamic-link libraries (DLLs) for localization.
NetAddr NetAddr Demonstrates use of the Windows Vista "Net Address Verifier" control.
Pal Pal Control that displays the colors of a palette. It demonstrates read-only properties, persistent Get/Set properties, persistent parameterized properties, and picture properties.
Push Push Control subclassed from a Windows owner-drawn button control. It demonstrates stock properties, custom events, and picture holders.
RegSvr RegSvr Demonstrates the invocation of Self-Registration Code.
SpinDial SpinDial A control with the visual appearance of a spin-dial that demonstrates property page data validation.
TestHelp TestHelp An ActiveX control that has its own help file and tooltips.
Time Time A control that is invisible at run time and fires a timer event at set intervals. Demonstrates notification functions and ambient properties.
XList XList A control, subclassed from a Windows list box, that displays text or bitmap items.

MFC Samples - General
Sample Name Download Link Description
All MFC General Samples MFC General Samples All All MFC General Samples
ClipArt ClipArt The CLIPART directory contains sample resources that you can use to customize the appearance of your application.
CmnCtrl1 CmnCtrl1 Demonstrates how to create and change the styles of Windows Common Controls using MFC classes (Part 1).
CmnCtrl2 CmnCtrl2 Demonstrates how to create and change the styles of Windows Common Controls using MFC classes (Part 2).
CTaskDialog CTaskDialog Demonstrates various features of the CTaskDialog class.
CtrlBars CtrlBars Custom toolbar and status bar, dialog bar, and floating palette.
CtrlTest CtrlTest Owner-draw list box and menu, custom control, bitmap button, spin control.
DBVList DBVList Uses the CListView and CDaoRecordset classes to implement the virtual list view functionality that is available for the list view common control.
DIBLook DIBLook Demonstrates the Use of DIBs and Color Palettes.
DlgCbr32 DlgCbr32 Adding a toolbar and a status bar to a dialog-based application.
DlgTempl DlgTempl Demonstrates the dynamic creation of dialog templates.
DockTool DockTool Dragging and floating toolbars that are "dockable".
Dynamenu Dynamenu Dynamically modifying list of items in menus; handling commands not known at compile time; and updating the status bar command prompt for such commands.
FileDlgWatcher FileDlgWatcher Creates a custom dialog box that illustrates what events are generated when you create a CFileDialog.
Hello Hello Illustrates a single application window with a menu and About box.
HelloApp HelloApp Minimal MFC sample that illustrates that few lines of code are required to get a window to appear on the screen.
ListHdr ListHdr Demonstrates how to use the common control MFC classes CListCtrl and CHeaderCtrl.
MDI MDI MDI application that does not use documents and views.
MDIDocVw MDIDocVw Updated version of the MDI sample that uses the document/view architecture.
MMXSwarm MMXSwarm Demonstrates how to use CImage, the __m64 data type, and device-independent bitmaps (DIBs).
Modeless Modeless Demonstrates the use of an MFC CDialog object as a modeless dialog box.
Multipad Multipad Simple text editor that lets the user open and edit multiple text files at one time.
Npp Npp Demonstrates how to implement an interface (SDI) application similar to Notepad that allows you to edit text messages and send them to other users or other systems through the Windows messaging API, or MAPI.
PropDlg PropDlg Property sheets (dialogs).
RowList RowList Illustrates full row selection in a list-view common control.
Scribble Scribble Provides simple illustrations of a wide breadth of MFC features.
SimpleImage SimpleImage Demonstrates loading, resizing, conversion, and saving images.
SnapVw SnapVw Shows how to use property pages in a MDI child frame window.
Spiro Spiro A game that shows to use CImageList and how to use memory display contexts in applications requiring animation effects.
Tracker Tracker Demonstrates various CRectTracker styles and options.
VariantUse VariantUse Demonstrates the use of the variant data type.
ViewEx ViewEx Multiple views, scroll view, splitter windows.

MFC Samples - Internet
Sample Name Download Link Description
All MFC Internet Samples MFC Internet Samples All All MFC Internet Samples
DHTMLExplore DHTMLExplore Demonstrates handling DHTML events and using DHTML DDX.
HTMLEdit DHTMLExplore Wraps the Internet Explorer MSHTML editing control.
MFCIE MFCIE Demonstrates the MFC CHtmlView and CReBar Classes.
Scheduler Scheduler Demonstrates how to create an HTML-based dialog box using the Visual C++ libraries classes.

MFC Samples - OLE
Sample Name Download Link Description
All MFC OLE Samples MFC OLE Samples All All OLE Samples
ACDual ACDual Demonstrates how to add dual interface support to an MFC-based Automation server.
AutoClik AutoClik Illustrates Automation features. Includes AUTODRIV, a simple Automation client application that drives the AUTOCLIK sample application.
CalcDriv CalcDriv Automation client.
DrawCli DrawCli Full-featured object-oriented drawing application that is also an ActiveX Visual Editing container.
HierSvr HierSvr Demonstrates a Server Application with OLE Drag and Drop.
InProc InProc An in-process Automation server that can be loaded as a DLL in the client's address space.
IPDrive IPDrive A simple Automation client application that drives the INPROC sample application.
MFCBind MFCBind Shows how to create an Active document (formerly known as a DocObject) container.
MFCCalc MFCCalc An Automation server that implements a simple calculator.
OClient Oclient ActiveX Visual Editing container application, with drag and drop.
OLEView OleView Implementing an OLE object browser through custom OLE interfaces.
SuperPad SuperPad Demonstrates a Visual Editing Server That Edits Text Using CEditView.
TstCon TstCon Implements an ActiveX control container using MFC's support for OLE embedding. You can use TSTCON to test ActiveX controls, change their properties, and invoke their methods.
WordPad WordPad Uses MFC's support for rich edit controls to create a basic word processor.

MFC Samples - Utility
Sample Name Download Link Description
All MFC Utility Samples MFC Utility Samples All All Utility Samples
GUIDGen GUIDGen A simple dialog-based MFC application that generates globally-unique identifiers.
Makehm Makehm A console application that produces a mapping between resource identifications and Help contexts.

MFC Samples - Visual C++ 2008 Feature Pack
Sample Name Download Link Description
All MFC Visual C++ 2008 Feature Pack Samples MFC Visual C++ 2008 Feature Pack Samples All All Visual C++ 2008 Feature Pack Samples
CustomPages CustomPages Demonstrates how to add a custom page to the Toolbar Customization dialog box.
DesktopAlertDemo DesktopAlertDemo Demonstrates how to implement a desktop alert dialog box (similar to the dialog box that an instant messaging application displays).
DlgToolTips DlgToolTips Demonstrates how to implement advanced tooltips for controls on a dialog box.
DrawClient DrawClient Demonstrates how to integrate support for a ribbon into an object-oriented drawing application with visual editing container support.
DynamicMenu DynamicMenu Demonstrates how to dynamically update a menu on the menu bar and a popup menu at run-time.
Explorer Explorer Demonstrates how to implement a file system explorer that resembles the Windows Explorer, with similar user interface elements and capabilities.
IEDemo IEDemo Demonstrates how to implement an application similar to Internet Explorer, with similar user interface elements and capabilities.
MDITabsDemo MDITabsDemo Demonstrates how to create an application that uses the new tabbed MDI documents interface instead of the traditional MDI child windows.
MenuSubSet MenuSubSet Demonstrates how to dynamically remove specific menu items and submenus at application startup.
MSMoneyDemo MSMoneyDemo Demonstrates how to use MFC to create a user interface similar to Microsoft Money.
MSOffice2007Demo MSOffice2007Demo Demonstrates how to implement an editor application similar to an Office 2007 application, with similar user interface elements and limited similar capabilities. The MSOffice2007Demo sample implements a very full ribbon user interface much like an Office 2007 application, and some (but not all) of the ribbon elements are connected to capabilities in the application.
NewControls NewControls Demonstrates the capabilities of many of the controls implemented in MFC, including customizable buttons, color picker controls and palettes, a font chooser, an image editor, a property grid, a masked edit control, and shell list and tree controls.
OutlookDemo OutlookDemo Demonstrates how to create an application similar to Microsoft Outlook 2003/2007.
OutlookMultiViews OutlookMultiviews Demonstrates how to switch between multiple views on a single document in an SDI application. The sample uses the Outlook bar control to list the available views and switch between them.
OwnerDrawMenu OwnerDrawMenu Illustrates how to draw popup menu items dynamically.
PaletteDemo PaletteDemo Illustrates how to create a multi-column toolbar with an owner-draw information area. Click 2, 3 or 4 buttons on the Standard toolbar in order to change at the runtime the number of columns of the custom toolbar.
PropSheetDemo PropSheetDemo Illustrates the following types of Property Sheet control: simple, with tabs at the left side, with tree control at the left side, OneNote-style tabs, list of items at the left side.
RebarTest RebarTest Demonstrates a customizable Rebar control which hosts a toolbar.
RibbonGadgets RibbonGadgets Illustrates various controls that can be hosted in the Ribbon Control. At the bottom of the main frame you can find the Source Code window with source code text, which outlines how to create a particular gadget.
RibbonMDI RibbonMDI Demonstrates usage of Ribbon Control with Multi Document Interface.
RollupPane RollupPane Demonstrates a floating "information" pane, which automatically rolls up. You can press the pin button on the caption of floating pane to turn rolling on and off.
SetPaneSize SetPaneSize Demonstrates how to set docking pane size programmatically.
Slider Slider Demonstrates how to implement a toolbar button that hosts an external control.
StateCollection StateCollection Demonstrates how to implement an application that saves and loads different states for the menu bar, toolbars, and docking windows.
StatusBarDemo StatusBarDemo Demonstrates how to add various advanced controls to a status bar.
TabbedView TabbedView Demonstrates how to create a view that contains multiple tabbed views, such as the tabs in an Excel workbook.
TabControl TabControl Demonstrates the MFC Tab Control and the different appearances it has using different properties and visual managers.
TasksPane TasksPane Demonstrates the MFC Task Pane classes and their different appearances using various properties and visual managers.
ToolbarDateTimePicker ToolbarDateTimePicker Demonstrates how to integrate a date/time picker control with the toolbar
ToolTipDemo ToolTipDemo Demonstrates how to use advanced MFC tooltip features.
TrayMenu TrayMenu Illustrates the ability to use MFC Control Bar menus with the system tray icon (such as the notification icons in the lower-right corner of the display).
VisualStudioDemo VisualStudioDemo Demonstrates how to implement an application with many of the same user interface features and some of the capabilities of Visual Studio. Many of the Visual Studio user interface elements, including customizable docking menubar and toolbars, and docking windows, are demonstrated.
WordPad WordPad Demonstrates how to implement an application that imitates the functionality of WordPad, including the user interface elements and some of the capabilities.
WorkSpaceToolBar WorkSpaceToolBar Demonstrates how to add a toolbar to a docking pane. This resembles the toolbar in Solution Explorer in Visual Studio.

MFC Samples - Windows Touch
Sample Name Download Link Description
All MFC Windows Touch Samples MFC Windows Touch Samples All All MFC Windows Touch Samples
GestureDemo GestureDemo Demonstrates the Windows Touch support in MFC (requires touch hardware).
TouchDemo TouchDemo Demonstrates the Windows Touch support in MFC (requires touch hardware).

Other MFC Samples
Sample Name Download Link Description
WpfInterop WpfInterop N/A
MFCXPSS MFCXPSS N/A





Last edited Apr 13 2010 at 11:12 PM  by kevan, version 17
Comments
NativeManMFC wrote  Feb 6 2010 at 2:47 PM  
Thank you Microsoft for continuing to support MFC.

bulutsupurgesi wrote  Jul 9 2010 at 9:03 PM  
Why C++ 2008 Feature Pack samples for VS2010? I need to see them with VS2008.

Updating...
Page view tracker