Thank you for visiting us. We are currently updating our shopping cart and regret to advise that it will be unavailable until September 1, 2014. We apologise for any inconvenience and look forward to serving you again.

Wiley
Wiley.com
Print this page Share

Ivor Horton's Beginning Visual C++ 2005

ISBN: 978-0-7645-7197-8
1224 pages
February 2006
Ivor Horton
  • Popular author Ivor Horton uses his trademark approachable writing style to provide novice programmers with the basic tools as they learn Visual C++ 2005
  • Readers will learn how to program in C++ using Visual C++ 2005-without any previous knowledge of C++
  • More than 35 percent new and updated material covers the new release of Visual C++, and exercises and solutions help readers along the way
  • Demonstrates the significant new features of Visual C++ 2005, providing improved flexibility in developing Microsoft applications in C++
See More
Acknowledgments.

Chapter 1: Programming with Visual C++ 2005.

Chapter 2: Data, Variables, and Calculations.

Chapter 3: Decisions and Loops.

Chapter 4: Arrays, Strings, and Pointers.

Chapter 5: Introducing Structure into Your Programs.

Chapter 6: More about Program Structure.

Chapter 7: Defining Your Own Data Types.

Chapter 8: More on Classes.

Chapter 9: Class Inheritance and Virtual Functions.

Chapter 10: Debugging Techniques.

Chapter 11: Windows Programming Concepts.

Chapter 12: Windows Programming with the Microsoft Foundation Classes.

Chapter 13: Working with Menus and Toolbars.

Chapter 14: Drawing in a Window.

Chapter 15: Creating the Document and Improving the View.

Chapter 16: Working with Dialogs and Controls.

Chapter 17: Storing and Printing Documents.

Chapter 18: Writing Your Own DLLs.

Chapter 19: Connecting to Data Sources.

Chapter 20: Updating Data Sources.

Chapter 21: Applications Using Windows Forms.

Chapter 22: Accessing Data Sources in a Windows Forms Application.

Appendix A: C++ Keywords.

Appendix B: ASCII Codes.

Index.

See More
Ivor Horton is one of the preeiminent authors of tutorials on the Java, C and C++ programming languages. He is widely known for the tutorial style of his books, which provides step-by-step guidance easily understood even by first-time programmers. Horton is also a systems consultant in private practice.
See More
  • Ivor Horton is a leading author of computer programming language tutorials; his Beginning Visual C++ 6 has sold more than 80,000 copies in both the Wiley and Wrox editions.
  • The author is known for his unique tutorial style, readily accessible to both novice and experienced programmers.
  • The book is a comprehensive introduction to BOTH the Standard C++ language and to Visual C++.NET; no previousl programming experience is required.
  • The book provides exercises and solutions, adding to its appeal to the college and training markets.
  • This edition fully covers the most recent Whidbey release of Visual C++.NET.
See More
Download TitleSizeDownload
Download Code
Updated 6/25/08 - A code file from Chapter 5 has been corrected.
868.11 KB Click to Download
Download Exercise Answers 786.94 KB Click to Download
Download Correct Figure (page 92)
Figure 2-12, in page 92, shows a piece of a program with other variables than those described in the text an the end of page 91
42.18 KB Click to Download
Corrected Chapter 5 Code File
6/25 - This is a corrected code file (Ex5_10.cpp) for Chapter 5; the new version is also in the complete code zip file above.
732 bytes Click to Download
See More

Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.

ChapterPageDetailsDatePrint Run
2 Error in Solution (Soln2_6.cpp)
The enum in Soln2_6.cpp should be: enum class Month{January=1, February, March, April, May, June, July, August, September, October, November, December};
05/15/07
14 Typo
Paragraph 2, line 4 (or sentence 3), near the end reads:
the solution folder has the came name as the project.

should be:
the solution folder has the same name as the project.
3/3/06
1 18 Replace Sentence
The second sentence on the page should be replaced by the following:

In the left pane of the Options dialog that is displayed, extend the
Text Editor item by clicking the +, do the same for the C/C++ item
and select General. If you then check the Line numbers box in the
right pane and click the OK button, line numbers will be displayed.
6/08/06
21 Error in Text
Second line from the bottom:
click Code in the right pane, and C++ File(.cpp) in the right pane.

