=============================================================================

****
**** The FANGLE technical article can be downloaded from the
**** file 11-5.zip in library section number 11
****

Allocating Memory the Newfangled Way: The new Operator

Dale E. Rogerson
Microsoft Developer Network Technology Group

Created: August 6, 1992
Revised: January 21, 1993

Abstract

Many developers ask the question, "Do I need to overload the new operator
for Windows--based applications?" when they start programming in C++ with the
Microsoft C/C++ version 7.0 compiler. These developers want to conserve
selectors while allocating memory from the global heap. Fortunately, the
C/C++ version 7.0 run-time library allows developers to reduce selector
consumption without overloading the new operator.

This article examines the behavior of the new operator in a Windows-based
program. It provides an overview of new, discusses whether you should
overload new, examines the C++ ambient memory model, and discusses
large-model C++ programming and dynamic-link library (DLL) ownership issues.

Two sample applications, NewOpr and Owner, illustrate the concepts in this
technical article. A bibliography of suggested reading material is included
at the end of the article.


=============================================================================

=============================================================================

****
**** The MALLOC technical article can be downloaded from the
**** file 11-6.zip in library section number 11
****

Allocating Memory the Old-Fashioned Way: _fmalloc and Applications for
Windows

Dale Rogerson
Microsoft Developer Network Technology Group

Created: July 10, 1992

Abstract

One of the most shocking things that a first-time programmer for Windows has
to learn is not to use malloc but to use special Microsoft Windows memory
allocation functions such as GlobalAlloc, GlobalReAlloc, GlobalLock,
GlobalUnlock, and GlobalFree. The reasons for requiring special memory
allocation functions have mostly gone away with the demise of real mode. In
fact, Microsoft C/C++ version 7.0 brings us almost full circle, because the
preferred method for memory allocation is the large-model version of malloc
or _fmalloc. Even the C startup code now uses malloc to allocate space for
the environment.

This article discusses the behavior of malloc supplied with Microsoft C/C++
version 7.0. The article focuses on programming for the protected
modes---standard and enhanced---of Microsoft Windows version 3.1. The
following topics are discussed:

o  _nmalloc: Why _fmalloc is not the same

o  History: Why _fmalloc was bad

o  Subsegment Allocation: Why _fmalloc is good

o  _ffree: Why _fmalloc is not perfect

o  DLLs: Why _fmalloc may not do what you want

o  Versatility: Why _fmalloc is not for everything

The information for this article was gleaned from the C/C++ version 7.0
compiler run-time library source code.

To interactively explore the behavior of _fmalloc, the Smart Alloc
(SMART.EXE) sample application is provided. Smart Alloc is best used in
conjunction with Heap Walker, which shows the exact state of the global
segments allocated. Segments allocated with GlobalAlloc (or _fmalloc) are
listed by Heap Walker as having a type designation of "Private." Smart Alloc
has a dynamic-link library (DLL) that intercepts all calls to GlobalAlloc,
GlobalFree, and GlobalReAlloc made by Smart Alloc or the C run-time library
and prints messages with OutputDebugString to the debugging console. It is
usually most convenient to use DBWIN.EXE to view these messages.


=============================================================================

=============================================================================

****
**** The CALLB technical article can be downloaded from the
**** file 11-1.zip in library section number 11
****

Calling All Members: Member Functions as Callbacks

Dale Rogerson
Microsoft Developer Network Technology Group

Created: April 30, 1992

Abstract

Microsoft Windows version 3.1 has over 30 callback functions that
applications can use to enumerate objects, hook into the hardware, and
perform a variety of other activities. Due to the prevalence of callbacks, it
is only natural to want to handle callbacks with C++ member functions.
However, callbacks are prototyped as C functions and, therefore, do not
associate data with operations on that data, making the handling of callbacks
less straightforward when you use C++ than it initially might appear.

This article explains why normal member functions cannot be used as callback
functions, gives several techniques for handling callbacks, and illustrates
these techniques with code fragments. The code fragments are included as the
CALLB sample program on the Microsoft Developer Network CD.

The article and source code are targeted toward Microsoft C/C++ version 7.0,
but the ideas presented apply to all C++ compilers, including those by
Borland and Zortech.

The reader should be familiar with Windows callbacks and with C++. A
bibliography is supplied at the end of the article.


=============================================================================

=============================================================================

****
**** The TRICKS technical article can be downloaded from the
**** file 11-26.zip in library section number 11
****

The C/C++ Compiler Learns New Tricks

Dale Rogerson
Microsoft Developer Network Technology Group

Created: August 28, 1992

Revised: January 27, 1993. 
The section on simplified building was removed. (This method links all
programs with the /NOI option enabled, which causes problems.)

Abstract

WinMain, GlobalAlloc, and mixed-model programming---these are just some of
the conventions C programmers had to accept when they started programming for
the Microsoft Windows operating system. Microsoft C/C++ version 7.0 can now
hide these conventions so that programmers can use standard C practices;
applications thus become much easier to develop and port. This article
provides an overview of programming conventions that C/C++ programmers no
longer need and a discussion of the new programming practices in C/C++
version 7.0. A bibliography of suggested reading material is included at the
end of this article.

