Introduction to MFC Programming with Visual C++

Paperback (Print)
Buy New
Buy New from BN.com
$45.59
Buy Used
Buy Used from BN.com
$41.17
(Save 41%)
Item is in good condition but packaging may have signs of shelf wear/aging or torn packaging.
Condition: Used – Good details
Used and New from Other Sellers
Used and New from Other Sellers
from $1.99
Usually ships in 1-2 business days
(Save 97%)
Other sellers (Paperback)
  • All (30) from $1.99   
  • New (8) from $44.37   
  • Used (22) from $1.99   

Overview

1662J-5

  • Not just a "run-the-wizard, push-the-buttons" guide -- real MFC mastery!
  • Starts from ground zero: no object-oriented expertise required!
  • An important but simple example illustrations how MFC invokes your virtual functions.
  • Introduces MFC Document/View Architecture, program structure, and much more.
  • Includes more than 90 short programs illustrating collection classes, mouse and keyboard techniques, common controls, menus, and more.
  • Covers bitmap graphics and database access.

Simply the most effective, thorough introduction to MFC you can find!

If you really want to master MFC, there are no shortcuts, but there is one great book: Introduction to MFC Programming with Visual C++.

Unlike many MFC books, this one doesn't start with Microsoft's AppWizard. Rather, it begins by giving you an in-depth grounding in the structure of MFC programs: an understanding that will serve you well in every program you write. Author Richard Jones also introduces the fundamentals of object-oriented programming with MFC and Visual C++, the essential concepts underlying MFC, the Document/View architecture, and much more.

Once you understand how MFC really works, Jones helps you accomplish more than you ever imagined. You'll not only master MFC's common interface controls, but also database access, and much more. Introduction to MFC Programming with Visual C++ contains dozens of diagrams and programs–from to-the-point snippets to sizable programs designed to demonstrate powerful software engineering techniques.

About the CD-ROM

  • This title originally included a CDROM that contained all of the sample programs. This CDROM is no longer available, nor are the sample programs.
Read More Show Less

Product Details

  • ISBN-13: 9780130166296
  • Publisher: Prentice Hall
  • Publication date: 12/23/1999
  • Series: Microsoft Technologies Series
  • Pages: 300
  • Product dimensions: 8.50 (w) x 11.00 (h) x 0.78 (d)

Meet the Author

Richard Jones is Professor at Western Connecticut State University, and has been teaching MFC and Win32 programming for four years.

Read More Show Less

Read an Excerpt

Preface

The 15 chapters in this book present you with a sequence of MFC topics, sample MFC pro-grams and activities. It is my conviction that if you carefully read the topics, study the programs, and do a reasonable number of the suggested exer-cises (yes, practice is necessary), then in about two months time you will feel comfortable writing win-dows programs in C++. Prerequisites

Since this book does not cover C++, programming logic, and common algorithms, I assume that you already have a certain minimum level of program-ming experience, and a fairly sound knowledge of C++. Specifically, if you have had a 15-week pro-gramming course using C++ where you have used arrays, structures, and have created a few classes, I think that will constitute an appropriate amount of experience.

One of the wildcard factors in learning C++ windows programming is the extent to which you simply enjoy the activity of programming. If you can sit and concentrate for three, four, or five hours working on a problem, then I think your success can be guaranteed. You definitely cannot dabble in MFC and expect any results. The Genesis of this Book

Over the last four years I have taught windows pro-gramming (both Win32 programming and MFC programming) in a variety of contexts using at least five different textbooks. These books have ranged from 1300-page encyclopedias to 570 pages of App-Wizard- generated code. In each class I would invari-ably have handouts consisting of sample programs and diagrams.

Not content with the available instructional material, I pulled together my "class handouts" dur-ing the winter break of '98-'99, and wrote a 70-page, spiral-bound manualthat contained 28 short and simple MFC programs—I still like the title: "Getting a Grip on MFC."

The program listings were positioned on the right-hand side pages with accompanying discussion of programs on the preceding left-hand page. Since the page size was 8.5"x11", a good amount of pro-gram code and remarks could be put onto facing pages. This particular layout allowed the reader to gain a perspective on the entire program, and it also let the reader to focus on specific parts of the program.

For my students, this booklet proved to have the right balance of program examples and discussion. I believe that a program illustrating a concept is much better than a page of text that describes a concept.

That booklet was the genesis of this book. Topic Sequence Is Important

Beside the many short, easy-to-understand program examples, another major organizational feature of the book is the sequence in which topics are introduced. When a new topic is introduced, you will have been adequately prepared for that topic by the presentation of previous topics. We elaborate on this shortly.

You might think that all books would subscribe to such a presentation sequence. But MFC is such a big subject, deciding where to start and what to cover next is not evident. Notable Features of this Book

What are the distinctive features of this book? How does it differ from other MFC books? Preparation for New Topics

