Welcome to Desktop Applications with Microsoft Visual C++ 6.0 MCSD Training Kit. By completing the chapters and associated Lab exercises in this course, you will acquire the knowledge and skills necessary to develop solutions using Visual C++ 6.0.
This book addresses the objectives of the Microsoft Certified Solution Developer (MCSD) Exam 70-016, "Designing and Implementing Desktop Applications with Microsoft Visual C++ 6.0." This book provides content that supports the skills measured by the 70-016 exam. Review questions at the end of each chapter test your knowledge of the chapter material, and help you prepare for the exam.
NOTE
For more information on becoming a Microsoft Certified Solution Developer, see "Microsoft Certified Professional Program" later in this section.
This course is designed for individuals interested in developing their skills in Microsoft Visual C++ 6.0 while developing desktop applications. Topics include using the Microsoft Solutions Framework (MSF); building applications with the Microsoft Foundation Classes (MFC); creating user interfaces; implementing application behaviors; and working with persistent data. Also included are adding database support to applications; creating Component Object Model (COM) components and ActiveX controls; using MFC and the Active Template Library (ATL); Internet programming; error handling, debugging, and testing; and application deployment.
This book assumes that you have a good working knowledge of C++ application development and are acquainted with but not knowledgeable about Microsoft Visual C++ 6.0 and the Microsoft Windows Application Programming Interface (API). Before beginning this self-paced course, you should have:
This course combines text, graphics, and review questions to teach you about designing and implementing desktop applications with Visual C++ 6.0. The course assumes that you will work through the book from beginning to end. However, you can choose a customized track and complete only the sections that interest you. If you choose to customize your course, see the "Before You Begin" section in each chapter for important information regarding prerequisites.
The book is divided into the following chapters:
The following features are designed to enhance the usefulness of this course:
Before you start reading any of the chapters, it is important that you understand the terms and notational conventions used in this book.
Notational Conventions
Keyboard Conventions
The companion CD contains sample exam questions and the files used in the hands-on labs and procedures in the text.
Using the Lab Files
The companion CD contains files required to perform the hands-on lab exercises. To copy the lab files to your hard drive, run the Setup.exe program in the root directory of the CD and follow the instructions that appear on your screen.
By default, the lab files are copied to the \DAVC folder. Each chapter in the book has its own subfolder. (For example, material relating to Chapter 1 can be found in \DAVC\Chapter1.) Each of these folders might contain the following subfolders:
The recommended procedure is to follow the labs in numerical order. Save your work and use it in the next lab to continue developing the example application. If you do not complete a lab, you can start the next lab using the project in the \DAVC\Chapter n\Lab\Partial folder, which will allow you to proceed from the appropriate starting point.
You should check your work against the project in the \DAVC\Chapter n\Lab\Solution folder after you complete each lab.
Beneath the \DAVC folder is the \Database folder, which contains files that you use to set up the database used by the labs.
Self Test Software Visual C++ 6.0 Sample Exam
To practice taking a certification exam, you can install the sample exam from Self Test Software (STS) contained on the companion CD. Designed in accordance with the actual Microsoft certification exam, this sample includes questions to help you assess your understanding of the materials presented in this book. Each question includes feedback with an associated course reference so that you can review the material presented. Visit the STS Web site at www.selftestsoftware.com for a complete list of available practice exams.
The Self Test Software demonstration for Exam 70-016 is located in the \Exam folder. To install the sample exam on your hard drive, run the Mp016.exe program in this folder and follow the instructions that appear on your screen.
Microsoft Visual C++ 6.0 Starts Here
This companion CD also contains the Microsoft Visual C++ 6.0 Starts Here product to help you become more familiar with Visual C++ 6.0. It is located in the \MVC6SH folder (on the companion CD). For installation instructions, refer to the Readme.txt file.
SQL Server 7.0 Trial Edition
On a separate CD, you will find a 120-day limited trial edition of Microsoft SQL Server 7.0 that you can install to enable you to complete the labs. Please refer to the "Getting Started" section for information on how to install SQL Server and how to set up the databases that are used by the labs in this courseware.
To complete the exercises in this book, your computer must meet the following hardware and software requirements.
All hardware should be on the Microsoft Windows Hardware Compatibility List located at www.microsoft.com/hcl.
Computer/Processor | Personal computer with a Pentium-class processor; 166-megahertz (MHz) or higher processor recommended |
Memory | 24 megabytes (MB) of RAM for Microsoft Windows 95 or later (32 MB recommended); 32 MB for Microsoft Windows NT 4.0 (64 MB recommended) |
Hard Disk Space | Visual C++: 300 MB typical; 360 MB maximum |
Microsoft Developer Network (MSDN) | 57 MB typical; 493 MB maximum |
Internet Explorer (IE) | 43 MB typical; 59 MB maximum |
Windows NT 4.0 Option Pack | 40 MB for Windows 95 or later; 200 MB for Windows NT 4.0 |
SQL Server 7.0 | 170 MB typical; 266 MB maximum |
Drive | CD-ROM drive |
Display | VGA or higher-resolution monitor; Super VGA recommended |
Operating System | Windows 95; Microsoft Windows 98; Windows NT Workstation 4.0 with Service Pack 4 or later; Windows NT Server 4.0 with Service Pack 4 or later |
Peripheral/Miscellaneous | Microsoft Mouse or compatible pointing device |
The following software is required to complete the exercises in this course:
These instructions describe how to install the software you need to complete the exercises and labs in this book, including the following:
- or -
Personal Web Server (if you are running Windows NT Workstation 4.0, Windows 95, or Windows 98)
Both products can be downloaded free of charge from Microsoft's Web site at www.microsoft.com.
- or -
SQL Server 7.0 Desktop Edition (if you are running Windows NT Workstation 4.0, Windows 95, or Windows 98)
A limited 120-day trial edition is included with this courseware.
These are installed from the companion CD to the \Database folder on your hard drive.
Installing the Windows NT 4.0 Option Pack
The Windows NT 4.0 Option Pack contains Internet Information Server (IIS), which can be installed on Windows NT Server 4.0; and Personal Web Server (PWS), which can be installed on Windows NT Workstation 4.0, Windows 95, or Windows 98. You can obtain the Windows NT 4.0 Option Pack from the Web at www.microsoft.com/ntserver/nts/downloads/recommended/nt4optpk/default.asp
NOTE
To install all the components of the Windows NT 4.0 Option Pack, networking and the TCP/IP protocol must be installed.
Installing Personal Web Server
Personal Web Server (PWS) comes as a version of the Windows NT 4.0 Option Pack that is configured for installation on Windows NT Workstation 4.0, Windows 95, or Windows 98. You can download PWS from the Web at www.microsoft.com/windows/ie/pws/default.htm.
NOTE
To install all the components of the Personal Web Server, networking and the TCP/IP protocol must be installed.
Installing SQL Server 7.0 Standard Edition
Installing SQL Server 7.0 Desktop Edition
SQL Server 7.0 Database Configuration for All Operating Systems
The following tables provide lists of the skills measured on the Microsoft Certified Solution Developer (MCSD) Exam 70-016 and where in this book you will find information relating to each skill.
NOTE
Exam skills are subject to change without notice and at the sole discretion of Microsoft.
Deriving the Physical Design
Skills measured | Location in book |
---|---|
Explain the elements of an application that is based on the MFC framework. | |
Identify differences between developing an MFC application for Windows NT, Windows 95, and Windows 98. | Chapter 3, Lesson 1 |
Explain when to use the Platform Software Development Kit (SDK) for an MFC application and when to use the functionality provided by the MFC framework. | Chapter 3, Lesson 1 |
Choose whether to use an MFC regular DLL or an MFC extension DLL. | Chapter 3, Lesson 1 |
Explain how command messages are routed between a user interface object and a handler function. | Chapter 3, Lesson 3 |
Describe the Document/View architecture. | Chapter 3, Lesson 4 |
Explain the MFC drawing, printing, and print preview architecture. | Chapter 3, Lesson 4 |
Explain how the MFC architecture supports multithreading. | Chapter 5, Lesson 3 |
Evaluate whether access to a database should be encapsulated in an object. | |
Evaluate whether a database should be incorporated in the application. | Chapter 7 |
Identify which type of library to use. Valid libraries include MFC, ATL, and the SDK. | Chapter 7 |
Identify which type of object to use. Valid object types include ADO, ODBC, and RDO. | Chapter 7, Lesson 1 |
Design the properties, methods, and events of components. | Chapter 9, Lesson 1 |
Establishing the Development Environment
Skills measured | Location in book |
---|---|
Establish the environment for source-code control by using Visual SourceSafe. Issues include multiple user/multiple location development and versioning of the source code. | Chapter 2, Lesson 3 |
Install the Visual C++ development tools that are necessary for developing a desktop application on various platforms. Platforms include Windows NT Workstation, Windows NT Server, Windows 95, and Windows 98. | Chapter 1, Lesson 2 |
Creating the User Interface
Skills measured | Location in book |
---|---|
Implement the navigation for the user interface. | |
Create and integrate toolbars in an MFC application. | Chapter 4, Lesson 1 |
Implement ToolTips for toolbar buttons. | Chapter 4, Lesson 1 |
Implement and write to the status bar in an MFC application. | Chapter 4, Lesson 1 |
Given a scenario, select the appropriate options to create a new application by using the MFC AppWizard. | Chapter 2, Lesson 1 |
Create and edit user interface objects by using the resource editors. | Chapter 4 |
Create a new class by using ClassWizard. | Chapter 4, Lesson 1, Lab 4 |
Add member variables by using ClassWizard. | Chapter 5, Lesson 1 |
Add a message handler for an event by using ClassWizard. | Chapter 5, Lesson 1 |
Create data input forms and dialog boxes. | |
Create a static menu by using the menu editor. | Chapter 4, Lesson 1 |
Create a dialog box by using the dialog editor. | Chapter 4, Lesson 2 |
Create property sheets by using ClassWizard. | Chapter 5, Lesson 1 |
Create dialog box classes and members by using ClassWizard. | Chapter 4, Lesson 2; Chapter 5, Lesson 1 |
Use the CFormView class to create a view that contains controls. | Chapter 7, Lesson 2 |
Validate user input. | |
Validate user input by using DDV. | Chapter 5, Lesson 1 |
Validate user input by using ClassWizard. | Chapter 5, Lesson 1 |
Process user input from a form or a dialog box by using DDX. | Chapter 5, Lesson 1 |
Use an ActiveX user interface control. | |
Insert a control into a project by using the Components and Controls Gallery. | Chapter 7, Lesson 3 |
Handle an event from an ActiveX user interface control. | Chapter 10, Lab 10 |
Dynamically create an ActiveX user interface control. | Chapter 11, Lab 11 |
Use the MFC AppWizard to create an ISAPI DLL that can dynamically change Web content. | Chapter 12, Lesson 2 |
Incorporate Dynamic HTML scriptlets into a Visual C++ desktop application. | Chapter 12, Lesson 1 |
Create or modify an MFC application to store and retrieve personalized user settings from the registry. | Chapter 6, Lesson 3 |
Display data from a data source. | |
Implement standard serialization by using Serialize. | Chapter 6, Lesson 2 |
Implement persistence by using CFile. | Chapter 6, Lesson 1 |
Display data by using CArchive. | Chapter 6, Lesson 2 |
Connect a recordset to dialog box controls. | Chapter 7, Lesson 2 |
Instantiate and invoke a COM component. | Chapter 10 |
Add asynchronous processing. | |
Create secondary threads. | Chapter 5, Lesson 3 |
Download ActiveX user interface controls. | Chapter 14, Lesson 4 |
Implement online user assistance in an application. | |
Implement status bars. | Chapter 4, Lesson 1 |
Implement ToolTips. | Chapter 4, Lesson 1 |
Implement context-sensitive Help. | Chapter 5, Lesson 4 |
Create Help for an application that provides links to a Web page containing Help files. | Chapter 5, Lesson 4 |
Implement error handling. | |
Implement exception handling. | Chapter 13, Lesson 1 |
Given an error, determine how to handle the error. | Chapter 13, Lesson 1 |
Use an active document. | Chapter 12, Lesson 2 |
Creating and Managing COM Components
Skills measured | Location in book |
---|---|
Create a COM component that implements business rules or logic. | |
Create a COM component by using ATL. | Chapter 9, Lesson 1 |
Create a COM component by using the SDK. | Chapter 9, Lesson 2 |
Create a COM component by using MFC. | Chapter 9, Lesson 2 |
Create an ATL COM in-process COM component and an ATL COM client to access it. | Chapter 9, Lesson 1; Chapter 10, Lesson 1 |
Create an ATL COM out-of-process COM component and an ATL COM client to access it. | Chapter 9, Lesson 1 Chapter 10, Lesson 1 |
Create ActiveX user interface controls. | |
Create an ActiveX user interface control by using ATL. | Chapter 11, Lesson 2 |
Create an ActiveX user interface control by using the SDK. | Chapter 8, Lesson 5 |
Create an ActiveX user interface control by using MFC. | Chapter 11, Lesson 1 |
Create a COM component that reuses existing components. | |
Explain the difference between aggregation and containment. | Chapter 10, Lesson 2 |
Add error handling to a COM component. | Chapter 13, Lesson 2 |
Log errors into an error log. | Chapter 13, Lesson 1 |
Create and use an active document. | Chapter 12, Lesson 2 |
Debug a COM component. | Chapter 13, Lesson 4 |
Create a COM component that supports apartment-model threading. Models include single-threaded apartment, multithreaded apartment, or both. | Chapter 8, Lesson 4 |
Creating Data Services
Skills measured | Location in book |
---|---|
Access and manipulate data by using ad hoc queries. Methods include ODBC, ADO, DAO, RDO, and data source control. | Chapter 7, Lessons 2, 3 |
Handle database errors. | Chapter 7, Lesson 2 |
Testing and Debugging the Solution
Skills measured | Location in book |
---|---|
Determine appropriate debugging techniques. | |
Use library debugging support. | Chapter 13, Lesson 4 |
Use the IDE. | Chapter 13, Lesson 4 |
Use Depends. | Chapter 13, Lesson 5 |
Use Spy++. | Chapter 13, Lesson 6 |
Given a scenario, describe the type of debugging support that Visual C++ provides for resolving programming errors. | Chapter 13 |
Step through code by using the integrated debugger. | Chapter 13, Lesson 4 |
List and describe the MFC macros that are used to debug applications. | Chapter 13, Lesson 3 |
Identify and describe the elements of a test plan. Elements include beta testing, regression testing, unit testing, integration testing, and stress testing. | |
Evaluate the need for beta testing. | Chapter 13, Lesson 7 |
Incorporate stress tests. | Chapter 13, Lesson 7 |
Deploying an Application
Skills measured | Location in book |
---|---|
Create a Setup program that installs an application and registers the COM components. | Chapter 14, Lessons 1, 2 |
Use .cab files to package and distribute an application. | Chapter 14, Lesson 1 |
Plan disk-based deployment or CD-based deployment for an application. | Chapter 14, Lesson 4 |
Plan Web-based deployment for an application. | Chapter 14, Lesson 4 |
Plan network-based deployment for an application. | Chapter 14, Lesson 4 |
Given a scenario, evaluate the use of Microsoft Systems Management Server as an aid to deploying a solution. | Chapter 14, Lesson 5 |
Create a setup program that installs an application and allows for the application to be uninstalled. | Chapter 14, Lesson 2 |
Evaluate Zero Administration for Windows (ZAW) as an aid to deploying a solution. | Chapter 14, Lesson 5 |
Maintaining and Supporting an Application
Skills measured | Location in book |
---|---|
Fix errors, and take measures to prevent future errors. | Chapter 13 |
Deploy application updates. | Chapter 14, Lesson 4 |
The Microsoft Certified Professional (MCP) program provides the best method of proving your command of current Microsoft products and technologies. Microsoft, an industry leader in certification, is on the forefront of testing methodology. Its exams and corresponding certifications are developed to validate your mastery of critical competencies as you design and develop, or implement and support, solutions with Microsoft products and technologies. Computer professionals who become Microsoft certified are recognized as experts and are sought after industry-wide.
The MCP program offers five certifications, based on specific areas of technical expertise:
Microsoft certification, one of the most comprehensive certification programs available for assessing and maintaining software-related skills, is a valuable measure of an individual's knowledge and expertise. Microsoft certification is awarded to individuals who have successfully demonstrated their ability to perform specific tasks and implement solutions with Microsoft products. As with any skills assessment and benchmarking measure, certification brings a variety of benefits to the individual, and to employers and organizations. Not only does certification provide guidance for what an individual should know to be proficient, but it also provides an objective measure for employers to consider when hiring IT professionals.
Every effort has been made to ensure the accuracy of this book and the contents of the companion CD. Microsoft Press provides corrections for books through the World Wide Web at:
http://mspress.microsoft.com/support/
If you have comments, questions, or ideas regarding this book or the companion CD, please send them to Microsoft Press via e-mail to:
tkinput@microsoft.com
or via postal mail to:
Microsoft Press
Attn: Desktop Applications with Microsoft Visual C++ 6.0 MCSD Training Kit Editor
One Microsoft Way
Redmond, WA 98052-6399
Please note that product support is not offered through the above addresses.
This course was developed for Microsoft Press by ARIS Corporation. ARIS is an innovative, professional services and software company that works with clients globally to maximize the usefulness of existing information technologies and the integration of new technologies. ARIS enables companies and government agencies to find and implement client/server and Internet solutions to improve their business operations. The company's consulting and training services utilize leading-edge technologies, primarily from Microsoft, Oracle, PeopleSoft, Sun Microsystems and Lotus. ARIS is a Microsoft Solutions Provider Partner.
ARIS has offices across the United States and in the United Kingdom and Germany, with over 900 employees worldwide. For more information about the products or services offered by ARIS, visit the Web site at www.aris.com.
ARIS produced this course with the assistance of Software Architects Inc., Witzend Software, and other contributing authors. Software Architects, Inc. (www.swarchitects.com) specializes in custom software in all environments from Windows to Unix on a wide variety of application domains. Additionally, Software Architects, Inc. offers a series of practical, custom-developed, intensive courses at all levels of Windows programming. Witzend Software (www.witzendsoft.com) is a Seattle-based company that provides custom programming services, specializing in Visual C++ and COM. Individuals who participated in the production of this course include:
Lead author, project lead, and courseware designer: | Julian Lindars, MCSD |
Contributing authors: | Dr. Bruce Krell (Software Architects, Inc., swarch.krell@prodigy.net) |
Beck Zaratian (Witzend Software) | |
Bob McCoy, MCT | |
Scott F. Wilson (KiZAN Corporation) | |
Additional material: | Ruth Hogan, MSCE |