A sample application called Back (BACK.EXE) and its accompanying
dynamic-link library (DLL) called Trace (TRACE.DLL) demonstrate many of the
ideas in this article. See the "Notes on the Sample Application" section for
more information about Back and Trace.

Note     The information in this article is valid only for Microsoft Windows
version 3.x standard and enhanced modes.


=============================================================================

=============================================================================

****
**** The DYNAMENU technical article can be downloaded from the
**** file 11-29.zip in library section number 11
****

Creating Dynamic Menus with the Microsoft Foundation Classes

Dale E. Rogerson
Microsoft Developer Network Technology Group

Created: November 5, 1992

Abstract

Many applications allow users to dynamically add new items to menus.
Applications such as Microsoft Excel and Word for Windows provide this
capability through their built-in macro languages, and you can add menu items
to the File Manager at run time. 

This article explains how developers can use the Microsoft Foundation Class
(MFC) version 1.0 library to implement menus that can be changed at run time.
The DynaTest sample application demonstrates the key concepts discussed in
the article.


=============================================================================

=============================================================================

****
**** The CPPDLL technical article can be downloaded from the
**** file 11-3.zip in library section number 11
****

Exporting with Class

Dale Rogerson
Microsoft Developer Network Technology Group

Created: October 22, 1992

Abstract

The Microsoft C/C++ version 7.0 compiler supports exporting an entire class
with the following syntax:

class __export CFoo{};

Information on the class export syntax is missing from the C/C++
documentation. This technical article explains how to export a complete class
using the class export syntax and provides a sample application called ClsExp
to demonstrate the syntax.

Note     The information in this article is subject to change, depending on
future versions of Microsoft C/C++ language products.


=============================================================================

=============================================================================

****
**** The CBL_CAPP technical article can be downloaded from the
**** file 11-2.zip in library section number 11
****

How to Pass Parameters Between COBOL and C

Michael Hendrick
Systems Support Engineer, Languages

Created: February 1992

Abstract

This article explains how Microsoft COBOL programs can pass parameters to
and receive parameters from Microsoft C programs. It assumes you have a basic
understanding of the COBOL and C languages.

Microsoft COBOL supports calls to routines written in Microsoft C, FORTRAN,
Pascal, and Assembler. This article describes the necessary syntax for
calling Microsoft C routines and contains a series of examples demonstrating
the interlanguage capabilities between COBOL and C. The sample programs apply
to the following Microsoft products:

o  Microsoft COBOL Professional Development System (PDS) versions 4.0 and
4.5 for MS-DOS and OS/2

o  Microsoft C Optimizing Compiler version 6.0 for MS-DOS and OS/2


=============================================================================

=============================================================================

****
**** The TN001 technical article can be downloaded from the
**** file 11-10.zip in library section number 11
****

MFC TN001---WNDCLASSes and MFC

Created: April 15, 1992

Abstract

This technical note describes the MFC routines for registering special
window classes (WNDCLASS structures) that Windows needs. It discusses
specific WNDCLASS attributes that MFC and Windows use.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples. 


=============================================================================

=============================================================================

****
**** The TN002 technical article can be downloaded from the
**** file 11-11.zip in library section number 11
****

MFC TN002---Persistent Data Format

Created: April 15, 1992

Abstract

This technical note describes the MFC routines for supporting persistent C++
objects and the format of those objects in a persistent store.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples. 


=============================================================================

=============================================================================

****
**** The TN003 technical article can be downloaded from the
**** file 11-12.zip in library section number 11
****

MFC TN003---Handle Maps

Created: April 15, 1992

Abstract

This technical note describes the MFC routines that support mapping Windows
object handles to C++ objects.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples. 


=============================================================================

=============================================================================

****
**** The TN004 technical article can be downloaded from the
**** file 11-13.zip in library section number 11
****

MFC TN004---Template Classes

Created: April 15, 1992

Abstract

This technical note describes MFC template class issues and the MFC templdef
template expansion sample code.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples. 


=============================================================================

=============================================================================

****
**** The TN005 technical article can be downloaded from the
**** file 11-14.zip in library section number 11
****

MFC TN005---Multiple Document Interface (MDI)

Created: April 15, 1992

Abstract

This technical note describes the MFC routines for supporting the multiple
document interface (MDI) of Windows.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples. 


=============================================================================

=============================================================================

****
**** The TN006 technical article can be downloaded from the
**** file 11-15.zip in library section number 11
****

MFC TN006---Message Maps

Created: April 15, 1992

Abstract

This technical note describes the MFC message map facility.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples. 


=============================================================================

=============================================================================

****
**** The TN007 technical article can be downloaded from the
**** file 11-16.zip in library section number 11
****

MFC TN007---Windows Debugging and Trace Options

Created: April 15, 1992

Abstract

This technical note describes the MFC debugging and trace options for
Windows-based applications.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples.


=============================================================================

=============================================================================

****
**** The TN008 technical article can be downloaded from the
**** file 11-17.zip in library section number 11
****

MFC TN008--General OLE Overview

Created: April 15, 1992