should read:
click Code in the left pane, and C++ File(.cpp) in the left pane.

AND

Sixth line from the bottom:
on the right side of the dialog box

should be:
on the left side of the dialog box
7/25/06
46 Error in Text
Paragraph 2, line 6:
semicolons

should be:
colons
05/14/07
49 Error in Text
This occurs in the first sentence of the first paragraph below the first gray-highlighted code in the Whitespace section:

Original Text: "There must be at least one whitespace character (usually a space) between int and fruit for the compiler to be able to distinguish them but if you add more whitespace characters they will be ignore."

ignore

should be:

ignored
10/15/2007
62 Error in Example
enum State : bool { On = true, Off};

should be:
enum State : bool {On=true, Off=false};

The original fragment used to compile but the compiler was ultimately modified to enforce the rule that enumerators in an enum of type bool must all be explicitly initialized. C++/CLI enums of other explicit types do not need to be initialized explicitly, although they can be.

The section referred to looks as though it got left in by mistake; There is a section on enums for C++/CLI later in the chapter. It still doesn't say that bool enums must have explicit values, but it should.
02/07/07
77, 84, ... Error in Text
The bitwise OR should be " | " rather than the " > ".

Also, the >> operator appearing below the line containing && should be the || operator.
04/26/2006
82, 84, 85 Errors in Code
Every occurent of the bitwise OR operator, which is described as '<', should be '|'.
04/08/2006
84-85 Incorrect Symbol
The section on the Bitwise OR uses a greater-than symbol:
>

It should use:
the Bitwise OR symbol |.
4/25/06
86 Error in Code
code toward the bottom of the page:
unsigned int number = 16387U

should be:
unsigned short number = 16387U
01/30/07
90 Typo
The third line in the third paragraph is:
"if you use duplicate names makes, it very easy to hide variables"
should be:
"if you use duplicate names, it makes it very easy to hide variables"
9/13/06
91-92 Error in Figure
On page 91 the text references Figure 2-12; and then discusses "the variable VALUE1 which appears at the beginning..." There is no such variable VALUE1 in Figure 2-12, or VALUE4. *see download
03/29/2006
96 Error in Text
System namespace with C+/CLI code

should be:
"System namespace with C++/CLI code"
03/26/07
99 Error in Text
Toward the bottom of page in the section titled "C++/CLI Specific: Fundamental Data Types", the table below it reads:

long long | 8 | From 9,223,372,036,854,775,808 to 9,223,372,036,854,775,808 in the row.

It should read:

long long | 8 | From -9,223,372,036,854,775,808 to 9,223,372,036,854,775,808

AND

the C+ library files should be the C++ library files
05/25/2006
100 Error in Text
Under the Fundamental Type Column is reads:
"ool"

It should read:
"bool"
05/24/2006
108 Error in Code
The code line in the middle of the page that reads:
ConsoleKeyInfo keyPress = Console ReadKey(true);

should be:
ConsoleKeyInfo keyPress = Console::ReadKey(true);
4/08/06
116 Error in Text
In the second line of the paragraph at the top of the page the text reads:
"bool:true"

Should read:
"bool::true"
04/08/2006
124 Error in Text
Typo: Second paragraph, last sentence, under "Logical Operators and Expressions"

"... boils down to a choice between two possibilities (true or false."

should be:

"... boils down to a choice between two possibilities (true or false).
02/13/2008
164 Error in Text
"Under "Using Objects", 2nd paragraph:
one ouse based on a given blueprints

Should be:
one ouse based on a given set of blueprints
3/18/06
4 175 Error in Example
The output for the example is from a debug version, so the pointer values differ by more than 4. A typical output for a release version of the program is:

number1 = 66 &number1 = 0012FF70 number1 = 990 pnumber = 0012FF74 *pnumber = 99
6/08/06
182 Error in Example
middle of page; example of applying sizeof to type name:
"size_t_size"

should read:
size_t long_size = sizeof(long);
03/19/07
198 Typo
can involving

Should be:
can involve
06/11/07
199 Error in Text
2nd paragraph:
left parenthesis

