| |
| |
Preface | |
| |
| |
| |
Before Jumping into MFC with STL Programming | |
| |
| |
From BASIC, to Object-Oriented Programming, now STL--WHY? | |
| |
| |
Not All PCs are Alike | |
| |
| |
C++ Is Not For Children | |
| |
| |
STL, An Alternative to Data Structures--Really? | |
| |
| |
STL--A First Look | |
| |
| |
Who Invented STL? | |
| |
| |
Is STL Only For Experienced Programmers? | |
| |
| |
STL--The "Big Picture" | |
| |
| |
STL Standardization Breeds Industry Acceptance | |
| |
| |
The Three Components of STL | |
| |
| |
What Is a Container? | |
| |
| |
What Is an Adapter? | |
| |
| |
What Are Algorithms? | |
| |
| |
What Is an Iterator? | |
| |
| |
Are There Any More STL Components? | |
| |
| |
The Complete STL Package | |
| |
| |
Historic C, ANSI C, C++, ANSI C++--HELP! | |
| |
| |
Data Structures--A Review | |
| |
| |
Static vs. Dynamic | |
| |
| |
Typed Pointers | |
| |
| |
Void Pointers | |
| |
| |
Hungarian Notation | |
| |
| |
Overloading Functions | |
| |
| |
Function Pointers | |
| |
| |
Objects Using the C++ Struct Keyword | |
| |
| |
A Structure as a Primitive Class | |
| |
| |
The Syntax and Rules for C++ Classes | |
| |
| |
A Simple C++ Class | |
| |
| |
Objects Using the C++ class Keyword | |
| |
| |
Class Features | |
| |
| |
Classes within Classes | |
| |
| |
Object Initialization and Destruction | |
| |
| |
Member Function Overloading | |
| |
| |
What Is the C++ friend Keyword? | |
| |
| |
The Hidden this Pointer | |
| |
| |
Overloading Operators | |
| |
| |
Class Inheritance | |
| |
| |
I Thought Templates Were Just for C++! | |
| |
| |
Templates out of Structures | |
| |
| |
The Template Keyword | |
| |
| |
Template Syntax | |
| |
| |
Template Functions! | |
| |
| |
Template Classes | |
| |
| |
Why STL Is Better Than Templates | |
| |
| |
Summary | |
| |
| |
| |
Understanding the Difference Between the Standard C++ Library and STL | |
| |
| |
What's New in the Latest ANSI/ISO C++ Standard? | |
| |
| |
An Introduction to Namespaces | |
| |
| |
Coding Namespaces | |
| |
| |
The using Statement | |
| |
| |
The Selective using Statement | |
| |
| |
Renaming Namespaces | |
| |
| |
Static File Scope vs. Unnamed Namespaces | |
| |
| |
Updated ANSI/ISO C++ Casting Operations | |
| |
| |
Dynamic Casting | |
| |
| |
Static Casting | |
| |
| |
C-type Cast | |
| |
| |
Constant Cast | |
| |
| |
What is RTTI? | |
| |
| |
The ANSI/ISO C++ Standard Library | |
| |
| |
A Look at the Libraries | |
| |
| |
Practice With the ANSI/ISO C++ Standard Library | |
| |
| |
Designing A Template | |
| |
| |
The Class Template | |
| |
| |
The Function Template | |
| |
| |
Implementing Class Templates | |
| |
| |
Class Template Parameters | |
| |
| |
Default Template Parameters | |
| |
| |
The Standard Template Library | |
| |
| |
Components of STL | |
| |
| |
Standard Template Library Rules | |
| |
| |
Standard Template Library Function Objects | |
| |
| |
Function Objects | |
| |
| |
Function Adapters | |
| |
| |
Pointer-to-Function Adapters | |
| |
| |
Standard Template Library Algorithms | |
| |
| |
ANSI/ISO C++ Standard Library Language Support | |
| |
| |
A Look at [cstddef] | |
| |
| |
Architecture-specific Headers: [limits], [climits], and [cfloat] | |
| |
| |
Catching Exceptions | |
| |
| |
Additional ANSI/ISO C++ Standard Library Headers | |
| |
| |
Summary | |
| |
| |
| |
STL [utility], [functional], [algorithm], and [iterator] Templates | |
| |
| |
From iostream.h to [iostream] | |
| |
| |
STL Syntax | |
| |
| |
STL [utility] and [functional] Templates | |
| |
| |
[utility] Template Syntax | |
| |
| |
[functional] Template Syntax | |
| |
| |
STL [algorithm] Template | |
| |
| |
Sample Code | |
| |
| |
STL [iterator] Template | |
| |
| |
Iterator Precedence | |
| |
| |
Iterator Range | |
| |
| |
Important Naming Conventions | |
| |
| |
The vectorit.cpp Application | |
| |
| |
The listit.cpp Application | |
| |
| |
Summary | |
| |
| |
| |
STL Containers | |
| |
| |
Dynamic Arrays | |
| |
| |
Making Vectors Data Type-specific | |
| |
| |
How to Instantiate a Vector | |
| |
| |
An Example Using Vector Template Functions | |
| |
| |
Referencing Single Elements | |
| |
| |
Adding and Deleting Elements | |
| |
| |
Determining the Size of a Vector Container | |
| |
| |
Using the [algorithm] Template with Vectors | |
| |
| |
[vector] Example Programs | |
| |
| |
Implementing Stacks with STL Technology | |
| |
| |
STL Defines Stacks, Queues, and Deques as Adaptors | |
| |
| |
[stack] Example Program | |
| |
| |
STL Queues and Double-ended Queues | |
| |
| |
The [deque] Template | |
| |
| |
[queue] and [deque] Example Programs | |
| |
| |
Summary | |
| |
| |
| |
Additional Containers | |
| |
| |
Typedefs Used by the [list] Template | |
| |
| |
allocator_type | |
| |
| |
size_type | |
| |
| |
difference_type | |
| |
| |
reference | |
| |
| |
const_reference | |
| |
| |
value_type | |
| |
| |
const_iterator | |
| |
| |
reverse_iterator | |
| |
| |
const_reverse_iterator | |
| |
| |
[list] Example Programs | |
| |
| |
The initlist.cpp Application | |
| |
| |
The pushlist.cpp Application | |
| |
| |
The revrlist.cpp Application | |
| |
| |
The Map Container | |
| |
| |
Containers Revisited | |
| |
| |
[map] Example Program | |
| |
| |
The paircntnr.cpp Application | |
| |
| |
Summary | |
| |
| |
| |
The STL [numeric] Template | |
| |
| |
[numeric] Example Programs | |
| |
| |
The addup.cpp Application | |
| |
| |
The multiply.cpp Application | |
| |
| |
The runtotl.cpp Application | |
| |
| |
The adjdiff.cpp Application | |
| |
| |
Combining Windows Coding with the STL [numeric] Template | |
| |
| |
Summary | |
| |
| |
| |
The Microsoft Foundation Class (MFC) Library | |
| |
| |
Class Hierarchy | |
| |
| |
CObject | |
| |
| |
Arrays | |
| |
| |
CCmdTarget (Architecture) | |
| |
| |
Control | |
| |
| |
Database | |
| |
| |
Drawing Objects | |
| |
| |
Exceptions | |
| |
| |
File | |
| |
| |
Graphics | |
| |
| |
Lists | |
| |
| |
Maps | |
| |
| |
Menus | |
| |
| |
Sockets | |
| |
| |
Synchronization | |
| |
| |
Classes Not Based On CObject | |
| |
| |
Automation | |
| |
| |
Object Model | |
| |
| |
Structures | |
| |
| |
Support | |
| |
| |
Synchronization | |
| |
| |
Typed Templates | |
| |
| |
Types | |
| |
| |
Wrappers | |
| |
| |
More On MFC Classes | |
| |
| |
| |
An Object-Oriented Approach | |
| |
| |
| |
Using the MFC AppWizard | |
| |
| |
Code Generators | |
| |
| |
Remembering When ... | |
| |
| |
Picking Up the Pace of Life | |
| |
| |
Developing the NoWiz Project | |
| |
| |
The NoWiz.rc Resource File | |
| |
| |
The NoWiz.h Header File | |
| |
| |
The NoWiz.cpp Source Code File | |
| |
| |
Developing the YesWiz Project | |
| |
| |
Working with the AppWizard | |
| |
| |
Understanding the AppWizard's Code | |
| |
| |
What's the Difference? | |
| |
| |
| |
Windows Resources | |
| |
| |
The Microsoft Visual Studio's Bitmap Editors | |
| |
| |
Icons | |
| |
| |
Cursors | |
| |
| |
Bitmaps | |
| |
| |
Microsoft's Sound Recorder | |
| |
| |
Fonts | |
| |
| |
The Textmetric Structure | |
| |
| |
The Logfonta Structure | |
| |
| |
TrueType Fonts | |
| |
| |
CreateFontO | |
| |
| |
CreateFontIndirectO | |
| |
| |
Adding Resources To A Windows Project | |
| |
| |
Base Code | |
| |
| |
Modifications with the ClassWizard | |
| |
| |
The AppWizard Files | |
| |
| |
Building and Testing the PlusRes Application | |
| |
| |
| |
Menu and Keyboard Accelerator Resources | |
| |
| |
Menu and Keyboard Accelerators | |
| |
| |
Menu Fundamentals | |
| |
| |
Keyboard Accelerator Fundamentals | |
| |
| |
Basic Project Code | |
| |
| |
Creative Designs | |
| |
| |
A Unique Menu | |
| |
| |
Unique Keyboard Accelerators | |
| |
| |
The ColorMenu Project Files | |
| |
| |
A look at the ColorMenu.h and ColorMenu.cpp Files | |
| |
| |
Changing to the ColorMenuView.cpp File | |
| |
| |
Running the ColorMenu Application | |
| |
| |
More Menus? | |
| |
| |
| |
Dialog Box Resources | |
| |
| |
Dialog Boxes as Resources | |
| |
| |
The Dialog Box Design Environment | |
| |
| |
The Button (Push Button) Control | |
| |
| |
The Check Box Control | |
| |
| |
The Combo Box Control | |
| |
| |
The Custom Control | |
| |
| |
The Date Time Picker Control | |
| |
| |
The Edit Box Control | |
| |
| |
The Group Box Control | |
| |
| |
The List Control | |
| |
| |
The List Box Control | |
| |
| |
The Month Calendar Control | |
| |
| |
The Progress Control | |
| |
| |
The Radio Button Control | |
| |
| |
The Scroll Bar Controls | |
| |
| |
The Slider Control | |
| |
| |
The Spin Control | |
| |
| |
The Static Text Control | |
| |
| |
The Tab Control | |
| |
| |
Basic Project Code | |
| |
| |
Creating A New About Dialog Box For The Project | |
| |
| |
Creating A Data Entry Dialog Box For The Project | |
| |
| |
A New Menu | |
| |
| |
A New Dialog Box | |
| |
| |
Using the ClassWizard | |
| |
| |
Editing the DataInput.cpp file | |
| |
| |
Editing the DataInputView.cpp file | |
| |
| |
Common Dialog Boxes | |
| |
| |
More Dialog Boxes? | |
| |
| |
| |
Using STL with Graphics Primitives | |
| |
| |
Graphics Device Interface | |
| |
| |
Windows Environments | |
| |
| |
The GetDeviceCaps () Function | |
| |
| |
Mapping Modes | |
| |
| |
Drawing Primitives | |
| |
| |
Arc () and ArcTo () | |
| |
| |
Chord () | |
| |
| |
Ellipse () (and Circle) | |
| |
| |
LineTo () | |
| |
| |
MoveTo () and MoveToEx () | |
| |
| |
Pie () | |
| |
| |
Polygon () | |
| |
| |
Polyline () and PolylineTo () | |
| |
| |
Rectangle () | |
| |
| |
RoundRect () | |
| |
| |
SetPixel () and GetPixel () | |
| |
| |
Windows Graphics Tools | |
| |
| |
Pens | |
| |
| |
Brushes | |
| |
| |
Text Colors | |
| |
| |
Drawing Mode Selection | |
| |
| |
A Simple Application Using The STL and GDI Tools | |
| |
| |
The Basic Project Code | |
| |
| |
Adding Unique Project Code | |
| |
| |
Examining the Project Code | |
| |
| |
More GDI Primitives? | |
| |
| |
| |
Vectors and Complex Numbers | |
| |
| |
A Fourier Application | |
| |
| |
The Basic Application Code | |
| |
| |
Fourier Code Modifications | |
| |
| |
A Closer Look at the Code | |
| |
| |
A Vector Application | |
| |
| |
The [complex] Template Syntax | |
| |
| |
The Basic Application Code | |
| |
| |
Modifications to the Basic Code | |
| |
| |
This Chapter | |
| |
| |
| |
Robust Windows Applications with the STL | |
| |
| |
Common AppWizard Code | |
| |
| |
The Bar Chart Application | |
| |
| |
Modifying the String Table | |
| |
| |
Modifying the Menu | |
| |
| |
Creating a New Dialog Box | |
| |
| |
The BarChartView.cpp File | |
| |
| |
Coding in the View File | |
| |
| |
Running the BarChart Application | |
| |
| |
The Line Chart Application | |
| |
| |
Modifying the String Table | |
| |
| |
Modifying the Menu | |
| |
| |
Creating a New Dialog Box | |
| |
| |
The LineChartView.cpp File | |
| |
| |
Coding in the View File | |
| |
| |
Running theLineChart Application | |
| |
| |
| |
An MFC Screen Saver | |
| |
| |
Screen Saver Files | |
| |
| |
The Saucer.h and Saucer.cpp Files | |
| |
| |
The Saucerwnd.h and Saucerwnd.cpp Files | |
| |
| |
The Drawwnd.h and Drawwnd.cpp Files | |
| |
| |
The Build Operation | |
| |
| |
Testing The Screen Saver | |
| |
| |
What's Next? | |
| |
| |
Index | |