Abstract

This technical note gives a general overview of object linking and embedding
(OLE) and the OLE support that the MFC library provides.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples. 


=============================================================================

=============================================================================

****
**** The TN009 technical article can be downloaded from the
**** file 11-18.zip in library section number 11
****

MFC TN009--Writing an OLE Client Application

Created: April 15, 1992

Abstract

This technical note describes the classes and steps involved in creating an
object linking and embedding (OLE) client application.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples. 


=============================================================================

=============================================================================

****
**** The TN010 technical article can be downloaded from the
**** file 11-19.zip in library section number 11
****

MFC TN010--Writing an OLE Server Application

Created: April 15, 1992

Abstract

This technical note describes the classes and steps involved in creating an
object linking and embedding (OLE) server application.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples. 


=============================================================================

=============================================================================

****
**** The TN011 technical article can be downloaded from the
**** file 11-20.zip in library section number 11
****

MFC TN011--Using MFC as Part of a DLL

Created: April 15, 1992

Abstract

This article describes how you can use the Microsoft Foundation Class (MFC)
library as part of a Microsoft Windows dynamic-link library (DLL). It assumes
that you are familiar with Windows DLLs and know how to build them.

The MFC library provides a full-featured set of C++ object classes for the
Windows graphical environment. It includes classes that directly support
application development for Windows as well as general-purpose classes for
collections, files, persistent storage, exceptions, diagnostics, memory
management, strings, and time. Each MFC technical note describes a feature of
MFC using code fragments and examples. 


=============================================================================

=============================================================================

****
**** The TN012 technical article can be downloaded from the
**** file 11-21.zip in library section number 11
****

MFC TN012---Using MFC with Windows Version 3.1 Robustness Features

Created: March 25, 1992

Abstract

This technical note describes some new features found in Microsoft Windows
version 3.1 and describes their use within the Microsoft Foundation Class
(MFC) library.

The MFC library provides a full-featured set of C++ object classes for the
Microsoft Windows graphical environment. It includes classes that directly
support application development for Windows as well as general-purpose
classes for collections, files, persistent storage, exceptions, diagnostics,
memory management, strings, and time. Each MFC technical note describes a
feature of MFC using code fragments and examples.


=============================================================================

=============================================================================

****
**** The TN013 technical article can be downloaded from the
**** file 11-22.zip in library section number 11
****

MFC TN013--Using the Standard Dialog Classes

Created: March 25, 1992

Abstract

This technical note describes the use of the standard dialog classes
provided with MFC.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples.


=============================================================================

=============================================================================

****
**** The TN014 technical article can be downloaded from the
**** file 11-23.zip in library section number 11
****

MFC TN014--Custom Controls and Other Topics

Created: March 25, 1992

Abstract

This technical note describes the custom control support in MFC. It also
discusses self-drawn controls and the CBitmapButton class.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples.


=============================================================================

=============================================================================

****
**** The TN015 technical article can be downloaded from the
**** file 11-24.zip in library section number 11
****

MFC TN015--Windows for Pen Computing Interface to MFC

Created: March 25, 1992

Abstract

This technical note describes the extra interfaces in AFXPEN.H that provide
aC++ interface to the Windows for Pen Computing environment.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples.


=============================================================================

=============================================================================

****
**** The TN016 technical article can be downloaded from the
**** file 11-25.zip in library section number 11
****

MFC TN016--MFC and Multiple Inheritance

Created: March 25, 1992

Abstract

This technical note describes how to use multiple inheritance (MI) with the
Microsoft Foundation Classes.

The Microsoft Foundation Class (MFC) library provides a full-featured set of
C++ object classes for the Microsoft Windows graphical environment. It
includes classes that directly support application development for Windows as
well as general-purpose classes for collections, files, persistent storage,
exceptions, diagnostics, memory management, strings, and time. Each MFC
technical note describes a feature of MFC using code fragments and examples.


=============================================================================

=============================================================================

****
**** The DRAFT3 technical article can be downloaded from the
**** file 11-4.zip in library section number 11
****

The Microsoft Overlay Virtual Environment (MOVE)

Created: March 20, 1992

Abstract

This article explains how the Microsoft overlay virtual environment (MOVE)
helps overcome memory limitations for programs that run in the MS-DOS
operating system. The article compares MOVE technology to conventional
overlays and to paged virtual memory systems, and explains the basics of the
technology.


=============================================================================

=============================================================================

****
**** The OPTIM technical article can be downloaded from the
**** file 11-8.zip in library section number 11
****

Microsoft Windows and the C Compiler Options

Dale Rogerson
Microsoft Developer Network Technology Group

Created: May 5, 1992

Abstract

One of the key issues in the development and design of commercial
applications is optimization---how to make an application run quickly while
taking up as little memory as possible. Although optimization is a goal for
all applications, the Microsoft Windows graphical environment presents some
unique challenges. This article provides tips and techniques for using the
Microsoft C version 6.0 and C/C++ version 7.0 compilers to optimize
applications for Windows. It discusses the following optimization techniques:

o  Using compiler options

o  Optimizing the prolog and epilog code