should be:
em dash.
04/24/2006
201 Error in Text
7th line down:
left parentheses

should be:
em dashes
4/24/2006
206 Error in Text
How It Works on the 3rd line: left parenthesis

should be:
em dash.
4/24/2006
210 Error in Text
3rd line:
'place'

should be:
'placed'.
4/24/2006
213 Error in Text
13th line:
left parenthesis

should be:
an em dash.
4/24/2006
215 Error in Text
funbction

should be:

function
08/08/2007
216 Error in Punctuation
3rd Paragraph:
there should be a period at the end of the sentence.
4/24/06
216 Error in Text
3rd paragraph:
left parenthesis

should be:
an em dash
4/24/2006
216 Error in Text
Last paragraph:
the first left parenthesis

should be:
an em dash.
4/24/06
217 Error in Text
2nd to last paragraph:
left parenthesis

should be:
an em dash
4/24/2006
220 Error in Text
third word on the third line:
trim()

should be:
Trim()
4/10/06
220 Error in Text
6th paragraph, 2nd to last sentence:
left parentheses

should be:
em dashes
4/24/06
222 Error in Code
In the 2nd code fragment of the page, {0] should be {0}.
4/24/2006
225 Error in Code
4th paragraph 'stackValue' should be 'trackValue'.
4/24/2006
225 Error in Text
In the last paragraph, 4th line says:

"An interior point"

Should be:

"An interior pointer"
08/03/2007
226 Error in Text
5th paragraph in the middle of the page, in the 2nd sentence. 'This' should be 'Thus'.
4/24/2006
227 Error in Code
In the second to last paragraph the code reads:
!pstart > pend

It should read:
!(pstart > pend)
03/19/2006
235 Error in Text
2nd paragraph, left parenthesis should be an em dash.
4/24/2006
242 Error in Code
cout << endl
<< "incr10(pnum) = " << incr10(pnum);

should be:

int result = incr10(pnum);
cout << endl << "incr10(pnum) = " << result;
08/14/2007
247 Error in Text
1st paragraph, left parenthesis should be an em dash.
4/24/2006
5 253 Error in Example
In the example Ex5_10.cpp:
the first argument is missing from the sum() function call in each of
the two statements in the main() function.
The statements should be:

cout << sum(6, 2, 4, 6, 8, 10, 12) << endl;
cout << sum(9, 11, 22, 33, 44, 55, 66, 77, 66, 99) << endl;

AND

The output shown following the example is also incorrect.
It should be:
42
473
Press any key to continue . . .
6/05/06
253 Error in Code
The code reads:

cout << sum(2, 4, 6, 8, 10, 12) << endl;
cout<<sum(11, 22, 33, 44, 55, 66. 77, 66, 99) <<endl;

In both cases the count of the number of arguments was left out. The result of running the code is also incorrect. By inspection one can tell that the sum of 2, 4. 6, 8, ... > 10! The code that I downloaded from the Wrox site for this example contains the same error so the results are really weird.

The first line of the code should read:

cout << sum(6, 2, 4, 6, 8, 10, 12) << endl;
The first digit being the number of arguments passed. The first digit in the next line should be 9 followed by the digits presently shown.



*PLEASE NOTE: the Ex5-10.cpp file in the code download was updated on 6/26/08. Thanks!
06/25/2008
278 Error in Text
4th paragraph before Try It Out, in the 2nd sentence there is 'or' missing so it should read:
'If you initialize a parameter to a function in the prototype, or if...'
4/24/2006
283 Error in Text
4th paragraph, the three left parentheses should be em dashes.
4/24/2006
287 Error in Text
In the first sentence - the two left parentheses should be em dashes.
4/24/2006
296 Error in Figure
Figure 6-5, In the third block down:
/0

