Demonstrates The C Run-Time Debugging Hook Functions
Demonstrates The C Run-Time Debugging Hook Functions
Demonstrates The C Run-Time Debugging Hook Functions
The Visual C++ samples illustrate a wide variety of functionality across multiple technologies.
This sample code is intended to illustrate a concept, and it shows only the code that is relevant to that
concept. It may not meet the security requirements for a specific environment, and it should not be used
exactly as shown. We recommend that you add security and error-handling code to make your projects
more secure and robust. Microsoft provides this sample code "AS IS" with no warranties.
NoteNote
Some samples have not been modified to reflect the changes in the Visual C++ wizards, libraries, and
compiler. However, they still demonstrate how to complete the task.
To build and run a sample
1.
For the most recent versions of the Visual C++ samples, see one of the following pages on the MSDN
Web site:
ATL Samples
CLR Samples
Compiler Samples
ComTypeLibfor7 Samples
CRT Samples
Debugging Samples
Extensibility Samples
Fusion Samples
International Samples
Language Samples
MFC Samples
OS Samples
STL Samples
Unix Samples
Descriptions of the Samples
ATL Samples - Advanced
Sample Name
Description
ActiveDoc
Async
ATLButton
Creates a button that displays itself with three different bitmaps depending on its state.
ATLDuck
Demonstrates using connection points with ATL controls.
ATLSecurity
Shows how to use the ATL security classes to examine security settings.
ATLTraceTool
Connect
Illustrates the implementation and use of connection points (the IConnectionPointContainer and
IConnectionPoint interfaces) in a multithreaded environment.
CThreadPool
Shows how to use a thread pool in an application and how implementing a thread pool can improve the
application's performance.
DCOM
Demonstrates how to call a COM object implemented in a Windows service from multiple clients
running on different machines.
MFCATL
Illustrates how ATL COM objects can be used in an MFC server EXE.
ATL Samples - Controls
Sample Name
Description
ATLFire
CDInfo
Plays CD audio tracks and displays information about the tracks in tooltips and a piechart display.
Circ
Polygon
Builds a control that implements custom properties, events, property pages, and object safety.
SubEdit
Sample Name
Description
ATLCollections
ATLCon
ATLSafeArray
Shows how to create and maintain SAFEARRAYs using CComSafeArray; also how to pass
SAFEARRAYs from a component to script.
AutoThread
Beeper
Implements a collection/enumeration of objects using ATL and the Standard C++ Library.
COMMap
Demonstrates COM interface map entry macros with compiler COM support.
CustomString
Shows how to use a custom memory allocator for CStringT to improve performance in a multithreaded
application.
DispSink
Sample Name
Description
CatDB
Displays the schema information, such as tables and columns, of OLE DB providers.
DBViewer
Demonstrates a mid-level application that relies on the CManualAccessor class to take full control of
data bindings for your applications.
DynamicConsumer
Demonstrates using dynamic accessor and schema rowset classes to read metadata from a database.
MultiRead
Description
AdvancedPV
UpdatePV
Sample Name
Description
Scribble (MFC)
An MFC implementation of the Scribble sample, updated and extended to include new .NET
functionality.
A Windows Forms implementation of the Scribble sample, updated and extended to include new .NET
functionality.
STLCLR
Demonstrates some of the capabilities available when using the STL/CLR Library.
ComTypeLibfor7 Samples
Sample Name
Description
ACDual
AllInOne
Implements a server using ATL, exposing STL collections, and controlled by compiler COM support in
an MFC application.
COMMap
Demonstrates COM interface map entry macros with compiler COM support.
Connect
Illustrates the use and implementation of connection points (the IConnectionPointContainer and
IConnectionPoint interfaces) in a multithreaded environment.
DCOM
Demonstrates how to call a COM object implemented in a Windows service from multiple clients
running on different computers.
FreeThrd
Demonstrates a multithreaded client and free-threaded server with compiler COM support.
InProc
Labrador
Implements an EXE server that does not have any user interface.
MFCCalc
Description
ccWrapper
Demonstrates how to map C/C++ compiler flags from other compilers to the Visual C++ compiler
(cl.exe).
Compiler Samples - MASM
Sample Name
Description
EuclidStep1
A pure C project that demonstrates Euclid's algorithm for finding the greatest common divisor.
EuclidStep2
An extension of EuclidStep1 that is a mixed C and ASM project. The core of Euclid's algorithm is
moved from the .c file to an .asm file, with the .c file calling into the .asm file.
PrimesStep1
A pure C project that demonstrates the sieve of Eratosthenes to find prime numbers.
PrimesStep2
An extension of PrimesStep1 that is a mixed C and ASM project that moves the core algorithm to the
.asm file.
PrimesStep3
An extension of PrimesStep2 that adds a separate C header file and an .asm include file to declare the
extern function and global data structure.
CRT Samples
Sample Name
Description
CPUID
CRT_Dbg1
CRT_Dbg2
DFACObjs
Shows how to use the _CrtDoForAllClientObjects C run-time function to iterate through a linked list of
client objects.
Report
RTC
SecureCRT
This sample demonstrates how to upgrade code that used deprecated CRT functions to increase code
security.
Debugging Samples
Sample Name
Description
EEAddIn
Uses the Expression Evaluator Add-In API to extend the native debugger expression evaluator.
Events Samples
Sample Name
Description
COMEvents
Sample Name
Description
VCProjEngine_CPP
VCProjEngine_CS
VCProjEngine_VB7
Sample Name
Description
TraceMan
Provides information about application-dependent assemblies and the state of the assemblies in the
native fusion cache in human readable form.
International Samples
Sample Name
Description
IME
Demonstrates how to control the Input Method Editor mode and how to implement IME level 3.
SatDLL
UniRes
Sample Name
Description
BirthdayPicker
Shows how the .NET Framework resource mechanism can be used in C++ applications. It also
demonstrates some common Window Forms components.
Demonstrates key concepts of features in C++ that support .NET and expose capabilities of the CLR.
Calculator
Implements a simple pocket calculator using C++ and the .NET Framework Windows Forms classes.
Data
MEDriver
Illustrates the use of COM events (fired from an unmanaged COM server) through a .NET Framework
wrapper, automatically generated from the COM server's type library.
Nile
QStat
Shows how to create a DLL that wraps access to a COM object and exposes its functionality to .NET
Framework clients.
Scribble
Demonstrates how to develop a Windows Forms MDI application using C++/CLI and the .NET
Framework classes.
TilePuzzle
Demonstrates interoperability between managed components (written with C++ and C#) and native
components (written with C++ using COM attributes).
MFC Samples - Advanced
Sample Name
Description
Collect
Demonstrates MFC C++ template-based collection classes and standard prebuilt collection classes.
Cube
OpenGL application using MFC device contexts along with OpenGL's resource contexts.
DLLHusk
Sharing the DLL version of the Foundation class library with an application and custom DLL.
DLLScreenCap
A regular DLL that can be statically or dynamically linked to the Microsoft Foundation Class Library.
MTGDI
Demonstration of sharing GDI resources among multiple threads using the framework's single
document interface (SDI) support for documents and views.
MTMDI
Multithread illustration, where user-interface events are processed in a separate user-interface thread.
MTRecalc
Mutexes
Dialog-based application that creates two CWinThread objects and uses them to perform a simple task
under the user's control.
Speakn
Sample Name
Description
Button
Demonstrates use of an in-place active menu, a stock property page, and the About box control option.
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
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
Image
Demonstrates how to use MFC to build an ActiveX control that is capable of downloading data
asynchronously.
Licensed
Localize
A control with a localized user interface that demonstrates use of separate type libraries and resource
dynamic-link libraries (DLLs) for localization.
NetAddr
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
Control subclassed from a Windows owner-drawn button control. It demonstrates stock properties,
custom events, and picture holders.
RegSvr
A control with the visual appearance of a spin-dial that demonstrates property page data validation.
TestHelp
An ActiveX control that has its own help file and tooltips.
Time
A control that is invisible at run time and fires a timer event at set intervals. Demonstrates notification
functions and ambient properties.
XList
A control, subclassed from a Windows list box, that displays text or bitmap items.
MFC Samples - General
Sample Name
Description
ClipArt
The CLIPART directory contains sample resources that you can use to customize the appearance of
your application.
CmnCtrl1
Demonstrates how to create and change the styles of Windows Common Controls using MFC classes
(Part 1).
CmnCtrl2
Demonstrates how to create and change the styles of Windows Common Controls using MFC classes
(Part 2).
CTaskDialog
Custom toolbar and status bar, dialog bar, and floating palette.
CtrlTest
Owner-draw list box and menu, custom control, bitmap button, spin control.
DBVList
Uses the CListView and CDaoRecordset classes to implement the virtual list view functionality that is
available for the list view common control.
DIBLook
DlgCbr32
DlgTempl
DockTool
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
Creates a custom dialog box that illustrates what events are generated when you create a CFileDialog.
Hello
Illustrates a single application window with a menu and About box.
HelloApp
Minimal MFC sample that illustrates that few lines of code are required to get a window to appear on
the screen.
ListHdr
Demonstrates how to use the common control MFC classes CListCtrl and CHeaderCtrl.
MDI
MDIDocVw
Updated version of the MDI sample that uses the document/view architecture.
MMXSwarm
Demonstrates how to use CImage, the __m64 data type, and device-independent bitmaps (DIBs).
Modeless
Multipad
Simple text editor that lets the user open and edit multiple text files at one time.
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
Property sheets (dialogs).
RowList
Scribble
SimpleImage
SnapVw
Spiro
A game that shows to use CImageList and how to use memory display contexts in applications
requiring animation effects.
Tracker
VariantUse
ViewEx
Sample Name
Description
DHTMLExplore
HTMLEdit
MFCIE
Scheduler
Demonstrates how to create an HTML-based dialog box using the Visual C++ libraries classes.
MFC Samples - OLE
Sample Name
Description
ACDual
AutoClik
Illustrates Automation features. Includes AUTODRIV, a simple Automation client application that
drives the AUTOCLIK sample application.
CalcDriv
Automation client.
DrawCli
Full-featured object-oriented drawing application that is also an ActiveX Visual Editing container.
HierSvr
Demonstrates a Server Application with OLE Drag and Drop.
InProc
An in-process Automation server that can be loaded as a DLL in the client's address space.
IPDrive
A simple Automation client application that drives the INPROC sample application.
MFCBind
MFCCalc
OClient
OLEView
SuperPad
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
Uses MFC's support for rich edit controls to create a basic word processor.
MFC Samples - Utility
Sample Name
Description
GUIDGen
Makehm
A console application that produces a mapping between resource identifications and Help contexts.
MFC Samples - Visual C++ 2008 Feature Pack
Sample Name
Description
CustomPages
Demonstrates how to add a custom page to the Toolbar Customization dialog box.
DesktopAlertDemo
Demonstrates how to implement a desktop alert dialog box (similar to the dialog box that an instant
messaging application displays).
DlgToolTips
Demonstrates how to implement advanced tooltips for controls on a dialog box.
DrawClient
Demonstrates how to integrate support for a ribbon into an object-oriented drawing application with
visual editing container support.
DynamicMenu
Demonstrates how to dynamically update a menu on the menu bar and a popup menu at run-time.
Explorer
Demonstrates how to implement a file system explorer that resembles the Windows Explorer, with
similar user interface elements and capabilities.
IEDemo
Demonstrates how to implement an application similar to Internet Explorer, with similar user interface
elements and capabilities.
MDITabsDemo
Demonstrates how to create an application that uses the new tabbed MDI documents interface instead
of the traditional MDI child windows.
MenuSubSet
Demonstrates how to dynamically remove specific menu items and submenus at application startup.
MSMoneyDemo
Demonstrates how to use MFC to create a user interface similar to Microsoft Money.
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
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
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
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
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
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
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
Slider
StateCollection
Demonstrates how to implement an application that saves and loads different states for the menu bar,
toolbars, and docking windows.
StatusBarDemo
TabbedView
Demonstrates how to create a view that contains multiple tabbed views, such as the tabs in an Excel
workbook.
TabControl
Demonstrates the MFC Tab Control and the different appearances it has using different properties and
visual managers.
TasksPane
Demonstrates the MFC Task Pane classes and their different appearances using various properties and
visual managers.
ToolbarDateTimePicker
ToolTipDemo