Home > Store

Sams Teach Yourself Visual C++ 6 in 21 Days

Register your product to gain access to bonus material or receive a coupon.

Sams Teach Yourself Visual C++ 6 in 21 Days

Book

  • Sorry, this book is no longer in print.
Not for Sale

About

FAQs

Question 1: After starting the Docs, it said it was "preparing the INDEX for the first time." After a while, the program stopped responding. Why is this so and how can I rectify this problem?

Solution 1: You did not allow enough time to pass. The process will look as if it has stopped several times throughout. Please allow about 15 to 20 minutes.



Question 2: Day 2 - When I try to add member variables, none of the controls are listed in the ClassWizard so I can't assign any member variables to any controls.

Solution 2: You can go back to the application box and Right click on the controls and go to Properties. Change the Setting to match the text. Ex. Edit Box to IDC_MSG.



Question 3: I accidentally closed the Controls Palette. How do I get it back?

Solution 3: After the project is open on the screen, do the following:

-click: Tools
-click: Customize
-click: Toolbars tab
-put a checkmark in the box for Controls
-click: Close

The Controls Palette will appear on the screen.



Question 4: I am getting errors on Day 10 - Day10Doc.h - about CLine and GetLine.

Solution 4: The problem is solved by simply including the #include "Line.h" at the Day10Doc.h file as well as the c++ source code.



Question 5: After Installing the CD and trying to run the program, I get an error message that states "MSDEV caused an invalid page fault in DEVBLD.PKG"

Solution 5: You should be able to solve the problem by downloading the Visual C++ Service update from MS. Update 2 may not get it to work but Update 3 should.



Question 6: Day 3 - Page 63, I followed the steps in the book and when I try to rebuild, I am getting the following error message
link:fatal error LLNK1104: can not open file "NAFXCWD.LIB"

Solution 6: If, in VC++, you open Tools | Options (from the pulldown menus), select the Directories tab, and then select Library files in the right combo box, the reader should have the "...\VC98\MFC\LIB" and "...\VC98\LIB" included in the directory paths. From the looks of the file name, I'd say that the one pointing to the MFC\LIB directory is missing, or pointing to the wrong directory.



Question 7: On page 117, listing 6.3, the popup menu does not popup anywhere near the pointer. Also TrackPopupMenu() the first param. doesn't seem to function properly.

Solution 7: 1) The context menu does not appear in the right location with lines 13 - 16. Remove these lines, and it appears properly.
2) Line 18, "m_lMenu - GetMenu();" should be "m_lMenu = GetMenu();".
3) Line 23, "m_pPoint.x, m_pPoint.y" should be "point.x, point.y" because of 1) above in this paragraph.



Question 8: I keep coming up with an error message.
Reads: configuration:hello-win 32Debug Compiling resources
Linking........
Link: fatal error link 1168: cannot open debug/hello.exe for writing error executing link.exe H hello.exe - 1error(s), 0 warning(s)

Solution 8: The error that you are running into is because Visual C++ cannot create the .EXE executable in the final step of compiling. There are two likely causes for this. The first possible cause of this error is that you are out of disk space on your computer. The second possible cause of this is that there is already a .EXE file with the same name on your computer, and it is marked as "read-only." Did you copy the source code from a CD? Normally, any files you copy from a CD are automatically marked as "read-only" and you'll need to unmark these files by hand. You can do this in the Windows Explorer by selecting the file, right clicking the mouse (over the file), and opening the file properties from the context menu. In the properties for the file, you should see a check box indicating if the file is "read-only". If the
.EXE file is marked as "read-only", then you can uncheck this box and save the updated file properties.

There is actually a third possible cause for this error, and that is if you are trying to compile the project directly from the CD. If you are trying to do this, you need to copy the entire project directory to your hard disk and try to compile it there. If you open the project from the CD, the compiler
will try and create the .EXE file on the CD.