Before you see the first MFC windows program in Chapter 4, you will learn about various MFC classes in the familiar "console application" setting.

This way, when you get to Chapter 4, much of the code in the first program there will be familiar to you. Now all you will be expected to do is focus on the one new concept—message maps.


  • In Chapter 1, you study the MFC utility objects in console applications before they are used in the first windows program in Chapter 4. MFC utility objects are used everywhere in windows programs.
  • Virtual functions are very common in MFC windows programs. In Chapter 2 we study a console program that uses a virtual function — BurnFuel() — in precisely the same way MFC uses them. Now, when you see your first MFC virtual function in Chapter 4 — InitInstance() — you will not be mystified.
  • In Chapter 3, we illustrate the use of MFC collection class objects in console applications. Again, when you next see these objects in windows applications, you will feel more comfortable with them, because of your previous experience.
  • In Chapter 8, we first introduce the AppWizard and ClassWizard. At that point, you have a good number of MFC concepts "under your belt" and are ready to focus on seeing how these Wizards can help you.
  • Chapter 14 pulls "all the parts" together into programs with both the "document" and "view" architecture. At this point, you are ready to embrace the "document" concept because since Chapter 6 we have been encouraging you to write object-oriented programs—where your entire application is a class object. For example, see program Ex06i. Here the application object is the CTextLines object, Text.
More than 90 Program Examples

By doing you will learn. For that reason, there are more than 90 short, easy-to-understand programs on the accompanying CD. Most of these are described in the text, and were created specifically so you could practice modifying them. Diagrams

There are many relationships involved in windows programs. This book has many diagrams that will help you picture various relationships and activity. How to Use This Book in a C++ Course Sequence

Before this past year, I had felt that presenting "MFC programming"—in say, a software engineering course—constituted an interruption to the main flow of the course. In effect, "Let's put a hold on the important stuff we are doing now, because I now want to show you a few things that will make your programs look better."

But I finally realized that MFC—as an object-oriented system—could be incorporated into the course and be used as a tool for teaching object-oriented programming concepts. So here are my suggestions where this book might be used as an important supplement in the common, introductory, two-semester course sequence. The First C++ Programming Course—All Programs Are Console Applications

  • The utility classes in Chapter 1 make great examples of classes that students can use before they write their own. Problems abound: Given 100 randomly generated CPoint objects, find the two points that are closest together.
  • Parts of Chapter 2 can be covered when classes are introduced.
  • Parts of Chapter 3 can be used after arrays have been discussed. Other parts of Chapter 3 can be used if pointers are covered in the first course.
The Second Course—Where Data Structures Is Commonly The Primary Topic

Suppose parts of Chapters 1, 2, and 3 are covered in the first course.

  • Then, if only Chapters 4, 5, and 6 are covered in this second course, students will be prepared to write a wide range of challenging window applications.
  • The remaining chapters of the book might be left for students to read on their own.

Richard M. Jones
JonesR@WCSUB.CtStateU.edu
JonesJ@csu.cted.net

Read More Show Less

Table of Contents

I. OBJECT CONCEPTS IN CONSOLE APPLICATIONS.

1. Using MFC Utility Classes in Console Applications.

2. Classes: A Review of Concepts.

3. Collections, CFiles, and Serializing Objects.

II. HANDCRAFTED MFC WINDOWS PROGRAMS.

4. Event Handling: Keyboard and Mouse Input.

5. Device Context Attributes and Functions.

6. Mouse and Keyboard Techniques.

7. Using Window Controls.

8. Menus and Dialogs.

III. APPWIZARD APPLICATIONS WITH NO DOCUMENT.

9. The AppWizard and ClassWizard.

10. More on Menus, Toolbars, and Dialogs.

11. Timers and the XOR Draw Mode.

12. Bitmap Graphics.

13. Sending and Posting Messages.

IV. THE DOCUMENT / VIEW ARCHITECTURE.

14. Using The Document / View Architecture.

15. Database Processing.

Appendices.

Appendix A: A Win32 Program.

Appendix B: Using the Debugger.

Appendix C: The Editor.

What's On the CD?

Read More Show Less

Preface

Preface

The 15 chapters in this book present you with a sequence of MFC topics, sample MFC pro-grams and activities. It is my conviction that if you carefully read the topics, study the programs, and do a reasonable number of the suggested exer-cises (yes, practice is necessary), then in about two months time you will feel comfortable writing win-dows programs in C++.

Prerequisites

Since this book does not cover C++, programming logic, and common algorithms, I assume that you already have a certain minimum level of program-ming experience, and a fairly sound knowledge of C++. Specifically, if you have had a 15-week pro-gramming course using C++ where you have used arrays, structures, and have created a few classes, I think that will constitute an appropriate amount of experience.

One of the wildcard factors in learning C++ windows programming is the extent to which you simply enjoy the activity of programming. If you can sit and concentrate for three, four, or five hours working on a problem, then I think your success can be guaranteed. You definitely cannot dabble in MFC and expect any results.

