9. Introduction to the TutorialWelcome to Digital Mars C++. This section of the manual contains a tutorial designed to introduce you to the important components and features of the Integrated Development and Debugging Environment (IDDE) -- the "shell" within which most of your application development takes place.
The tutorial is designed to complement Part Two, "Creating an Application with Digital Mars C++." The tutorial provides a quick tour of the IDDE that shows you how to perform the most common tasks. Part Two contains more in-depth information, to show you procedures for less common tasks and alternative ways of accomplishing things.
Prerequisite KnowledgeThis tutorial assumes that you are familiar with the Windows environment -- that you can start applications from the Program Manager, move and resize windows, operate menus and dialog boxes, and perform simple text editing tasks (such as cut, copy, and paste). The tutorial also assumes some familiarity with C, C++, and Windows programming basics. You need not know anything about the Microsoft Foundation Class (MFC) library; MFC basics are introduced here.
For more information, consult the references listed in Chapter 1, Introducing Digital Mars C++.
The Tutorial ApplicationThe application built in the tutorial lets you read and navigate through hypertext. Two versions are built: a DOS version (in Lesson 1) and a Windows 3.1 version (in Lessons 2-5). Most of the code for the application has been written; the tutorial just shows you certain stages in the development process to familiarize you with IDDE tools.
The hypertext files that the tutorial applications accept as input are text files containing simple commands that control document formatting and show images as well as commands that define links to other such documents. The markup language recognized by the tutorial applications, referred to throughout the tutorials as TML, is a subset of the Hypertext Markup Language (HTML). HTML is a format that has become a standard for information interchange on the World-Wide Web (WWW), a distributed hypermedia system accessible through Internet connections.
Special WWW browser programs enable users worldwide to access and share text, graphics, audio, and other data. The tutorial applications only hint at the richness of full-featured WWW browsers. The DOS TML Reader built in Lesson 1 is called TMLDOS; the Windows version of Lessons 2 through 5 is called TMLRead.
Tutorial StructureThe tutorial comprises five lessons that include instructions for performing various tasks. Following these instructions will teach you basic procedures and familiarize you with IDDE tools. Each lesson builds on concepts and procedures introduced in previous lessons, so it is best to work through the lessons in order.
teaches you the basics: how to start the IDDE, open Source
windows for editing text, and compile and run a program. In
addition, the first lesson shows you how to run in debugging mode
and perform fundamental debugging tasks. The example program in
Lesson 1 is a DOS application; however, the skills you learn are
equally applicable to Windows application development.
shows you how to use AppExpress to generate an
application framework for a Windows program. You also learn to
use precompiled headers and to use TRACE calls within your
program to track its progress. Lesson 2 concludes with a brief
introduction to MFC and describes the classes that constitute the
application framework you generated.
Lesson 3 teaches you how to use the ResourceStudio. You modify
the menu and accelerator table generated by AppExpress, and attach
a new toolbar bitmap to your application's resources. You then edit
the source code to make use of the new toolbar.
shows you how to use ClassExpress to add message
handlers to your application. You add handlers for Windows
messages, such as scrolling, mouse button clicks, and keypresses,
then monitor the message handlers as the application framework
- Lesson 5 returns to the ResourceStudio, with which you add a menu item to open a simple Preferences dialog box. You use ClassExpress to create a new class for the dialog box and add message handlers. Finally, you add code to connect the menu item to the dialog box and to exchange information between the dialog box and the main program.
Tutorial Source CodeThe source code for the tutorial is located in samples\tutorial, under the directory in which you installed Digital Mars C++ (by default, this is c:\dm\samples\tutorial). The samples\tutorial directory contains a subdirectory corresponding to each lesson (these subdirectories are named lesson1, lesson2, lesson3, lesson4, and lesson5).
Each lesson's subdirectory (except lesson2) contains three subdirectories, named start, finish, and backup.
- The start subdirectory is your working directory during the tutorial; it contains the project and source code that you change as part of the lesson.
- The finish subdirectory contains the project as it should appear after the steps in the lesson are performed correctly.
- The backup subdirectory is a copy of the initial contents of the start subdirectory. If you want to redo the lesson from scratch, delete the contents of the start subdirectory and copy all the files in the backup subdirectory to the start subdirectory.
The source and executable of the final DOS version of the TML Reader is contained in tutorial\tmldos. The source and executable of the final Windows version is located in tutorial\tmlread.