MFC Visual C++6编程技术内幕

出版社:机械工业出版社
出版日期:2000-2
ISBN:9787111077299
作者:Eugene Olafsen等
页数:790页

作者简介

Introduction
Foreword
About the Author
Core MFC
The MFC Architecture
A Brief History of MFC
The MFC Class Hierarchy
CObject
CCmdTarget
CWinThread
CWinApp
CWnd
CFrameWnd
CView
CDocument
Summary
MFC Dialogs, Controls, and Data Interaction
Creating an Application
Starting and Using MFC AppWizard
The AppWizard-Generated Code
Modifying the Application
Adding Dialog Controls
Adding Initialization
Using Dialog Controls
ToolTips
Enabling ToolTips
Displaying Text
Dialog Data Exchange
Standard DDX
UpdateData
Using Standard Dialog Boxes
File Open/Save
Color Selector
Font Selector
Print Dialog
Summary
The Windows Common Controls
Initializing and Using the Common Controls
Notifications for Windows Common Controls
The Notification Message Structure
Overview of the Notification Process
A Better Notification Handling Scheme
Specifying Notification Ranges with ON_NOTIFY_RANGE
Hot Key Controls: Class CHotKeyCtrl
CHotKeyCtrl Class Methods
Creating and Initializing a CHotKeyCtrl Object
Using a Hot Key Control
Spin Controls: Class CSpinButtonCtrl
Spin Control Styles
CSpinButtonCtrl Messages
CSpinButtonCtrl Class Methods
Creating and Initializing a Spin Control
Sample Program: SPIN1
Slider Controls: Class CSliderCtrl
Slider Control Styles
CSliderCtrl Messages
CSliderCtrl Class Methods
Creating and Initializing a Slider Control
Sample Program: Slider Controls (SLIDER1)
Sample Program: SLIDER1
Progress Bar Controls: Class CProgressCtrl
CProgressCtrl Class Methods
Creating and Initializing a CProgressCtrl Object
Using a Progress Control
Image Lists: Class CImageList
CImageList Class Methods
Creating and Initializing a CImageList Control
List View Controls: Class CListCtrl
List View Control Styles
Image Lists and the List View Control
List View Items and Subitems
List View Notification Messages
Creating and Initializing a CListCtrl Object
Using the List View Control
Tree View Controls: Class CTreeCtrl
Tree View Control Styles
Tree View Notification Messages
CTreeCtrl Class Methods
Creating and Initializing a Tree View Control
Using a CTreeCtrl Object
Sample Program: TREELIST.EXE
Tab Controls: Class CTabCtrl
Tab Control Styles
Tab Control Notification Messages
CTabCtrl Class Methods
The Tab Item Structure (TC_ITEM)
Creating and Initializing a Tab Control
Using a Tab Control
Animate Controls: Class CAnimateCtrl
Animate Control Styles
Animate Control Notification Messages
CAnimateCtrl Class Methods
Creating and Initializing an Animate Control
Using an Animate Control
Rich Edit Controls: Class CRichEditCtrl
Rich Edit Control Window Styles
The Character Format Structure (CHARFORMAT)
The Paragraph Format Structure (PARAFORMAT)
CRichEditCtrl Class Methods
CRichEditCtrl Line-Related Methods
CRichEditCtrl Text-Selection Methods
CRichEditCtrl Formatting Methods
CRichEditCtrl Editing Methods
CRichEditCtrl Clipboard Methods
CRichEditCtrl General-Purpose Methods
Creating and Initializing a Rich Edit Control
Using a Rich Edit Control
Summary
Painting, Device Contexts, Bitmaps, and Fonts
Device Contexts
The Graphics Device Interface
MFC Wrapping
MFC Device Context Classes
The Base Class: CDC
Painting with Class CPaintDC
Managing Client Areas with Class CClientDC
Managing Frame Windows with Class CWindowDC
Windows Graphic Objects
Pens: Class CPen
Brushes: Class CBrush
Fonts: Class CFont
Bitmaps: Class CBitmap
Palettes: Class CPalette
Regions: Class CRgn
GDI Coordinate Systems
Logical Mapping Modes
Vector Graphics
Drawing Modes
Lines and Polylines
Rectangles
Regions
Polygons
Ellipses
Bezier Curves
Fonts and Text
Font Characteristics
The TEXTMETRIC Structure
The LOGFONT Structure
Font Creation
Drawing Text
Sample Program: Vector Graphics and Text Methods (VECTEXT1.EXE)
Raster Graphics
Named Raster Operations (ROPs)
Bitmaps
Device-Dependent Bitmaps
Device-Independent Bitmaps (DIBs)
The CBitmap Class
Transferring and Contorting Bitmaps
Bitmap Resources
Tacking Resources onto an Executable File
Getting Image Resources out of an Executable File
Sample Program: Exploring Bitmap Resources (BITMAP1)
Summary
Custom Control Development
Window Classes Versus C++ Classes
A Validating Edit Control
The Clock Static Control
Control Metrics
Painting the Face
Locating the Hands
Painting the Hands
Setting the Time
Pitfalls of Subclassing Standard Controls
The Hyperlink Control
Implementation Strategy
Font Processing
Painting the Window
Controlling the Cursor
Mouse Input
Keyboard Input
Launching the Link
Advanced Custom Control Topics
Subclassing Limitations
Notifications
Using the Resource Editor with Custom Classes
Summary
The MFC Application Object, Message Routing, and Idle Processing
The MFC Application Object
CWinApp and Application Lifetime
The CWinApp Data Members
The CWinApp Member Functions
Application-Specific Initialization
Functionality in InitInstance
OLE Container Support
3D Look for Windows NT 3.5x
Registry Usage
Most Recently Used Files List
SDI and MDI Document/View
Main Frame Window Creation
Automation Support
Rich Edit Control Support
Command-Line Handling
Message Routing, Message Maps, and Message Categories
Message Routing
PreTranslateMessage
Message Maps
Idle Processing
OnIdle
Idle Processing for Dialogs
The Splash Screen Component
Summary
Documents, Views, and Applications That Use Them
The Document/View Architecture
Documents, Frames, and Views
Document Templates
Creating New Documents
Opening New Files
Single Versus Multiple Document Templates
Views
The CView Class
The CScrollView Class
The CFormView Class
The Database View Classes
The Control Views
Changing Views in an SDI
Using the MDI
Summary
Extending the User Interface
Responding to the User
Keyboard Messaging
Handling Keyboard Messages
Mouse Messaging
Handling Mouse Messages
User Interfaces and AppWizard
Extending Menus
Obtaining Menus and Pop-up Menus
Adding Menu Items
Using Floating Pop-up Menus
Putting Control Bars to Use
Using Toolbars and Rebars
Using Status Bars
Showing and Hiding Control Bars
Supporting ToolTips
Updating the User Interface
Property Sheets and Wizards
MFC's Support for Property Sheets and Wizards
Creating a Simple Wizard
Splitting a View
Summary
Printing
Printing Fundamentals
Printing with MFC
Printing in the View
The PrintInfo Object
Printing Menu Commands
Printing and GDI Mapping Modes
WYSIWYG Printing
Application Resources
The Application Class
The View Class
Pagination
Printing with a Known Page Count
Printing with an Unknown Page Count
Printing Page Numbers
Stopping and Aborting Print Jobs
Halting a Print Job in OnPrepareDC()
Halting a Print Job in OnPrint()
Summary
MFC and COM Programming
COM
A Little History
Interfaces, Objects, and Methods
Some Terminology
A Real-World View
The IUnknown Interface
Servers, Clients, and Classes
The COM Runtime Environment
Defining the Class Factory
How Are COM Objects Reused?
Marshaling and Threading
Marshaling
Threading
COM, OLE, and Automation
IDispatch
Automation Servers, Objects, and Controllers
Supporting Both IDispatch and IUnknown
Persisting COM Data
Structured Storage
Identifying COM Data (Monikers)
Transferring Data
Uniform Data Transfer
Connectable Objects
DCOM
Object Creation
Invoking Methods
Security Issues
Some Important Information
BSTR
SAFEARRAY
HRESULT
VARIANT
Further Reading
Summary
COM and MFC
Understanding the Afx Global Functions
Application Lifetime Control
Client Control Management
Connection Point Management
Control Registration
Exceptions
Initialization
Licensing
Type Information
Reviewing the OLE Macros
Class Factories
Client/Container Common Commands
Control Property Persistence
Dialog Data Exchange
Dispatch Maps
Event Maps
Property Page Data Mapping
Property Pages
Type Library Access
MFC and the OLE Class Categories
Active Document
Automation
Common Dialogs for OLE
Container
Control
Drag and Drop (Universal Data Transfer)
Document Servers
Support
Summary
MFC OLE Servers
Document Servers
Server Types
Full Server
Active Document
Container/Server
Mini-Server
Document Server Design
OLE Documents
Active Documents
Building an Active Document Server
Persistence
Rendering the View
Automation Servers
IDispatch
GetIDsOfNames
GetTypeInfo
GetTypeInfoCount
Invoke
IDispatch-Derived Interface in ODL
Calling Methods Through IDispatch
GetIDsOfNames
Type Information Methods
Invoke
Dispinterfaces Differ from Interfaces
Calling Methods Through IDispatch
Dual Interfaces
The Variant
An Automation Server Using MFC
Server Type
Declaring and Defining Additional Dispinterfaces
Adding Methods and Properties
Summary
MFC OLE Clients
IDispatch and Its Place in Automation
Interface Definition for Automation Servers
IDL and ATL
ODL and MFC
Dual Interfaces
MFC and Automation
Controller
Connecting to a Server
Server Review
Building a Controller
Using COleDispatchDriver
Using #import
Remote Automation
Summary
MFC ActiveX Controls
Development Strategy
MFC
ATL
MFC and ATL
Control Development
Two Faces of a Control
Runtime
Design Time
Subclassing a Control
MFC
ATL
Component Categories
ICatRegister
ICatInformation
Methods, Properties, and Events
Properties
Methods
Events
Property Pages
Property Pages in ATL
Property Pages in MFC
Component Registration
Registration Scripts
Registration and Controls
COM Object Subkeys
Building an MFC Control
Interface Definition
A Quick ATL Port
Summary
MFC ActiveX Control Containers
Active Document Container
Storage
Site Objects
In-Place Activation
Document Extensions
Building the Simplest Active Document Container
OLE Controls
Adding Containment to an Existing Project
ActiveX Container
Control Containment and Events
Summary
Using MFC and ATL
What Is ATL and Why Is It Important for Programming in MFC?
Helpful ATL COM Support for MFC Applications
COM Pointers the Smart Way
Other ATL COM Support
Advanced ATL Support for MFC Applications
Begin with Your MFC Application
Add the Required ATL Support
Summary
Scripting Your MFC Application
Scripting Basics
Scripting Interfaces
Dual Interfaces
Object Models
Implementing a Scripted Application
Object Implementation
Summary
MFC Database Programming
MFC Database Processing
Relational Database Concepts
Tables
Columns
Records
Cursors
Transactions
Storing and Retrieving Data
SELECT
INSERT
DELETE
UPDATE
Database Communication Mechanisms
ODBC
DAO
Which Methodology Should I Use?
ODBC/MFC
CDatabase
CRecordset
DAO
CDaoWorkspace
CDaoDatabase
CDaoRecordset
CDaoTableDef
CDaoQueryDef
Summary
Advanced Database Support
The COM Approach
OLE DB
ADO
Which One Should I Use?
OLE DB Consumers Using the ATL Wrapper Classes
CDataSource
CSession
Accessors
Rowsets
Accessing Datasource Data
Using the ADO C++ Interfaces
ADOConnection
ADORecordset
ADOCommand
ADOField
ADOProperty
ADOParameter
ADOError
Summary
MFC Utility Classes
Strings and Collections
Strings and String Classes
Inside the CString Class
Practical CString Usage
CString Summary
Collections
Inside Collection Classes
Templated Collections
The UNL_MultiEd Application
Overview
An STL Approach
Summary
File I/O and MFC
The CFile Class
Processing Files with CFile
Inside the CFile Class
The CStdioFile Class
The CMemFile Class
The CSharedFile Class
The CFileDialog Class
The User-Defined CFileDialog Class
Practical Usage of CFile and CFileDialog
Opening a File
Reading Data from a File
A Classical Approach
What Are Streams?
Summary
Exceptions
What Are They Good For?
Types of Exceptions
Structured Exception Handlers
Nesting of Structured Exception Handlers
Raising Structured Exceptions
Cleaning Up After an Exception
C++ Exceptions
Defining a C++ Exception Class
MFC Exceptions
MFC CException-Derived Classes
CMemoryException
CNotSupportedException
CArchiveException
CFileException
CResourceException
COleException
CDbException
COleDispatchException
CUserException
CDaoException
CInternetException
Deriving Your Own MFC-Compliant Exception Objects
Deleting Exceptions
Using MFC Exception Macros
Mixing Exceptions
Summary
MFC and the Web
MFC and DHTML
DHTML, MSIE, and the Internet
Using the Internet Explorer Web ActiveX Control
Internet Explorer ActiveX Control Basics
CHtmlView
CHtmlView and the Document/View Relationship
CHtmlView and COM
Using the Internet Explorer ActiveX Control in a Dialog Box
Using DHTML
The DHTML Object Model
The Document Object
Other DHTML Objects
Collection Objects
DHTML COM Interfaces
Obtaining the Document DHTML Interface
Obtaining the DHTML Collections Interfaces
Using the DHTML Interface
The DHTML Element Interface Methods
Document Navigation
Summary
CSocket Programming
How Do Network Communications Work?
Sockets, Ports, and Addresses
Winsock and MFC
Initializing the Winsock Environment
Creating a Socket
Making a Connection
Sending and Receiving Messages
Closing the Connection
Socket Events
Controlling Event Triggering
Detecting Errors
Getting Socket Information
Sockets and I/O Serialization
Building a Networked Application
Creating the Application Shell
Window Layout and Startup Functionality
Inheriting from the CAsyncSocket Class
Connecting the Application
Sending and Receiving
Ending the Connection
Summary
WinInet Programming
Web Application Protocols and WinInet
Hypertext Transfer Protocol
File Transfer Protocol
Gopher Protocol
WinInet API and MFC
Internet Session Basics
CInternetSession
CInternetFile
CInternetException
CInternetConnection
Building a Simple WinInet Application
Application-Level Functionality
HTTP Classes
FTP Classes
Gopher Classes
Building a Simple FTP Client
Summary
ISAPI Extensions
The Foundation
From There to Here
From GET to POST
Adding Some Form Elements
Change the Form
Change the Parse Map
Declare and Use the Handler Function
Add a Radio Button
Other Form Input Elements
Change the Form
Change the Parse Map
Change the Handler Function
Summary
MAPI and MFC
The Messaging Application Programming Interface
Client Applications
Two Higher-Level Alternatives: Simple MAPI and CMC
Simple MAPI
Common Messaging Calls
The MapiMessage Structure
The MapiFileDesc Structure
Limited MAPI Functionality in MFC
The CDocument Connection
Doing MAPI the MFC Way
The CDocument::OnFileSendMail() Method
Sample Program: MAPI1.EXE
Summary
TAPE and MFC
Overview
Assisted Telephony
Basic Telephony Service
Supplemental Telephony Service
Extended Telephony Service
History of TAPI
TAPI 1.3
TAPI 1.4
TAPI 1.5
TAPI 2
TAPI 2.1
TAPI 2.2
TAPI 3
Using Assisted Telephony
Using Basic Telephony
Configuring TAPI
Connecting with TAPI
Transmitting Data with TAPI
Disconnection with TAPI
Terminating a TAPI Session
Summary
MFC and Graphics Programming
MFC and OpenGL
What Is OpenGL?
Graphics Boot Camp
Core Terms and Key Concepts
The Basic Mathematics of Graphics Programming
OpenGL Boot Camp
OpenGL Datatypes
OpenGL Function Naming Conventions
OpenGL Render Function Scoping
The OpenGL Matrix Stack
The OpenGL Rendering Context
Minimal OpenGL Program and a Custom View
Creating Your Basic MFC Application
Adding the Custom OpenGL Base Class
Integrate the Custom View Class into Your Application
Build Your 3D Scene
Add the OpenGL Libraries to Your Project抯 Link List
2D and 3D Models
Basic Model Development
Model Transformations
Display Lists
Light
The Basics of Light in OpenGL
Types of Light
Object Material Properties
Texture Mapping
OpenGL Images and Windows Device-Independent Bitmaps
Applying Texture
Special Effects
Blending
Fog
Summary
MFC and DirectX
What Is DirectX?
DirectX in a Nutshell
DirectX Components
DirectX Basics
Differences in COM Programming Style and DirectX
DirectX Component Startup Sequence
DirectDraw Basics
Initializing DirectDraw
DirectDraw and Palettes
DirectDraw Surfaces
DirectDraw Page Flipping
DirectDraw from a Window
Using DirectDraw in Practice
Surfaces and Bitmaps
Windowed Rendering
Error Handling
DirectDraw Shutdown
Summary
Multimedia and MFC
Multimedia Fundamentals
The DirectX Media Player Control
Media Formats Supported by the Media Player Control
Inside the Media Player Control
The CMediaPlayer Class
Using the Media Player Control
Playing Sound
Working with Waves
Revisiting DirectSound
Using DirectSound to Play Sound Effects
Summary
Advanced MFC
Inside the Registry
Registry Usage
Configuration
Services Information
State
User Preferences
The Registry Structure
Programmatic Control of the Registry
The Registry API
The Registry Sample Application
The Registry Key Editor Dialog
Creating a New Key
Deleting a Key
Deleting a Name/Value Pair
A Word About Wrapping the Registry Functions
A Word About Installation
Summary
Writing and Using DLLs
Advantages of DLLs
Code Elimination
Modularity and Packaging
Extensibility
Inside an AFX DLL
Exporting Classes, Functions, and Data
The Big Deal About Exports
Mangled Names
Exporting Classes
What Goes Around, Comes Around
Exporting Explicit Functions
Exporting Data
Exporting MFC Data
Exporting the Destructor
Export Toolkit include Files
What to Export
Other DLL Issues
AfxLoadLibrary and AfxFreeLibrary
Designing for Extensibility and Reuse
Resource Location
Multiple Module Definition Files
Load Addresses and the Linker
Summary
Creating Custom Wizards
Property Sheets and Property Pages
The CPropertySheet and CPropertyPage Classes
The Wizard Walk and the Property Sheet Connection
Creating a Wizard
Setting the Wizard Mode
Enabling the Wizard Buttons
Displaying the Wizard
Wizard Notification Messages
Sample Program: Off to See the Wizard (WIZARD1.EXE)
Creating Wizard Page Dialog Template Resources
Create a Dialog Class for Each Dialog Resource
Exploring the Welcome Page: Class CIntroPage
Exploring the About You Page: Class CPage1
Updating Wizard Information for CPage2 and CPage3
Creating and Displaying the Wizard
Summary
Index


 MFC Visual C++6编程技术内幕下载



发布书评

 
 


 

外国儿童文学,篆刻,百科,生物科学,科普,初中通用,育儿亲子,美容护肤PDF图书下载,。 零度图书网 

零度图书网 @ 2024