o  Optimizing the calling convention

o  Aliasing (using the /Ow and /Oa options)


=============================================================================

=============================================================================

****
**** The OBJMAPC technical article can be downloaded from the
**** file 11-7.zip in library section number 11
****

Object Mapping in C++

Tom Germond
Jan Gray, Software Design Engineer, Microsoft C++ Development Group
Dale E. Rogerson, Microsoft Developer Network Technology Group

Created: March 20, 1992

Revised: February 8, 1993

Abstract

This article describes the algorithms and data structures that Microsoft
C/C++ version 7.0 and Visual C++ version 1.0 use to map objects into memory.
It concentrates heavily on virtual functions because they are so powerful and
inexpensive to use. Although the information in this article describes our
implementation, all C++ compilers must solve the same basic problems.


=============================================================================

=============================================================================

****
**** The LARGEM4 technical article can be downloaded from the
**** file 10-21.zip in library section number 11
****

Programming at Large

Dale Rogerson
Microsoft Developer Network Technology Group

Created: April 13, 1992

Abstract

Microsoft Windows version 3.1 signals the death of Windows real mode. With
the release of Windows version 3.1, only standard and enhanced modes are
supported. The end of real mode is the beginning of new programming freedoms,
such as writing large-model applications.

This article explains why the large model is valid for protected mode
applications and discusses the solutions for single instances and the Windows
version 3.0 page-locking bug, limitations of large-model applications.


=============================================================================

=============================================================================

****
**** The MFC-OLE technical article can be downloaded from the
**** file 11-30.zip in library section number 11
****

Programming with MFC/OLE

Lon Fisher
Software Design Engineer, Applications Framework Group

Created: December 4, 1992

Abstract

This article describes what MFC/OLE is, how it works with the OLE API, and
how you can program with it. The article lists all of the steps required to
construct an OLE application and the various operations OLE applications must
support. The article walks through both a client and server example to help
illustrate how you can use MFC/OLE in your program. 




=============================================================================

=============================================================================

****
**** The SS0288 technical article can be downloaded from the
**** file 11-9.zip in library section number 11
****

Relocatable Object Module Format

Microsoft Product Support Services

Created: May 29, 1992

Applicable Products

This application note applies to all versions of the following Microsoft
language products:

Microsoft Basic

Microsoft C

Microsoft C++

Microsoft COBOL

Microsoft FORTRAN

Microsoft Macro Assembler (MASM)

Microsoft Pascal

Microsoft QuickBasic

Microsoft QuickC

Microsoft QuickC for Windows

Microsoft QuickPascal

Microsoft Visual Basic


=============================================================================

=============================================================================

****
**** The SUBCLSS technical article can be downloaded from the
**** file 11-31.zip in library section number 11
****

Subclassing Windows with the Microsoft Foundation Class Library

Dale E. Rogerson
Microsoft Developer Network Technology Group

Created: January 12, 1993

Abstract

This article explains how to subclass windows and controls with the
Microsoft Foundation Class Library. In most cases, the Foundation Class
Library does all of the work; however, in some cases the developer must
supply extra code to subclass a window. 

The NUMEDIT, NUMTEST2, and NUMTEST3 sample applications demonstrate three
subclassing techniques. The article also explains how the CTRLTEST and
SUBCLASS sample applications (both included on the Microsoft Developer
Network CD) work.

Note     The sample applications were built with Microsoft C/C++ version 7.0
and the Microsoft Foundation Class Library version 1.0. The samples will
compile from the command line with Visual C++ version 1.0 and the Microsoft
Foundation Class Library version 2.0. 


=============================================================================

=============================================================================

****
**** The WSTREAMS technical article can be downloaded from the
**** file 11-32.zip in library section number 11
****

Windows Streams

Dale E. Rogerson
Microsoft Developer Network Technology Group

Created: October 27, 1992

Abstract

This article explores the issues pertaining to the use of C++ and
dynamic-link libraries (DLLs) in the development of wstreambuf, which is a
Microsoft Windows-compatible version of the iostream streambuf class.
Discussions include:

o  Using C++ and Microsoft Foundation Class Library version 1.0 in a DLL

o  Exporting C interfaces from a DLL

o  Wrapping C interfaces with C++ in an application