Question 9: Problem compiling listing 8.3 on pages 163-164.

Solution 9: The text on page 163 discusses creating a single event handler function for use with all of the radio buttons. The source code for this function is in listing 8.3. What you need to do is add a function to the clicked event on every radio button, changing the suggested function name to the OnRSelection function name. This will point all of the radio buttons to this one function to call when any of them are selected.



Description

  • Copyright 1998
  • Dimensions: 7-3/8" x 9-1/8"
  • Pages: 800
  • Edition: 1st
  • Book
  • ISBN-10: 0-672-31240-9
  • ISBN-13: 978-0-672-31240-3

Learn Visual C++ through the Teach Yourself series, with sections on: Q&A, Do's and Don'ts, Workshop, Shaded syntax boxes, Type/Output/Analysis icons. Week One starts you with Visual C++. After installing and maneuvering through the components of the software, you'll examine a preliminary program to get the feel for C++ and Visual C++. You'll learn: C++ basics; hierarchies; members, functions, and objects; inheritance; MFC; installing Visual C++, the Visual C++ compiler. In Week Two, you'll look at components of Windows applications and how they are invoked with Visual C++. Topics include: keyboard input; mouse usage; data file handling; lists and serialization; toolbars and status bars; graphics; and projects. Week Three examines the more involved aspects of Visual C++ and Windows applications.

Downloads

Downloads


Source code for Days 1 - 21 - 3699 kb days.zip

Source code for Class 1 - 230 kb class1.exe

Source code for Class 2 - 235 kb class2.exe

Source code for Class 3 - 240 kb class3.exe

Inherit Program - 251 kb inherit.exe

Inherit 2 Program - 246 kb inherit2.exe

Overload Program - 313 kb overload.exe

Pointers Program - 276 kb pointers.exe

Reference Program - 511 kb reference.exe

Triangle Program - 380 kb triangle.exe

Triangle 2 Program - 291 kb trianglep.exe

Variable Program - 270 kb variable.exe

Source Code

Source code for Days 1 - 21 - 3699 kb days.zip

Source code for Class 1 - 230 kb class1.exe

Source code for Class 2 - 235 kb class2.exe

Source code for Class 3 - 240 kb class3.exe

Inherit Program - 251 kb inherit.exe

Inherit 2 Program - 246 kb inherit2.exe

Overload Program - 313 kb overload.exe

Pointers Program - 276 kb pointers.exe

Reference Program - 511 kb reference.exe

Triangle Program - 380 kb triangle.exe

Triangle 2 Program - 291 kb trianglep.exe

Variable Program - 270 kb variable.exe

Sample Content

Table of Contents

WEEK. 1 AT A GLANCE.

Day Day 1. The Visual C++ Development Environment—Building Your First Visual C++ Application.

The Visual C++ Development Environment. Starting Your First Project. Designing Your Application Window. Adding Code to Your Application. Finishing Touches. Summary. Q&A. Workshop.

Day Day 2. Using Controls In Your Application.

The Basic Windows Controls. Adding Controls to Your Window. Attaching Variables to Your Controls. Attaching Functionality to the Controls. Summary. Q&A. Workshop.

Day 3. Allowing User Interaction—integrating The Mouse And Keyboard In Your Application.

Understanding Mouse Events. Capturing Keyboard Events. Summary. Q&A. Workshop.

Day 4. Working With Timers.

Understanding Windows Timers. Placing a Clock on Your Application. Adding a Second Timer to Your Application. Summary. Q&A. Workshop.

Day 5. Getting User Feedback—Adding Dialog Boxes To Your Application.

Using Pre-existing (or System) Dialog Windows. Creating Your Own Dialog Windows. Summary. Q&A. Workshop.

Day 6. Creating Menus For Your Application.

Menus. Designing Menus. Creating a Menu. Creating Pop-Up Menus. Creating a Menu with Accelerators. Summary. Q&A. Workshop.

