Microsoft Visual C++ Windows Applications by Example


Microsoft Visual C++ Windows Applications by Example
eBook: $26.99
Formats: PDF, PacktLib, ePub and Mobi formats
$16.19
save 40%!
Print + free eBook + free PacktLib access to the book: $71.98    Print cover: $44.99
$29.24
save 59%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • Learn C++ Windows programming by studying realistic, interesting examples
  • A quick primer in Visual C++ for programmers of other languages, followed by deep, thorough examples
  • Example applications include a Tetris-style game, a spreadsheet application, a drawing application, and a word processor
  • Each application demonstrates key real-world techniques: parsing text, working with files, creating memory structures, displaying interactive graphics, and more

Book Details

Language : English
Paperback : 440 pages [ 235mm x 191mm ]
Release Date : June 2008
ISBN : 1847195563
ISBN 13 : 9781847195562
Author(s) : Stefan Björnander
Topics and Technologies : All Books, Application Development, Microsoft Other, Microsoft, .NET


Table of Contents

Preface
Chapter 1: Introduction to C++
Chapter 2: Object-Oriented Programming in C++
Chapter 3: Windows Development
Chapter 4: Ring: A Demonstration Example
Chapter 5: Utility Classes
Chapter 6: The Tetris Application
Chapter 7: The Draw Application
Chapter 8: The Calc Application
Chapter 9: The Word Application
References
Index
  • Chapter 1: Introduction to C++
    • The Compiler and the Linker
    • The First Program
    • Comments
    • Types and Variables
      • Simple Types
      • Variables
      • Constants
      • Input and Output
      • Enumerations
      • Arrays
      • Pointers and References
      • Pointers and Dynamic Memory
      • Defining Our Own Types
      • The Size and Limits of Types
      • Hungarian Notation
    • Expressions and Operators
      • Arithmetic Operators
      • Pointer Arithmetic
      • Increment and Decrement
      • Relational Operators
      • Logical Operators
      • Bitwise Operators
      • Assignment
      • The Condition Operator
      • Precedence and Associativity
    • Statements
      • Selection Statements
      • Iteration Statements
      • Jump Statements
      • Expression Statements
    • Functions
      • Void Functions
      • Local and Global Variables
      • Call-by-Value and Call-by-Reference
      • Default Parameters
      • Overloading
      • Static Variables
      • Recursion
      • Definition and Declaration
      • Higher Order Functions
      • The main() Function
    • The Preprocessor
    • The ASCII Table
    • Summary
  • Chapter 2: Object-Oriented Programming in C++
    • The Object-Oriented Model
    • Classes
      • The First Example
      • The Second Example
    • Inheritance
    • Dynamic Binding
    • Arrays of Objects
    • Pointers and Linked Lists
      • Stacks and Linked Lists
    • Operator Overloading
    • Exceptions
    • Templates
    • Namespaces
    • Streams and File Processing
    • Summary
  • Chapter 3: Windows Development
    • Visual Studio
    • The Document/View Model
    • The Message System
    • The Coordinate System
    • The Device Context
    • The Registry
    • The Cursor
    • Serialization
    • Summary
  • Chapter 4: Ring: A Demonstration Example
    • The Application Wizard
    • Colors and Arrays
    • Catching the Mouse
    • Drawing the Rings
    • Setting the Coordinate System and the Scroll Bars
    • Catching the Keyboard Input
    • Menus, Accelerators, and Toolbars
    • The Color Dialog
    • The Registry
    • Serialization
    • Summary
  • Chapter 5: Utility Classes
    • The Point, Size, and Rectangle Classes
    • The Color Class
    • The Font Class
    • The Caret Class
    • The List Class
    • The Set Class
    • The Array Class
    • Error Handling
    • Summary
  • Chapter 6: The Tetris Application
    • The Tetris Files
      • The Square Class
      • The Color Grid Class
      • The Document Class
      • The View Class
    • The Figure Class
    • The Figure Information
      • The Red Figure
      • The Brown Figure
      • The Turquoise Figure
      • The Green Figure
      • The Yellow Figure
      • The Blue Figure
      • The Purple Figure
    • Summary
  • Chapter 7: The Draw Application
    • The Resource
    • The Class Hierarchy
    • The Figure Class
    • The TwoDimensionalFigure Class
    • The LineFigure Class
    • The ArrowFigure Class
    • The RectangleFigure Class
    • The EllipseFigure Class
    • The TextFigure Class
    • The FigureFileManager Class
    • The Document Class
    • The View Class
    • Summary
  • Chapter 8: The Calc Application
    • The Resource
    • Formula Interpretation
      • The Tokens
      • The Reference Class
      • The Scanner—Generating the List of Tokens
      • The Parser—Generating the Syntax Tree
      • The Syntax Tree—Representing the Formula
    • The Spreadsheet
      • The Cell—Holding Text, Value, or Formula
      • The Cell Matrix—Managing Rows and Columns
      • The Target Set Matrix Class
    • The Document/View Model
      • The Document Class
      • The View Class
    • Summary