The sample application, Streamer, includes the wstreambuf class. wstreambuf
inherits from the streambuf class and provides the minimum code necessary for
iostream reading and writing to a window (for example: cout << "This is
written to an ostream." << endl).

Note     The sample applications were built with Microsoft C/C++ version 7.0
and the Microsoft Foundation Class Library version 1.0. The samples will
compile from the command line with Visual C++ version 1.0 and the Microsoft
Foundation Class Library version 2.0.


=============================================================================

=============================================================================

****
**** The BUILDSWI technical article can be downloaded from the
**** file 11-27.zip in library section number 11
****

Build Switches in Programmer's WorkBench (PWB)

Created: April 26, 1992

Abstract

The Microsoft Programmer's WorkBench (PWB) is a flexible, extensible
platform for program development. Using PWB, developers can build a final
project (executable) file from a collection of source files. This process
involves creating a make file based on a set of rules describing how the
project will be built. This article describes the build switches that define
these rules. It explains the advanced use of build switches and provides
examples of each switch.


=============================================================================

=============================================================================

****
**** The DLL technical article can be downloaded from the
**** file 11-28.zip in library section number 11
****

Creating DLLs Using Microsoft QuickC for Windows

Created: March 20, 1992

Abstract

Dynamic-link libraries (DLLs) are executable files for the Microsoft Windows
graphical environment that offer many advantages over both standard
executable files and static-link libraries. This article explains what DLLs
are, how you can benefit by using them, how they differ from standard
executable files, and how Microsoft QuickC for Windows simplifies the process
of creating them.


=============================================================================

=============================================================================

****
**** The VCTN001 technical article can be downloaded from the
**** file 11-33.zip in library section number 11
****

Technical Note 1: Window Class Registration

Created: February 9, 1993

Abstract

This note describes the Microsoft Foundation Class (MFC) routines that
register the special WNDCLASSes needed by Microsoft Windows. Specific
WNDCLASS attributes used by MFC and Windows are discussed.


=============================================================================

=============================================================================

****
**** The VCTN002 technical article can be downloaded from the
**** file 11-34.zip in library section number 11
****

Technical Note 2: Persistent Object Data Format

Created: February 9, 1993

Abstract

This note describes the Microsoft Foundation Class (MFC) routines that
support persistent C++ objects and the format of the object data when it is
stored in a file. This only applies to classes with the DECLARE_SERIAL and
IMPLEMENT_SERIAL macros.


=============================================================================

=============================================================================

****
**** The VCTN003 technical article can be downloaded from the
**** file 11-35.zip in library section number 11
****

Technical Note 3: Mapping of Windows Handles to Objects

Created: February 9, 1993

Abstract

This note describes the Microsoft Foundation Class (MFC) routines that
support mapping Microsoft Windows object handles to C++ objects.


=============================================================================

=============================================================================

****
**** The VCTN004 technical article can be downloaded from the
**** file 11-36.zip in library section number 11
****

Technical Note 4: C++ Template Tool

Created: February 9, 1993

Abstract

This note describes Microsoft Foundation Class (MFC) template-class issues
and the MFC TEMPLDEF template expansion tool.


=============================================================================

=============================================================================

****
**** The VCTN006 technical article can be downloaded from the
**** file 11-37.zip in library section number 11
****

Technical Note 6: Message Maps

Created: February 9, 1993

Abstract

This note describes the Microsoft Foundation Class (MFC) message map
facility.


=============================================================================

=============================================================================

****
**** The VCTN007 technical article can be downloaded from the
**** file 11-38.zip in library section number 11
****

Technical Note 7: Debugging Trace Options

Created: February 10, 1993

Abstract

This note describes the Microsoft Foundation Class (MFC) TRACE output
mechanism.


=============================================================================

=============================================================================

****
**** The VCTN008 technical article can be downloaded from the
**** file 11-39.zip in library section number 11
****

Technical Note 8: MFC OLE Support

Created: February 10, 1993

Abstract

This note gives additional details about the Object Linking and Embedding
(OLE) support provided by the Microsoft Foundation Class (MFC) library. You
should read the OLE overview documentation in Chapter 18 of the Class Library
Users Guide as well as the Class Library Reference for the OLE classes.

If you are trying to upgrade an MFC 1.0 application that uses OLE to the
current version of MFC, please refer to Technical Note 18.

The first section gives an overview of terminology and describes how the
MFC/OLE classes provide an interface to the system level OLE libraries. The
second section gives additional information for building MFC/OLE client
applications. The third section gives additional information for building MFC
server applications.


=============================================================================

=============================================================================

****
**** The VCTN011 technical article can be downloaded from the
**** file 11-40.zip in library section number 11
****

Technical Note 11: Using MFC as Part of a DLL

Created: February 10, 1993

Abstract

This note describes how you can use the Microsoft Foundation Class (MFC)
library as part of a Microsoft Windows dynamic-link library (DLL). It assumes
you are familiar with Windows DLLs and how to build them.


=============================================================================

=============================================================================

****
**** The VCTN012 technical article can be downloaded from the
**** file 11-41.zip in library section number 11
****

Technical Note 12: Using MFC with Windows 3.1 Robustness Features

Created: February 10, 1993

Abstract

Microsoft Windows version 3.1 is a major improvement over Windows version
3.0 in the area of robust application development. Windows 3.1 includes a
number of new features that enhance the reliability of a Windows-based
application. This technical note describes the use of these features within
the MFC library.

These features include the debug kernel, STRICT type checking, diagnostics
and memory management, and the WINDOWSX.H enhancements. The Professional
Edition file \MSVC\WINDOWS.TXT includes additional information on these
features.


=============================================================================

=============================================================================

****
**** The VCTN014 technical article can be downloaded from the
**** file 11-42.zip in library section number 11
****

Technical Note 14: Custom Controls

Created: February 9, 1993

Abstract

This note describes the Microsoft Foundation Class (MFC) support for custom
and self-drawing controls. Dynamic subclassing is also described. General
advice on ownership of CWnd objects vs. HWNDs is presented.

The MFC sample application CTRLTEST illustrates many of these features.
Please refer to the source code for that sample (in
\MSVC\MFC\SAMPLES\CTRLTEST) and online help. 


=============================================================================

=============================================================================

****
**** The VCTN015 technical article can be downloaded from the
**** file 11-43.zip in library section number 11
****

Technical Note 15: Windows for Pen

Created: February 10, 1993

Abstract

This note describes the extra interfaces in AFXPEN.H that provide a C++
interface to the Microsoft Windows for Pen environment.

This note applies to Visual C++ Professional Edition only. Visual C++
Standard Edition does not contain the Windows for Pen SDK components.


=============================================================================

=============================================================================

****
**** The VCTN016 technical article can be downloaded from the
**** file 11-44.zip in library section number 11
****

Technical Note 16: Using C++ Multiple Inheritance with MFC

Created: February 10, 1993

Abstract

This note describes how to use Multiple Inheritance (MI) with the Microsoft
Foundation Classes.


=============================================================================

=============================================================================

****
**** The VCTN017 technical article can be downloaded from the
**** file 11-45.zip in library section number 11
****

Technical Note 17: Destroying Window Objects

Created: February 10, 1993

Abstract

This note describes the use of the CWnd::PostNcDestroy member function. Use
this function if you wish to do customized allocation of CWnd-derived
objects.

This note also explains some of the reasons for the cardinal rule: To
destroy a C++ Windows object, use DestroyWindow, not "delete".

This is important. If you follow the guidelines below, you will have few
cleanup problems (such as forgetting to delete/free C++ memory, forgetting to
free system resources like HWNDs, or freeing objects too many times).


=============================================================================

=============================================================================

****
**** The VCTN018 technical article can be downloaded from the
**** file 11-46.zip in library section number 11
****

Technical Note 18: Migrating OLE Applications from MFC 1.0 to MFC 2.0

Created: February 10, 1993

Abstract

This note provides guidelines for migrating Microsoft Foundation Class (MFC)
version 1.0 applications that use MFC/OLE to MFC version 2.0. MFC 2.0, like
its predecessor, supports OLE 1.

The changes in the class interfaces made between versions 1.0 and 2.0 for
most of the Microsoft Foundation classes are relatively minor. For details on
how to migrate the non-OLE portions of your application or a non-OLE MFC
version 1.0 application, please refer to Technical Note 19.

The OLE classes have been significantly changed to make it easier to write
new MFC/OLE applications. The changes add many new services. You have the
option, however, to preserve most of your MFC 1.0 OLE code.

The last section of this note anticipates future versions of OLE (OLE 2).

The changes to the MFC/OLE classes for MFC version 2.0 include:

o  Printed overview and reference documentation.

o  Improved samples.

o  Bug fixes.

o  Integration with the MFC 2.0 document and view architecture.

o  Standard implementations of more UI commands.

o  Some of the more complex details moved out of public interface into
implementation details.

o  Easier to write full-servers using COleTemplateServer.

o  OLE now supported in DLL versions. OLE is now available in both the
_USRDLL and _AFXDLL packaging options. See Technical Note 11 and Technical
Note 33 for more details on the DLL versions of MFC.

Please refer to the OLE overview documentation in Chapter 18 of the Class
Library User's Guide as well as the Class Library Reference for the OLE
classes.


=============================================================================

=============================================================================

****
**** The VCTN019 technical article can be downloaded from the
**** file 11-47.zip in library section number 11
****

Technical Note 19: Migrating MFC 1.0 Applications to MFC 2.0

Created: February 10, 1993

Abstract

This note provides guidelines for migrating Microsoft Foundation Class (MFC)
version 1.0 applications to the MFC version 2.0 libraries and tools.

IMPORTANT: To understand and evaluate the two approaches presented in this
technote, you must be familiar with MFC 2.0 concepts, such as the Document
and View architecture, and the tools. We suggest you at least work through
the SCRIBBLE tutorial in the Class Library User's Guide before beginning any
migration of existing code.

There are two basic approaches to migrating existing applications from
Microsoft Foundation Class (MFC) version 1.0, released with Microsoft C7, to
MFC version 2.


=============================================================================

=============================================================================

****
**** The VCTN020 technical article can be downloaded from the
**** file 11-48.zip in library section number 11
****

Technical Note 20: ID Naming and Numbering Conventions

Created: February 10, 1993

Abstract

This note describes the ID naming and numbering conventions used by
Microsoft Foundation Class (MFC) version 2.0 for resources, commands,
strings, controls, and child windows.


=============================================================================

=============================================================================

****
**** The VCTN021 technical article can be downloaded from the
**** file 11-49.zip in library section number 11
****

Technical Note 21: Command and Message Routing

Created: February 11, 1993

Abstract

This note describes the command routing and dispatch architecture as well as
advanced topics in general window message routing.

Please refer to the Class Library User's Guide for general details on the
architectures described here, especially the distinction between Microsoft
Windows messages, control notifications, and commands. This note assumes you
are very familiar with the issues described in the printed documentation and
only addresses very advanced topics.


=============================================================================

=============================================================================

****
**** The VCTN022 technical article can be downloaded from the
**** file 11-50.zip in library section number 11
****

Technical Note 22: Standard Commands Implementation

Created: February 11, 1993

Abstract

This note describes the standard command implementations provided by
Microsoft Foundation Class (MFC) version 2.0. Please be sure to read
Technical Note 21 first since that describes the mechanisms used to implement
many of the standard commands.

This description assumes knowledge of the MFC architectures, APIs, and
common programming practice. Documented as well as undocumented
"implementation only" APIs are described. This is not a place to start to
learn about the features of or how to program in MFC. Please refer to the
Class Library User's Guide for more general information and the Class Library
Reference for details of documented APIs.


=============================================================================

=============================================================================

****
**** The VCTN023 technical article can be downloaded from the
**** file 11-51.zip in library section number 11
****

Technical Note 23: Standard MFC Resources

Created: February 11, 1993

Abstract

This note describes the standard resources provided with and needed by the
Microsoft Foundation Class (MFC) library.


=============================================================================

=============================================================================

****
**** The VCTN024 technical article can be downloaded from the
**** file 11-52.zip in library section number 11
****

Technical Note 24: MFC-Defined Messages and Resources

Created: February 11, 1993

Abstract

This note describes the internal Microsoft Windows messages and resource
formats used by Microsoft Foundation Classes (MFC). This information explains
the implementation of the framework, and will assist you in debugging your
application. For the adventurous, even though all this information is
officially unsupported, you may use some of this information for advanced
implementations.

This note contains MFC private implementation details; all the contents are
subject to change in the future. MFC private Windows messages have meaning in
the scope of one application only but will change in the future to contain
system-wide messages.


=============================================================================

=============================================================================

****
**** The VCTN025 technical article can be downloaded from the
**** file 11-53.zip in library section number 11
****

Technical Note 25: Document, View, and Frame Creation

Created: February 11, 1993

Abstract

This note describes the creation and ownership issues for WinApps,
DocTemplates, Documents, Frames, and Views. You can find most of this
information, and other interesting creation and ownership issues, in Chapter
2of the Class Library Reference.


=============================================================================

=============================================================================

****
**** The VCTN026 technical article can be downloaded from the
**** file 11-54.zip in library section number 11
****

Technical Note 26: DDX and DDV Routines

Created: February 11, 1993

Abstract

This note describes the dialog data exchange (DDX) and dialog data
validation (DDV) architecture. It also describes how you write a DDX_ or DDV_
procedure and how you can extend ClassWizard to use your routines.


=============================================================================

=============================================================================

****
**** The VCTN027 technical article can be downloaded from the
**** file 11-55.zip in library section number 11
****

Technical Note 27: Emulation Support for Visual Basic Custom Controls

Created: February 11, 1993

Abstract

This technical note is an important supplement to the printed documentation
on Microsoft Foundation Class (MFC) support for VBX controls. Read chapter 17
of the Class Library User's Guide for an introduction to MFC support for VBX
controls. Refer to class CVBControl in the Class Library Reference for
details about this class that encapsulates VBX control support. Refer to the
following subsections of this note for additional information:

o  "Reporting Problems with VBX Controls" advises that if you have problems
using a specific VBX control, you should contact the developer of that VBX
control.

o  "Standard VBX Events" describes each of the standard VBX events that a
given VBX control might send, and how to interpret each type of event in an
MFC application.

o  "Standard VBX Properties" describes each of the standard VBX properties
that a given VBX control might have, and how to access each type of property
in an MFC application.

o  "Grid Control" provides a complete description of the VBX Grid control.
The GRID.VBX is included in the VC++ product. You may redistribute it with
your application. The VBX Grid control is illustrated in the VBCHART sample
application.

o  "CVBControl::m_nError Values" describes the error values that are stored
in CVBControl::m_nError when a property access function such as
CVBControl:SetNumProperty generates an error.

o  "VBX Event-Handling Function Parameters" describes how to interpret the
parameters that are sent to a VBX event-handling function by some VBX
controls.

o  "How to Manage VBX Picture Properties in MFC" describes how to place a
bitmap, metafile, or icon into a VBX control picture property, or retrieve
the picture from the VBX control.

o  "Differences Between Visual Basic VBX Support and MFC VBX Support"
describes in detail how MFC does not exactly emulate Visual Basic's handling
of VBX controls. Typically, you can use a VBX control without running into
problems related to the differences between the MFC and Visual Basic run-time
environments. Still, it's a good idea to become familiar with the differences
to avoid potential problems. It will be necessary for you to understand the
differences only if you need help in diagnosing unexpected VBX control
behavior or run-time errors. Developers of VBX controls should definitely
understand the differences between the MFC and Visual Basic run-time
environments.


=============================================================================

=============================================================================

****
**** The VCTN028 technical article can be downloaded from the
**** file 11-56.zip in library section number 11
****

Technical Note 28: Context-Sensitive Help Support

Created: February 11, 1993

Abstract

This note describes the rules for assigning Help contexts IDs (that is,
topic numbers) and other help issues in Microsoft Foundation Class (MFC) 2.0.
Context-sensitive Help support requires the help compiler, which is available
in Visual C++ Professional.


=============================================================================

=============================================================================

****
**** The VCTN029 technical article can be downloaded from the
**** file 11-57.zip in library section number 11
****

Technical Note 29: Splitter Windows

Created: February 12, 1993

Abstract

This note describes the AFX CSplitterWnd class, which is used to provide
window splits and to manage the resizing of other pane windows.

Note     Please be sure to read Technical Note 20 regarding the use of IDs
and valid ID ranges.


=============================================================================

=============================================================================

****
**** The VCTN030 technical article can be downloaded from the
**** file 11-58.zip in library section number 11
****

Technical Note 30: Customizing Printing and Print Preview

Created: February 12, 1993

Abstract

This note describes the process of customizing printing and print preview
and describes the purposes of the callback routines used in CView and the
callback routines and member functions of CPreviewView.


=============================================================================

=============================================================================

****
**** The VCTN031 technical article can be downloaded from the
**** file 11-59.zip in library section number 11
****

Technical Note 31: Control Bars

Created: February 12, 1993

Abstract

This note describes the control bar classes in Microsoft Foundation Class
(MFC): the general CControlBar, CStatusBar, CToolBar, and CDialogBar.


=============================================================================

=============================================================================

****
**** The VCTN032 technical article can be downloaded from the
**** file 11-60.zip in library section number 11
****

Technical Note 32: MFC Exception Mechanism

Created: February 12, 1993

Abstract

This note briefly describes the implementation of the Microsoft Foundation
Class (MFC) exception-handling mechanism as well as some of the more advanced
features.

Please refer to the Class Library User's Guide for more details on
exceptions.

Please refer to the Class Library Reference for details on the class
CException and derived classes. You should also refer to
CWinApp::ProcessWndProcException for details on the processing of unhandled
exceptions in Microsoft Windows-based applications.


=============================================================================

=============================================================================

****
**** The VCTN033 technical article can be downloaded from the
**** file 11-61.zip in library section number 11
****

Technical Note 33: DLL Version of MFC

Created: February 12, 1993

Abstract

This note describes how you can use the MFC200.DLL and MFC200D.DLL shared
dynamic-link libraries with Microsoft Foundation Class (MFC) applications.

This technical note covers three aspects of DLLs:

o  How you build an MFC application that uses the DLL version of MFC.

And for the more advanced users:

o  How you build an MFC Extension DLL.

o  How the MFC shared dynamic-link libraries are implemented.

If you are interested in building a DLL using MFC that can be used with
non-MFC applications (this is called the _USRDLL version), please refer to
Technical Note 11. 


=============================================================================

=============================================================================

****
**** The VCTN034 technical article can be downloaded from the
**** file 11-62.zip in library section number 11
****

Technical Note 34: Writing a Windows 3.0-Compatible MFC Application

Created: February 12, 1993

Abstract

This technical note describes how you can adapt your Microsoft Foundation
Class (MFC) application to run well under Microsoft Windows version 3.0.


=============================================================================

=============================================================================

****
**** The VCTN035 technical article can be downloaded from the
**** file 11-63.zip in library section number 11
****

Technical Note 35: Using Multiple Resource Files and Header Files with App
Studio

Created: February 12, 1993

Abstract

o  When might you want to split a project into multiple resource files
and/or header files, and how do you do it?

o  How do you share a common header .H file between two .RC files?

o  How do you divide project resources into multiple .RC files?

o  How do you (and the tools) manage build dependencies between .RC, .CPP,
and .H files?

This note assumes that you have read Chapter 2, "Working With Files and
Symbols", of the App Studio User's Guide. 

This note is structured to answer the above questions as follows: 

"Overview of How App Studio Manages Resource Files and Header Files"
provides an overview of how the File Set Includes command in App Studio lets
you use multiple resource files and header files in the same project.

"Analysis of AppWizard-created .RC and .H Files" looks at the multiple
resource and header files that are used by an AppWizard-created application.
These files serve as a good model for additional resource files and header
files you might want to add to your project.

"Including Additional Header Files" describes where you might want to
include multiple header files, and provides details how to do so.

"Sharing a Header File Between Two .RC Files" shows how you can share one
header file between multiple .RC files in different projects, or perhaps in
the same project.

"Using Multiple Resource Files in the Same Project" describes where you
might want to break up your project into multiple .RC files, and provides
details how to do so.

"Enforcement of Non-Editable App Studio Files" describes how you can make
sure App Studio does not edit and unintentionally reformat a custom resource.

"Managing Symbols Shared by Multiple App Studio-Edited .RC Files" describes
how to share the same symbols across multiple .RC files and how to avoid
assigning duplicate ID numeric values.

"Managing Dependencies Between .RC, .CPP, and .H Files" describes how App
Studio and Visual C++ avoid unnecessary recompiling of .CPP files that are
dependent on resource symbol files.

"How App Studio Manages Set Includes Information" provides technical details
about how App Studio keeps track of multiple (nested) .RC files and multiple
header files that are #include'd by an .RC file.


=============================================================================