should be:
\0
7/19/06
309 Error in Text
7th paragraph 'al' should be 'all'.
4/24/2006
311 Error in Code
In the // comment in the code, 'found' has spilled on to the next line.
4/24/2006
313 Error in Text
2nd from last paragrah the two left parentheses should be em dashes.
4/24/2006
324 Error in Text
1st paragraph, 2nd to last sentence 'structs' last 's' should be of a different type.
4/24/2006
338 Error in Code
Last cout should have a space between << and endl;
4/24/2006
359 Error in Code
In main, in the declaration for CBox cigar there should be a space before the last initializing value.
4/24/2006
360 Error in Text
2nd from last paragraph, the left parenthesis in the last sentence should be an em dash.
4/24/2006
361 Error in Code
In the first code fragment, there should be a space preceding the last initial value, 1.0.
4/24/2006
361 Error in Code
in the example code below the section titled "const Member Functions of a Class":
the firat line of the function definition:
double Volume()

should be:
double Volume() const
04/30/07
383 Error in Code
second line of code (in gray) at the top of the page:
ht->meters

should be:
ht.meters

whole lines read:
Height ht = Height(6, 8); // Height of 6 feet 8 inches
Console::WriteLine(L"The height is {0} meters", ht.meters);

04/18/07
388 Error in Text
5th paraph in the last, last sentence, one of the two successive 'the' should be deleted.
4/24/2006
397 Error in Text
under "Exercises" section, 3rd line reads:

a.sptr

should be:

a.sPtr
03/10/2008
403 Missing Word
Middle of the page, second last sentence in the long paragraph:
"the free store memory is released."

should be:
"the free store memory will not be released."
04/18/07
419 Error in Text
Just below the middle of the page following the code fragment the left parenthesis should be an em dash.
4/24/2006
427 Error in Text
Middle of the page, second sentence of the paragraph before the title "Class Templates":
"With the prefix forms"

should read:
"With the postfix forms."
04/18/07
442 Error in Figure
Figure 8-7:

aBox reads: "W=2"
should read: "H=2"

AND

the figure should include "L=8" for aBox and "L=3" for bBox in order for the figure to match the text.
04/18/07
444 Error in Text
In point 2 at the bottom of the page the left parenthesis should be an em dash.
4/24/2006
446 Error in Text
In the paragraph preceding the section heading the left parenthesis should be an em dash.
4/24/2006
448 Error in Text
4th paragraph, "'real" has a spurious single quote.
4/24/2006
449 Error in Text
In the last sentence - 'the' in code font should be in normal paragraph font.
4/24/2006
452 Error in Text
2nd paragraph, the left parenthesis should be an em dash.
4/24/2006
454 Error in Text
Last paragraph, in the 2nd to last sentence there should be a space between 'as' and 'Header File (.h)'.
4/24/2006
467, 469 Error in Functions
The definition of the increment operator function for the Length class on P 467 and on P469 is not correct. On both pages it should be:
// Pre- and postfix increment operator
static Length^ operator++(Length^ len)
{
Length^ temp = gcnew Length(len->feet, len->inches);
++temp->inches;
temp->feet += temp->inches/temp->inchesPerFoot;
temp->inches %= temp->inchesPerFoot;
return temp;
}

The argument passed to the overload increment or decrement operator function should never be modified within the function in C++/CLI code. It would be useful to output the final version of len4 in the example 8_10 by adding the statement:
Console::WriteLine(len4); // Final value of len4

The output would then be:
275 feet 9 inches
14 feet 6 inches can be cut into 5 pieces 2 feet 6 inches long with 2 feet 0 inches left over.
1 feet 0 inches
2 feet 0 inches
2 feet 1 inches
Press any key to continue . . .
04/18/07
468 Error in Text
Bottom of page:
the two static operator overload prototypes have the comments reversed.

The function definitions at the bottom of P469 should be:
static Length^ operator*(double x, Length^ len); // Multiply - L operand double
static Length^ operator*(Length^ len, double x); // Multiply - R operand double
04/18/07
469 Errors in Text
Top line of the second and third gray boxes:

The function definitions should read:
// Multiply operator implementation - left operand double
Length^ Length::operator*(double x, Length^ len)
{
int ins = safe_cast<int>(x*len->inches +x*len->feet*inchesPerFoot);
return gcnew Length(ins/inchesPerFoot, ins%inchesPerFoot);
}

// Multiply operator implementation - right operand double
Length^ Length::operator*(Length^ len, double x)
{ return operator*(x, len); }

AND