The Genesis of this Book

Over the last four years I have taught windows pro-gramming (both Win32 programming and MFC programming) in a variety of contexts using at least five different textbooks. These books have ranged from 1300-page encyclopedias to 570 pages of App-Wizard- generated code. In each class I would invari-ably have handouts consisting of sample programs and diagrams.

Not content with the available instructional material, I pulled together my "class handouts" dur-ing the winter break of '98-'99, and wrote a 70-page, spiral-bound manual that contained 28 short and simple MFC programs—I still like the title: "Getting a Grip on MFC."

The program listings were positioned on the right-hand side pages with accompanying discussion of programs on the preceding left-hand page. Since the page size was 8.5"x11", a good amount of pro-gram code and remarks could be put onto facing pages. This particular layout allowed the reader to gain a perspective on the entire program, and it also let the reader to focus on specific parts of the program.

For my students, this booklet proved to have the right balance of program examples and discussion. I believe that a program illustrating a concept is much better than a page of text that describes a concept.

That booklet was the genesis of this book.

Topic Sequence Is Important

Beside the many short, easy-to-understand program examples, another major organizational feature of the book is the sequence in which topics are introduced. When a new topic is introduced, you will have been adequately prepared for that topic by the presentation of previous topics. We elaborate on this shortly.

You might think that all books would subscribe to such a presentation sequence. But MFC is such a big subject, deciding where to start and what to cover next is not evident.

Notable Features of this Book

What are the distinctive features of this book? How does it differ from other MFC books?

Preparation for New Topics

Before you see the first MFC windows program in Chapter 4, you will learn about various MFC classes in the familiar "console application" setting.

This way, when you get to Chapter 4, much of the code in the first program there will be familiar to you. Now all you will be expected to do is focus on the one new concept—message maps.

  • In Chapter 1, you study the MFC utility objects in console applications before they are used in the first windows program in Chapter 4. MFC utility objects are used everywhere in windows programs.
  • Virtual functions are very common in MFC windows programs. In Chapter 2 we study a console program that uses a virtual function — BurnFuel() — in precisely the same way MFC uses them. Now, when you see your first MFC virtual function in Chapter 4 — InitInstance() — you will not be mystified.
  • In Chapter 3, we illustrate the use of MFC collection class objects in console applications. Again, when you next see these objects in windows applications, you will feel more comfortable with them, because of your previous experience.
  • In Chapter 8, we first introduce the AppWizard and ClassWizard. At that point, you have a good number of MFC concepts "under your belt" and are ready to focus on seeing how these Wizards can help you.
  • Chapter 14 pulls "all the parts" together into programs with both the "document" and "view" architecture. At this point, you are ready to embrace the "document" concept because since Chapter 6 we have been encouraging you to write object-oriented programs—where your entire application is a class object. For example, see program Ex06i. Here the application object is the CTextLines object, Text.

More than 90 Program Examples

By doing you will learn. For that reason, there are more than 90 short, easy-to-understand programs on the accompanying CD. Most of these are described in the text, and were created specifically so you could practice modifying them.

Diagrams

There are many relationships involved in windows programs. This book has many diagrams that will help you picture various relationships and activity.

How to Use This Book in a C++ Course Sequence

Before this past year, I had felt that presenting "MFC programming"—in say, a software engineering course—constituted an interruption to the main flow of the course. In effect, "Let's put a hold on the important stuff we are doing now, because I now want to show you a few things that will make your programs look better."

But I finally realized that MFC—as an object-oriented system—could be incorporated into the course and be used as a tool for teaching object-oriented programming concepts. So here are my suggestions where this book might be used as an important supplement in the common, introductory, two-semester course sequence.

The First C++ Programming Course—All Programs Are Console Applications

  • The utility classes in Chapter 1 make great examples of classes that students can use before they write their own. Problems abound: Given 100 randomly generated CPoint objects, find the two points that are closest together.
  • Parts of Chapter 2 can be covered when classes are introduced.
  • Parts of Chapter 3 can be used after arrays have been discussed. Other parts of Chapter 3 can be used if pointers are covered in the first course.

The Second Course—Where Data Structures Is Commonly The Primary Topic

Suppose parts of Chapters 1, 2, and 3 are covered in the first course.

  • Then, if only Chapters 4, 5, and 6 are covered in this second course, students will be prepared to write a wide range of challenging window applications.
  • The remaining chapters of the book might be left for students to read on their own.

Richard M. Jones
JonesR@WCSUB.CtStateU.edu
JonesJ@csu.cted.net

Read More Show Less

Customer Reviews

Average Rating 5
( 1 )
Rating Distribution

5 Star

(1)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing 1 Customer Reviews
  • Anonymous

    Posted August 31, 2003

    An excellent introduction to MFC

    Before you buy any book on MFC, you should try this one. I wish I did.

    1 out of 1 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing 1 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)