Stefan Björnander

Stefan Björnander is a Ph.D. candidate at Mälardalen University, Sweden. He has worked as a software developer as well as a senior lecturer at Umeå University, Sweden. He holds a master's degree in computer science and his research interests include compiler construction, mission-critical systems, and model-driven engineering.


Contact Stefan Björnander

Sorry, we don't have any reviews for this title yet.

Code Downloads

Download the code and support files for this book.


Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


Errata

- 8 submitted: last submission 06 Feb 2013

Errata type: Technical | Page number: 12

At the bottom of page 12 under the Enumerations section second paragraph, last line, it says: In the example above, FORD is an integer constant with the value zero, VOLVO has the value one, TOYOTA three, and VOLKSWAGEN four. Should be In the example above, FORD is an integer constant with the value zero, VOLVO has the value one, TOYOTA two, and VOLKSWAGEN three.

 

Errata type: Code | Page number: 114

Under RingView.cpp delete "CSize sizeTotal;"

 

Errata type: Code | Page number: 115

Brush and Pen objects are set on the wrong lines, as a result you can't change the color of the Pen.
...
// Always draws with default settings
pDC->Ellipse(point.x - RADIUS, point.y - RADIUS,
point.x + RADIUS, point.y + RADIUS);
CPen* pOldPen = pDC->SelectObject(&pen); // wrong line
CBrush* pOldBrush = pDC->SelectObject(&brush); // wrong line
} // leaves the scope, so DC settings are gone.
should instead be
...
CPen* pOldPen = pDC->SelectObject(&pen);
CBrush* pOldBrush = pDC->SelectObject(&brush);
pDC->Ellipse(point.x - RADIUS,point.y - RADIUS,
point.x + RADIUS, point.y + RADIUS);
pDC->SelectObject(pOldPen); //resetting default Pen
pDC->SelectObject(pOldBrush); //resetting default Brush
}

 

Errata type: Typo | Page number: 138

Last paragraph, last sentence "...(if it is not empty) is added if to the result if
...",
should be
"... (if it is not empty) is added in to the result if ..."

 

page no: 10

ASCII stands for "American Standard Code for Information Interchange" and not "American Standard Code for Information Exchange"

Errata type: Typo | Page number: 68

In the diagram at the top of the page, the first pointer pCell1 points to the first Cell.The second pointer is labelled as pCell1 again.It should be pCell2.

 

 

Errata type: Typo | Page number: 36

In the section "Call-by-Value and Call-by-Reference" the line: "Then iNum1 and iNum2 exchange values with the help if iTemp." should be: "Then iNum1 and iNum2 exchange values with the help of iTemp."

 

 

Errata type: Code | Page number: 36

At the top of page 36, there is some code as mentioned below. The last comment should be 2 because iNumber is initialized with 2.

int g_iNumber = 1;
void main()
{
int iNumber = 2;
cout << "Global variable: " << g_iNumber // 1
<< ", Local variable: " << iNumber; // 2 }

 

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

Microsoft Visual C++ Windows Applications by Example +    Boost C++ Application Development Cookbook =
50% Off
the second eBook
Price for both: $39.00

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

When you read this book, you will learn to:

  • Build larger, more powerful, user friendly C++ applications
  • Create MDI (multiple document interface) applications and use other Windows application interface elements
  • Create memory structures for complex application objects: documents, spreadsheets, drawings
  • Save files to represent these memory structures
  • Parse and process text, display interactive graphics, and handle input from the mouse and the keyboard

In Detail

With this book you will learn how to create applications using MDI, complex file formats, text parsing and processing, graphics, and interactions. Every essential skill required to build Windows desktop-style applications is covered in the context of fully working examples.

The book begins with a quick primer on the C++ language, and using the Visual C++ IDE to create Windows applications. This acts as a recap for existing C++ programmers, and a quick guide to the language if you've not worked with C++ before. The book then moves into a set of comprehensive example applications, presenting the important parts of the code with explanation of how it works, and how and when to use similar techniques in your own applications.

The applications include: a Tetris-style game, a drawing application, a spreadsheet, and a word processor.

If you know the C++ language, or another Windows-based programming language, and want to use C++ to write real, complex applications then this book is ideal for you.

Visual C++ is an established development language for Windows desktop applications. This book shows you how to develop professional, real-life applications by examining real world examples. It is fast, and used in millions of applications throughout the world.

Approach

Who this book is for

The book is ideal for programmers who have worked with C++ or other Windows-based programming languages. It provides developers with everything they need to build complex desktop applications using C++.

If you have already learned the C++ language, and want to take your programming to the next level, then this book is ideal for you.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software