second last line of code:
postfix increment operator

should be:
prefix increment operator
04/18/07
473 Error in Text
In the 1st sentence there should have comma between 'programming' and 'class inheritance'.
4/24/2006
502 Error in Text
First sentence at the top of the page:
Add > New Item

should be:
Add > Existing Item
04/18/07
523 Error in Text
In the last point 'A class that contains...' has a spurious space.
4/24/2006
525 Error in Text
under "How It Works" section, 1st line reads:

You first create an array of handles to strings

should be:

You first create an array of handles to Box objects:
03/10/2008
536 Error in Code
In the 2nd code fragment there should be a space preceding the last initial value for newBox.
4/24/2006
549 Error in Code
In the code for the Try It Out:
the first }

should be:
{
4/24/2006
556 Error in Statement
The first two gray lines under the "List<T> - A Generic List" heading both read:
List<int> numbers = gcnew List<int>;

According to the text, the second one is supposed to show a definition of a list with a capacity of 500. The statement on P 556 to create a list with a capacity of 500 is in error and should be:
List<int> numbers = gcnew List<int>(500);
04/18/07
579 Error in Text
In the 1st sentence at the top of the page 'NDEBUG are defined' should be 'NDEBUG is defined'
4/24/2006
584 Error in Code
p584 In the body of main() the statement defining pName should be:
char* pName = new char[myName.getNameLength()];

(This is deliberately incorrect at this stage. The correct statement is therefore an error.)
4/24/2006
603 Error in Text
All references to 'categoryname' in the tables should be 'category'.
4/24/2006
605 Error in Text
In the 1st point, 'segment' should be 'segments'.
4/24/2006
615 Error in Text
MDI parent window & parent window client area point to the same thing.
4/24/2006
616 Error in Text
In the first paragraph of the new section on the page the first sentence should read:
'When you write a Windows application, your program is ...'
4/24/2006
618 Error in Text
The HANDLE description should begin:
'Ahandle to an object - a handle is a 32-bit integer value that records the location of an object in memory.
4/24/2006
623 Error in Text
The struct name should be WNDCLASSEX.
4/24/2006
655+ Numerous Errors in Reference
In the sections of Chapter 12 that deal with using the MFC Application Wizard:
all references to the "right pane":

should be:
"left pane"

This one error is repeated numerous times in the chapter (too many to list them all).
05/29/07
625 Error in Code
static char szAppName[] = "OFWin";

should read:

static LPCTSTR szAppName = L"OFWin";
08/09/2007
658 Error in Text
4th paragraph:
.txt

should be:
txt
05/29/07
721 Error in Text
There should be a space between BLACK.BRUSH and WHITE_BRUSH.
4/24/2006
770 Error in Code
On page 770, last four lines - 
"The string can then be treated as the representation of a number to some base, 32 say. The numerical value for the string 'fred', for instance is
6*323+18*322+5*321+4*320
and, assuming you expected to store 500 strings, you could calculate the hashed value of the key as:
6*323+18*322+5*321+4*320 mod 503"
These equation '6*323+18*322+5*321+4*320' should be expressed in a form like '6*32^3+18*32^2+5*32^1+4*32^0' where exponents of 32 are used.
12/16/2010
1036 Error in Direction
next to last sentence on the page:
You'll see a small arrow at the top left of the control.

should be:
You'll see a small arrow at the top right of the control.
02/19/07
1052-1053 Error in Code
In code fragment at bottom of p1052 and top of p1053, the random->Next() methods should be passed max+1, not max, because Random::Next() generates Int32 values less than the maximum specified value.

Code should read:

p1052: values[0] = random->Next(min, max+1);
p1053: values[i] = random->Next(min, max+1);"
10/15/2007
See More
Instructors Resources
Wiley Instructor Companion Site
See More
See Less
Buy Both and Save 25%!
+

Ivor Horton's Beginning Visual C++ 2005 (US $49.99)

-and- Ivor Horton's Beginning Java, Java 7 Edition (US $44.99)

Total List Price: US $94.98
Discounted Price: US $71.23 (Save: US $23.75)

Buy Both
Cannot be combined with any other offers. Learn more.

Related Titles

Back to Top