Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Standard view
Full view
of .
Look up keyword or section
Like this

Table Of Contents

Deciding How Many Documents the Application Supports
Compound Document Support
Appearance and Other Options
Other Options
Filenames and Classnames
Creating the Application
Try It Yourself
Creating a Dialog-Based Application
Creating DLLs, Console Applications, and More
ATL COM AppWizard
Custom AppWizard
Database Project
DevStudio Add-In Wizard
ISAPI Extension Wizard
MFC ActiveX ControlWizard
MFC AppWizard (DLL)
Win32 Application
Win32 Console Application
Win32 Dynamic Link Library
Win32 Static Library
Changing Your AppWizard Decisions
Understanding AppWizard's Code
A Single Document Interface Application
Other Files
Understanding a Multiple Document Interface
Understanding the Components of a Dialog-Based Application
Reviewing AppWizard Decisions and This Chapter
q Understanding Dialog Boxes
Understanding Dialog Boxes
Creating a Dialog Box Resource
Defining Dialog Box and Control IDs
Creating the Sample Dialog Box
Writing a Dialog Box Class
Using the Dialog Box Class
Arranging to Display the Dialog Box
Behind the Scenes
Using a List Box Control
q Understanding Message Routing
Understanding Message Routing
Understanding Message Loops
Message Map Macros
How Message Maps Work
Messages Caught by MFC Code
Learning How ClassWizard Helps You Catch Messages
The ClassWizard Tabbed Dialog Box
The Add Windows Message Handler Dialog Box
Which Class Should Catch the Message?
Recognizing Messages
Understanding Commands
Understanding Command Updates
Learning How ClassWizard Helps You Catch Commands and Command Updates
q Understanding the Document Class
Understanding the Document Class
Understanding the View Class
Creating the Rectangles Application
Other View Classes
q Understanding Device Contexts
Understanding Device Contexts
Introducing the Paint1 Application
Building the Paint1 Application
Painting in an MFC Program
Switching the Display
Sizing and Positioning the Window
Using Pens
Using Brushes
Scrolling Windows
Building the Scroll Application
Adding Code to Increase Lines
Adding Code to Decrease Lines
q Understanding Basic Printing and Print Preview with MFC
Understanding Basic Printing and Print Preview with MFC
Printing Multiple Pages
Setting the Origin
MFC and Printing
q Understanding Objects and Persistence
Understanding Objects and Persistence
Examining the File Demo Application
A Review of Document Classes
Building the File Demo Application
Creating a Persistent Class
The File Demo 2 Application
Looking at the CMessages Class
Using the CMessages Class in the Program
Reading and Writing Files Directly
The CFile Class
Creating Your Own CArchive Objects
Using the Registry
How the Registry Is Set Up
The Predefined Keys
Using the Registry in an MFC Application
The Sample Applications Revisited
q Building an Application That Displays a String
Building an Application That Displays a String
Creating an Empty Shell with AppWizard
Displaying a String
Building the ShowString Menus
ShowString's About Dialog Box
ShowString's Options Dialog Box
Making the Menu Work
The Dialog Box Class
Catching the Message
Making the Dialog Box Work
Adding Appearance Options to the Options Dialog Box
Changing the Options Dialog Box
Adding Member Variables to the Dialog Box Class
Adding Member Variables to the Document
Changing OnToolsOptions()
Changing OnDraw()
Working with Toolbars
Deleting Toolbar Buttons
Adding Buttons to a Toolbar
The CToolBar Class's Member Functions
Working with Status Bars
Creating a New Command ID
Creating the Default String
Adding the ID to the Indicators Array
Creating the Pane's Command-Update Handler
Setting the Status Bar's Appearance
Working with Rebars
The Progress Bar Control
Creating the Progress Bar
Initializing the Progress Bar
Manipulating the Progress Bar
The Slider Control
Creating the Trackbar
Initializing the Trackbar
Manipulating the Slider
Creating the Up-Down Control
The Image List Control
Creating the Image List
Initializing the Image List
The List View Control
Creating the List View
Creating the List View's Items
Manipulating the List View
The Tree View Control
Creating the Tree View
Creating the Tree View's Items
Manipulating the Tree View
The Rich Edit Control
Creating the Rich Edit Control
Initializing the Rich Edit Control
Manipulating the Rich Edit Control
IP Address Control
The Date Picker Control
Different Kinds of Help
Getting Help
Presenting Help
Using Help
Programming Help
Components of the Help System
Help Support from AppWizard
Planning Your Help Approach
Programming for Command Help
Programming for Context Help
Writing Help Text
Changing Placeholder Strings
Adding Topics
Changing the How to Modify Text Topic
Adjustments to the Contents
q Introducing Property Sheets
Introducing Property Sheets
Creating the Property Sheet Demo Application
Creating the Basic Files
Editing the Resources
Adding New Resources
Associating Your Resources with Classes
Creating a Property Sheet Class
Running the Property Sheet Demo Application
Adding Property Sheets to Your Applications
Changing Property Sheets to Wizards
Running the Wizard Demo Application
Creating Wizard Pages
Displaying a Wizard
Setting the Wizard's Buttons
Responding to the Wizard's Buttons
q The Purpose of ActiveX
The Purpose of ActiveX
Object Linking
Object Embedding
Containers and Servers
Toward a More Intuitive User Interface
The Component Object Model
ActiveX Controls
Changing ShowString
AppWizard-Generated ActiveX Container Code
Moving, Resizing, and Tracking
Handling Multiple Objects and Object Selection
Hit Testing
Drawing Multiple Items
Handling Single Clicks
Handling Double-Clicks
Implementing Drag and Drop
Implementing a Drag Source
Implementing a Drop Target
Registering the View as a Drop Target
Setting Up Function Skeletons and Adding Member Variables
Testing the Drag Target
Deleting an Object
q Adding Server Capabilities to ShowString
Adding Server Capabilities to ShowString
AppWizard's Server Boilerplate
Showing a String Again
Applications That Are Both Container and Server
Building Another Version of ShowString
Nesting and Recursion Issues
Active Documents
What Active Documents Do
Making ShowString an Active Document Server
q Designing ShowString Again
Designing ShowString Again
AppWizard's Automation Boilerplate
Properties to Expose
The OnDraw() Function
Showing the Window
Building a Controller Application in Visual Basic
Type Libraries and ActiveX Internals
q Creating a Rolling-Die Control
Building the Control Shell
AppWizard's Code
Designing the Control
Displaying the Current Value
Adding a Property
Writing the Drawing Code
Reacting to a Mouse Click and Rolling the Die
Notifying the Container
Rolling the Die
Creating a Better User Interface
A Bitmap Icon
Displaying Dots
Generating Property Sheets
Digits Versus Dots
User-Selected Colors
Rolling on Demand
Future Improvements
Enable and Disable Rolling
Dice with Unusual Numbers of Sides
Arrays of Dice
q Using Windows Sockets
Using Windows Sockets
Winsock in MFC
Using the Messaging API (MAPI)
What Is MAPI?
Win95 Logo Requirements
Advanced Use of MAPI
Using the WinInet Classes
Using Internet Server API (ISAPI) Classes
q Designing the Internet Query Application
Designing the Internet Query Application
Building the Query Dialog Box
Querying HTTP Sites
Querying Gopher Sites
Using Gopher to Send a Finger Query
Using Gopher to Send a Whois Query
Future Work
q Embedding an ActiveX Control in a Microsoft Internet Explorer Web Page
Embedding an ActiveX Control in a Microsoft Internet Explorer Web Page
Embedding an ActiveX Control in a Netscape Navigator Web Page
Registering as Safe for Scripting and Initializing
Choosing Between ActiveX and Java Applets
Using AppWizard to Create Faster ActiveX Controls
Speeding Control Loads with Asynchronous Properties
Using BLOBs
Changing Dieroll
Testing and Debugging Dieroll
Why Use the ATL?
Using AppWizard to Get Started
Using the Object Wizard
Adding a Control to the Project
Naming the Control
Setting Control Attributes
Supporting Stock Properties
Adding Properties to the Control
Code from the Object Wizard
Adding the ReadyState Stock Property
Using the Control in Control Pad
Adding Events
Adding Methods to the Event Interface
Implementing the IConnectionPoint Interface
Firing the Click Event
Firing the ReadyStateChange Event
Exposing the DoRoll() Function
Registering as init Safe and script Safe
Preparing the Control for Use in Design Mode
Minimizing Executable Size
Using the Control in a Web Page
Understanding Database Concepts
Using the Flat Database Model
Using the Relational Database Model
Accessing a Database
The Visual C++ ODBC Classes
Creating an ODBC Database Program
Registering the Database
Creating the Basic Employee Application
Creating the Database Display
Adding and Deleting Records
Examining the OnRecordAdd() Function
Examining the OnRecordDelete() Function
Examining the OnSortDept() Function
Examining the DoFilter() Function
Choosing Between ODBC and DAO
q What's in the Enterprise Edition?
What's in the Enterprise Edition?
Understanding SQL
Working with SQL Databases from C++
Exploring the Publishing Application
Setting Up the Data Source
Building the Application Shell
Making a Data Connection
Working with Query Designer
Stored Procedures
Writing a New Stored Procedure
Connecting the Stored Procedure to C++ Code
Working with Your Database
Database Designer
Database Diagrams
Understanding Microsoft Transaction Server
Using Visual SourceSafe
Preventing Errors with ASSERT and TRACE
ASSERT: Detecting Logic Errors
TRACE: Isolating Problem Areas in Your Program
Adding Debug-Only Features
Sealing Memory Leaks
Common Causes of Memory Leaks
Debug new and delete
Automatic Pointers
Using Optimization to Make Efficient Code
Finding Bottlenecks by Profiling
q Reviewing the Benefits of Writing Reusable Code
Reviewing the Benefits of Writing Reusable Code
Using Component Gallery
Adding a Component to the Gallery
Using Gallery Components in Your Projects
Exploring the Gallery
Introducing Custom AppWizards
Understanding Exceptions
Simple Exception Handling
Exception Objects
Placing the catch Block
Handling Multiple Types of Exceptions
The Old Exception Mechanism
Exploring Templates
Introducing Templates
Creating Function Templates
Creating Class Templates
The Standard Template Library
Managed Pointer Templates: auto_ptr
Understanding Namespaces
Defining a Namespace
Namespace Scope Resolution
Unnamed Namespaces
Namespace Aliases
q Understanding Simple Threads
Understanding Simple Threads
Understanding Thread Communication
Communicating with Global Variables
Communicating with User-Defined Messages
Using Semaphores
q Creating Console Applications
r Creating a Console Executable
Creating Console Applications
Writing an Object-Oriented Console Application
Scaffolding Discrete Algorithms
Creating and Using a 32-Bit Dynamic Link Library
Making a 32-Bit DLL
Using 32-Bit DLLs
Sending Messages and Commands
Considering International Software Development Issues
Working with Objects
What Is an Object?
Why Use Objects?
What Is a Class?
Where Are the Functions?
How Are Objects Initialized?
What Is Overloading?
What Is Inheritance?
What Is Protected Access?
What Is Overriding?
What Is Polymorphism?
Managing Memory
Allocating and Releasing Memory
Pointers as Member Variables
Dynamic Objects
Destructors and Pointers
Running Destructors Accidentally
What Else Should I Know?
q Programming for Windows
A C-Style Window Class
Window Creation
Encapsulating the Windows API
Inside CWnd
Getting a Handle on All These MFC Classes
All Those Other Classes
Reviewing Developer Studio: An Integrated Development Environment
Choosing a View
Looking at Interface Elements
Dialog Boxes
The String Table
Version Information
Looking at Your Code, Arranged by Class
Using the View Menu
Reviewing Toolbars
Standard Toolbar
Build Mini-bar
Using Other Toolbars
q Debugging Vocabulary
Debugging Vocabulary
Debugging Commands and Windows
Menu Items
Setting Breakpoints
Examining Variable Values
Stepping Through Code
Edit and Continue
Other Debug Windows
Using MFC Tracer
Defining a Dump Member Function
An Example Using CDumpContext, CFile, and axfDump
q Application information and management
Application Information and Management Functions
ClassWizard Comment Delimiters
Collection Class Helper Functions
CString Formatting and Message-Box Display
Data Types
Diagnostic Services
Exception Processing
Runtime Object Model Services
The Array Classes
Introducing the Array Application
Declaring and Initializing the Array
Adding Elements to the Array
Reading Through the Array
Removing Elements from the Array
The List Classes
Introducing the List Application
Declaring and Initializing the List
Adding a Node to the List
Deleting a Node from the List
Iterating Over the List
Cleaning Up the List
The Map Classes
Introducing the Map Application
Creating and Initializing the Map
Retrieving a Value from the Map
Iterating Over the Map
Collection Class Templates
The String Class
The Time Classes
Using a CTime Object
0 of .
Results for:
No results containing your search query
P. 1
Learn Visual c Plus Plus 6

Learn Visual c Plus Plus 6

|Views: 24|Likes:

More info:

Published by: Aathiraja Krishnamoorthy on Sep 02, 2010
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





You're Reading a Free Preview
Pages 15 to 275 are not shown in this preview.
You're Reading a Free Preview
Pages 290 to 451 are not shown in this preview.
You're Reading a Free Preview
Pages 466 to 566 are not shown in this preview.
You're Reading a Free Preview
Pages 581 to 636 are not shown in this preview.
You're Reading a Free Preview
Pages 651 to 719 are not shown in this preview.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->