search for books and compare prices
Tables of Contents for Mfc Internals
Chapter/Section Title
Page #
Page Count
Foreword
xvii
 
Acknowledgments
xix
 
Introduction
xxi
 
Why MFC Internals?
xxi
 
MFC Internals to the Rescue!
xxii
 
Who Will Benefit from This Book
xxiii
 
How to Use This Book
xxiii
 
A Word of Caution
xxiv
 
Contacting the Authors
xxv
 
A Conceptual Overview of MFC
1
28
Some Background on Object-Oriented Programming
1
1
OOP Terminology
2
1
Abstraction
2
1
Encapsulation
2
1
Inheritance
2
1
Polymorphism
3
1
Modularity
3
1
Objects in General
3
1
Objects and C++
4
2
Why Use OOP?
6
1
Application Frameworks and MFC
7
5
A Little History
7
1
Design Goals for MFC
8
2
The First Release
10
1
But That Wasn't Enough ...
10
1
Where Are We Now?
11
1
A Grand Tour of MFC
12
16
General-Purpose Classes
12
4
Windows API Classes
16
5
Application Framework Classes
21
1
High-Level Abstractions
22
2
Operating System Extensions
24
4
Conclusion
28
1
Basic Windows Support
29
36
MFC versus C/SDK
30
9
All That (Boilerplate) Code
31
1
Comparing the Code
32
4
The WinMain() Function
36
1
Initializing a Particular Instance of the Application
37
1
The Message Loop
37
1
Message Handling
38
1
Basic MFC Application Components
39
7
CWinApp: The Application Object
39
3
CWnd: The Base Window Class
42
2
Turning Window Handles into Window Objects
44
2
Attaching and Detaching Window Handles
46
1
Find WinMain() Now
46
8
MFC State Information
48
3
Back to WinMain()
51
1
Initializing the Framework: AfxWinInit()
52
2
Some Other Hidden Cool Stuff
54
4
Registering Window Classes
54
3
MFC's Windows Hooks
57
1
MFC's Message Pump: CWinApp::Run()
58
1
MFC's GDI Support
58
5
Device Contexts
59
2
Graphic Objects
61
2
Conclusion
63
2
Message Handling in MFC
65
28
CCmdTarget and Message Maps
65
1
Window Messages
66
4
Message Handling Using C and the SDK
67
2
Windows and C++
69
1
MFC Message-Mapping Internals
70
5
The CCmdTarget Class
70
1
Message Map Data Structures
70
1
Message Map Macros
71
4
How MFC Uses Message Maps
75
16
How MFC Windows Become Wired to a WndProc
76
1
Handling Messages
77
4
Handling WM_COMMAND
81
6
Handling Regular Window Messages
87
2
Other Kinds of Messages
89
2
Hooking into the Message Loop: PreTranslateMessage()
91
1
Conclusion
92
1
The MFC Utility Classes
93
58
Simple Value Types
93
14
Class CString: A char * on Steroids
94
12
Other Simple Value Types
106
1
MFC Collection Classes
107
22
MFC Collection Shapes
108
1
MFC Array Collections
108
6
Lists
114
8
MFC Map Collections
122
7
The CFile Family: MFC Access to Files
129
14
Using CFile
130
1
CFile Internals
131
2
CStdioFile
133
3
CMemFile
136
5
There Is Another ...
141
1
CFile Summary
142
1
CException: Providing Better Error Handling
143
5
CException Internals
145
3
Conclusion
148
3
All Roads Lead to CObject
151
50
Isn't That Expensive?
151
1
CObject Features
151
2
An Introduction to Macros
153
1
Run-Time Class Information
153
9
RTCI: How Does It Work?
155
4
Dynamic Creation
159
2
What's Left to Learn about CRuntimeClass?
161
1
Persistence in MFC
162
12
Adding Serialization to Your Classes
162
1
Serialization: How It Works
163
6
CObject and Serialization
169
1
Tracing a Write and a Read of a CObject Derived Object
170
3
Serialization Performance
173
1
A CRuntimeClass Status Update
174
1
CObject Diagnostic Support
174
6
Diagnostic Output
174
1
Run-Time Checking
175
2
Memory Diagnostics
177
3
Inside CObject Diagnostic Support
180
16
Diagnostic Output
180
7
Advanced Memory Diagnostics
187
5
Back to CMemoryState
192
3
Cool AFX Helper Functions
195
1
Putting It All Together
196
1
Putting It into Practice
197
1
Is It Worth It?
198
1
Conclusion
199
2
MFC Dialog and Control Classes
201
58
CDialog: Modal and Modeless MFC Dialogs
201
24
Using CDialog
201
3
CDialog Internals
204
8
CDialog Control Initialization
212
3
DDX/DDV: CDialog Exchange and Validation
215
10
MFC Common Dialogs
225
11
Using the MFC Common Dialog Classes
226
1
Common Dialogs Internals
227
8
MFC Common Dialog Wrapup
235
1
OLE Dialogs
236
3
Using the OLE Dialogs
237
1
MFC OLE Dialog Class Internals
237
2
OLE Dialog Summary
239
1
Property Sheets (a.k.a. Tabbed Dialogs)
239
11
Using MFC Tabbed Dialogs
240
1
Property Sheet and Page Internals
241
8
Property Sheet Recap
249
1
MFC Control Classes
250
7
The ``Old-Fashioned'' Windows Control Classes
250
6
The ``New-Fangled'' MFC Windows Common Control Classes
256
1
Conclusion
257
2
MFC's Document/View Architecture
259
36
Why You Want Document/View
259
1
Other Reasons
260
1
The Old Way
260
1
The Architecture
261
6
Documents and Views
261
1
Document/View Components
262
4
CWinApp's Role
266
1
Inside the Document/View Architecture
267
22
The CWinApp/CDocTemplate Interface: CDocManager
267
6
CDocTemplate: CDocument, CView, and CFrameWnd Manager
273
6
CFrameWnd Internals
279
3
CDocument Internals
282
6
CView Internals
288
1
Document/View Internals Recap
289
4
Document/View Interdependencies
289
1
Creation Information
290
1
Putting It All Together
290
3
Conclusion
293
2
Advanced Document/View Internals
295
38
Mirror, Mirror, on the Wall ...
295
4
Inside CMirrorFile
296
3
CView Printing
299
8
CView Printing Overview
300
2
CView Printing Internals
302
5
Inside CView Print Preview Support
307
10
CView::OnFilePrintPreview()
308
1
CPrintPreviewState
309
1
Inside DoPrintPreview()
309
2
CPreviewView: An Undocumented Print Preview CView Derivative
311
3
Inside CPreviewView::SetPrintView()
314
2
Print Preview Wrapup
316
1
CView Derivatives: CScrollView
317
10
How CScrollView Works
317
6
CScrollView Recap
323
1
CForm View: Forms in a View
324
3
CForm View Recap
327
1
Another CView Derivative: CCtrlView
327
4
CCtrlView: How It Works
327
2
CTreeView: An Example Control View/CCtrlView Derivative
329
1
CCtrlView Wrapup
330
1
Conclusion
331
2
MFC's Enhanced User-Interface Classes
333
66
CSplitterWnd: MFC Splitter Windows
333
32
The Anatomy of a Splitter Window
334
1
Refresher: How to Use CSplitterWnd
335
1
Inside CSplitterWnd
336
27
CSplitterWnd Recap
363
2
The MFC CControlBar Architecture
365
27
Step Right Up to the CControlBar
365
17
CControlBar Persistence
382
8
CControlBar Layout Management
390
1
CControlBar Recap
391
1
CMiniFrameWnd
392
2
MFC MRU File List Implementation
394
2
How MFC Implements MRU File Lists
394
2
Conclusion
396
3
MFC DLLs and Threads
399
34
Understanding States
399
8
MFC States Explained
400
5
How the MFC States Are Related
405
2
MFC DLLs
407
10
DLL Resource Issues
408
6
Extension DLL Initialization and Cleanup
414
1
AFXDLL and Macros
414
3
MFC Threads
417
12
MFC Worker Threads
417
7
MFC User-Interface Threads
424
5
A Tale of Threads, Handles, and Objects
429
1
Conclusion
429
4
For More Information
430
1
Up Next
431
2
How MFC Implements COM
433
68
MFC and OLE
434
1
The Component Object Model
434
1
What Is a COM Class?
435
2
Do You Speak I-Speak?
437
2
Globally Unique Identifiers
439
1
Exploring the Great IUnknown
439
5
Object Lifetime Management
440
2
Interface Negotiation
442
1
A Peek at the Client Side: Call/Use/Release
443
1
COM Object Servers
444
10
In-Proc Servers (DLLs)
445
1
Out-of-Proc Servers (EXEs)
445
1
Class Factories
446
3
Exposing the Class Factory in an In-Proc Server
449
1
Exposing the Class Factory in an Out-of-Proc Server
449
1
Unloading In-Proc Servers
450
1
Unloading Out-of-Proc Servers
451
1
Class Registration in the Registry
452
1
Creating Instances of COM Classes
453
1
COM Classes with Multiple Interfaces
454
10
Implementing CoMath Using Multiple Inheritance
455
3
Implementing CoMath Using Nested Classes
458
4
A Class Factory for CoMath
462
2
MFC COM Classes
464
3
Using MFC to Create CoMath
467
8
IUnknown and CCmdTarget
467
1
COM Aggregation
468
5
The Internal IUnknown Functions
473
1
The External IUnknown Functions
474
1
Multiple Interfaces through Nested Classes
474
1
The MFC COM and Interface Map Macros
475
4
Declaring the Nested Classes
475
2
Building the Interface Map
477
2
The CoMath Class Using MFC
479
6
MFC COM Classes and Inheritance
482
2
InternalQueryInterface() Revisited
484
1
Finishing the Server
485
2
Implementing the Interfaces
485
2
MFC Support for Class Factories
487
11
COleObjectFactory
487
4
Developer Tip: Registering Other Information
491
2
The Heart of COleObjectFactory: OnCreateObject()
493
1
COleObjectFactory and IClassFactory::LockServer()
493
1
Creating Class Factories within Your App
494
1
COleObjectFactory and Interface Maps
495
2
Exporting the Class Factory from a DLL
497
1
Conclusion
498
3
Uniform Data Transfer and MFC
501
38
Some History
501
3
The Old Way
502
1
Limitations of the Windows Clipboard and DDE
503
1
OLE and Uniform Data Transfer
504
1
Important Structures
504
3
The FORMATETC Structure
504
2
The STGMEDIUM Structure
506
1
The IDataObject Interface
507
2
IDataObject::GetData()
508
1
IDataObject::GetDataHere()
508
1
IDataObject::QueryGetData()
508
1
IDataObject::GetCanonicalFormatEtc()
508
1
IDataObject::SetData()
508
1
IDataObject::EnumFormatEtc()
509
1
IDataObject::DAdvise()
509
1
IDataObject::DUnadvise()
509
1
IDataObject::EnumDAvise()
509
1
The OLE Clipboard
509
2
MFC's IDataObject Classes
511
4
Transferring Data via the Clipboard
511
4
Delayed Rendering
515
1
MFC's IDataObject Classes in Detail
516
10
COleDataSource
517
6
COleDataObject
523
3
OLE Drag-and-Drop
526
12
IDropSource
526
1
IDropTarget
526
2
Implementing Drag-and-Drop Data Transfer Using MFC
528
1
Originating a Drag-and-Drop Transfer
528
1
Implementing a Drop Target
529
2
Inside MFC's Drag-and-Drop Classes
531
3
How MFC Drag-and-Drop Works
534
4
Conclusion
538
1
OLE Documents the MFC Way
539
42
OLE Documents 101
540
10
Linking and Embedding
540
2
Structured Storage, Compound Files, and Persistent Objects
542
5
In-Place Activation and Visual Editing
547
1
OLE Document Containers
548
1
OLE Document Servers
549
1
The OLE Document Protocol
550
1
MFC's Support for OLE Documents
550
7
The Base Classes: CDocItem and COleDocument
550
2
OLE Document Containers the MFC Way
552
2
COleLinkingDoc
554
3
OLE Document Servers the MFC Way
557
4
COleServerDoc
557
4
COleServerItem
561
1
The Container/Server Dance (Embedding)
561
14
The Container: Creating a New File
561
1
Adding Container Items
562
13
Deactivating the Item
575
2
Inside COleClientItem::Close()
575
2
Saving the Container's Document
577
1
Loading OLE Documents
578
2
Conclusion
580
1
MFC and Automation
581
38
The History of Automation
581
1
What Automation Can Do for You
582
2
Writing an MFC Automation Application
584
1
But How Does It All Work?
584
1
COM Interfaces versus Automation
585
12
COM Interfaces Reviewed
585
2
IDispatch: The Key to Automation
587
4
Implementing IDispatch by Hand
591
6
Another Way: Using Type Information
597
5
Type Information
597
1
Object Description Language
597
2
Implementing IDispatch Using Type Information
599
2
Recap: Automation in the Raw
601
1
MFC and Automation
602
15
Extensions to CCmdTarget
602
2
Dispatch Maps
604
7
CCmdTarget and GetlDsOfNames()
611
2
CCmdTarget and Invoke()
613
1
MFC and Type Information
614
3
Conclusion: The Consequences of ``The MFC Way''
617
2
OLE Controls
619
36
VBXs and Their Shortcomings
620
1
OLE Controls
620
1
Writing a Control
621
1
Using OLE Controls in a Project
622
2
OLE Controls in a Dialog Box
622
1
Using an OLE Control in a View
623
1
So How Does It All Work?
624
4
MFC's OLE Control Classes
624
4
MFC and OLE Control Containers
628
1
COleControlContainer
628
1
COleControlSite
628
1
COccManager
629
1
A Day in the Life of an OLE Control
629
5
Control Creation
630
2
Inside the Control
632
1
Finishing Creating the Control
633
1
OLE Connections
634
5
OLE Connection Interfaces
635
1
Establishing a Connection
636
3
Establishing a Connection (Continued)
639
1
OLE Control Events
639
3
Firing Events
641
1
MFC OLE Control Events
641
1
How MFC Handles Events
642
1
Developer Tip: Adding an Event Sink to a View
643
3
Adding a Function to Handle the Event
644
1
Setting Up the Event Sink Map
645
1
Inside OLE Control Property Pages
646
8
Property Pages in a Nutshell
647
1
Programming the Property Page
648
1
Inside the Properties Verb
649
2
Inside COlePropertyPage
651
1
Accessing the Properties
652
1
Inside GetPropCheck()
653
1
Property Page Wrapup
653
1
Conclusion
654
1
Appendix A A Field Guide to the MFC Source Code
655
34
MFC Coding Techniques
656
5
Class Declaration Subsections
656
1
Variable Naming---Think Hungarian!
657
1
Symbol-Naming Conventions
658
1
The Proof Is in the Pudding!
658
1
Common MFC #defines
659
1
Granularity and Swap Tuning?!
660
1
Tools for Exploring MFC
661
1
The Visual C++ Browser
661
1
Visual C++ Find in Files
662
1
A Visual C++ Syntax-Coloring Tip
662
1
Commercial Products
662
1
A Guide to the MFC Source Code
662
25
MFC Directory Structure
662
2
MFC Header Files
664
8
MFC Inline Files
672
1
MFC Resources
673
1
MFC Source Files
674
13
Happy Trails...
687
2
Appendix B The MFC Internals Floppy
689
2
Index
691