Day 7. Working With Text And Fonts.

Finding and Using Fonts. Using Fonts. Summary. Q&A. Workshop. WEEK 1 IN REVIEW.

WEEK 2 AT A GLANCE.

Day 8. Adding Flash—Incorporating Graphics, Drawing, And Bitmaps.

Understanding the Graphics Device Interface. Creating a Graphics Application. Summary. Q&A. Workshop.

Day 9. Adding Activex Controls To Your Application.

What Is an ActiveX Control? 9. Adding an ActiveX Control to Your Project. Using an ActiveX Control in Your Application. Summary. Q&A. Workshop.

Day 10. Creating Single Document Interface Applications.

The Document/View Architecture. Creating an SDI Application. Saving and Loading the Drawing. Interacting with the Menu. Summary. Q&A. Workshop.

Day 11. Creating Multiple Document Interface Applications.

What Is an MDI Application? 9. Creating an MDI Drawing Program. Adding a Context Menu. Summary. Q&A. Workshop.

Day 12. Adding Toolbars And Status Bars.

Toolbars, Status Bars, and Menus. Designing a Toolbar. Adding a Combo Box to a Toolbar. Adding a New Status Bar Element. Summary. Q&A. Workshop.

Day 13. Saving And Restoring Work—file Access.

Serialization. Implementing a Serializable Class. Summary. Q&A. Workshop.

Day 14. Retrieving Data From An Odbc Database.

Database Access and ODBC. Creating a Database Application Using ODBC. Summary. Q&A. Workshop. WEEK 2 IN REVIEW.

WEEK 3 AT A GLANCE.

Day 15. Updating And Adding Database Records Through Ado.

What Is ADO? 9. Building a Database Application Using ADO. Summary. Q&A. Workshop.

Day 16. Creating Your Own Classes And Modules.

Designing Classes. Creating Library Modules. Using Library Modules. Summary. Q&A. Workshop.

Day 17. Sharing Your Functionality With Other Applications—Creating Dlls.

Why Create DLLs? 9. Creating and Using an MFC Extension DLL. Creating and Using a Regular DLL. Summary. Q&A. Workshop.

Day 18. Doing Multiple Tasks At One Time—Multitasking.

What Is Multitasking? 9. Building a Multitasking Application. Summary. Q&A. Workshop.

Day 19. Building Your Own Widgets—Creating Activex Controls.

What Is an ActiveX Control? 9. Creating an ActiveX Control. Summary. Q&A. Workshop.

Day 20. Internet Applications And Network Communications.

How Do Network Communications Work? 9. Building a Networked Application. Summary. Q&A. Workshop.

Day 21. Adding Web Browsing Functionality To Your Applications.

The Internet Explorer ActiveX Model. The CHtmlView Class. Building a Web-Browsing Application. Summary. Q&A. Workshop. WEEK 3 IN REVIEW.

APPENDIXES.

Appendix A. C++ Review.

Creating Your First Application. Pointers. Classes. Inheritance. Summary.

Appendix B. Answers.

Day 1. Day 2. Day 3. Day 4. Day 5. Day 6. Day 7. Day 8. Day 9. Day 10. Day 11. day 12. Day 13. Day 14. Day 15. Day 16. Day 17. Day 18. Day 19. Day 20. Day 21.

Appendix C. Printing And Print Previewing.

Using the Framework's Functionality. Pagination and Orientation. Direct Printing Without the Framework.

Appendix D. Understanding And Exception Handling.

Using Exceptions. MFC Exception Types.

Appendix E. Using The Debugger And Profiler.

Creating Debugging and Browse Information. Tracing and Single Stepping. Additional Debugging Tools.

Appendix F. Using MFC's Helper Classes.

Using the Collection Classes. Using the Coordinate-Handling Classes. Using the Time-Handling Classes. Using the String Manipulation Class.

Index.

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020