Lesson 2: Installing the Visual C Development Tools

In this lesson, you will learn about the options offered by Microsoft Visual Studio 6.0 when installing the Enterprise Edition of Visual C++ 6.0 using a custom installation. The installation setup program is a good place to gain an overview of the features offered by the Visual C++ development environment, as it groups together all the installable options that are available to you in one logically organized, browsable location. If you already have Visual C++ installed, you can still follow through this lesson to further your understanding of the installation options.

After this lesson, you will be able to:

  • Understand the choices presented to users when installing Visual C++ 6.0.
Estimated lesson time: 30 minutes

Microsoft Visual C++ Installation

Visual C++ comes as part of the Visual Studio development suite or as a stand-alone product. In either case, you start the installation process by running the Setup.exe file from the root directory of the CD.

NOTE
If you are using Windows NT 4.0, you will need to install the Windows NT Service Pack 3 before you can install Visual C++.

First you will be presented with a dialog box providing you with the opportunity to browse the Readme file. This file contains important information that will likely impact your development effort, so you should at least scan its contents.

Next, you will be presented with the user license agreement. Once you have read and accepted the user license agreement and entered your product number and user ID, you will be taken to a dialog box that presents you with setup options. At this point, choose a Custom setup and click Next.

On the screen that appears, accept the default installation location by clicking Next. The setup process will begin. Read the information screens and click Next until you arrive at the Custom Setup screen, shown in Figure 1.8. (This figure displays the Visual Studio version of this screen, which shows options to install the other products in the Visual Studio suite.)

click to view at full size.

Figure 1.8 The Visual Studio Custom Setup screen

If you already have Visual C++ installed, you'll want to get to the maintenance dialog box that allows you to add or remove components for your current installation. You access this dialog box by selecting the Workstation option. This maintenance dialog box is identical to the setup screen, so you can use it to explore the installation options.

The custom setup screen appears with a default set of installation options selected, which you can change as required. A check mark next to an installation option means that the option will be installed. Many of the options are arranged in a hierarchical order. If one of the items in the Options list is selected and the Change Option button is made available, you can click it to reveal further sub-options beneath the currently selected option. OK and Cancel can be used to move up the option hierarchy, saving or discarding the changes you have made to the option selection on each screen.

If an option check box is selected but shaded, only some of its suboptions are selected, meaning that only some of its options will be installed.

The following exercise shows you how to use the Custom Setup or Maintenance screen to configure your installation options.

  • To configure installation options
    1. In the Options list of the Custom Setup or Maintenance screen, select the Microsoft Visual C++ 6.0 option as shown in Figure 1.8.
    2. Click the Change Option button.
    3. In the Options list, select the VC++ Runtime Libraries option. Click the Change Option button.
    4. Note that the CRT Source code option is not selected. Note, too, that the option requires 5805 KB of disk space. Having the C run-time source code available means that you can use the debugger to step through the C source code of the standard C libraries. If the CRT source code is unavailable, you will only see assembly language instructions when you use the debugger to step into a C library function. Having this source code available can also be instructional in that it demonstrates how professional C programmers handle a particular programming situation.

    5. If you would like to have the CRT library source code available, and you can spare the half-megabyte of disk space that this option requires, select the check box next to that option.
    6. If you have changed any of the options that are currently displayed in the Options list and you want to save the changes, click OK to revert to the previous screen in the hierarchy. Otherwise, click Cancel to leave the options as they were.

    TIP
    If you make changes at one level and click OK, and then click Cancel at a higher level, the lower level changes are still reflected in your setup. If you want to cancel the lower level changes, you must go to the dialog box on which they were made and reverse them, and then click OK in that dialog box.

    1. When you have finished configuring the options, return to the main Custom Setup or Maintenance screen, and proceed with the installation by clicking the Continue button. To abandon the installation, click Cancel.

    Installation Options

    The rest of this lesson consists of a brief explanation of most of the Visual C++ installation options. Using the Custom Setup or the Maintenance screen, locate each of the options listed in the following sections and determine whether or not you require them to be installed on your computer.

    Visual Studio

    You have an all or nothing choice of options with Visual Studio, and you should hence select the default choice of All. The default choice installs the development environment, wizards, and debugger.

    The Visual C++ UI consists of an integrated set of windows, tools, menus, toolbars, directories, and other elements that allow you to create, test, and refine your application in one place. You can also work on other types of documents within Visual C++, such as Microsoft Excel or Microsoft Word documents.

    Run-Time Libraries

    The VC++ Runtime Libraries selection, which you read about in the previous exercise, offers four choices:

    • Static CRT Libraries Multithread-capable libraries. These libraries are linked to your application at link time, increasing the size of the executable file. An advantage to static linking is that the executable (.exe) file contains the entire application. A disadvantage is that a change in the program or a library requires a rebuild of the entire application.
    • Shared CRT Libraries Dynamically linked to your application at run time. Accordingly, the application's .exe file is smaller than the same application when statically linked to the libraries. Advantages to dynamic linking include builds that take less time to create, and the ability to redistribute a smaller executable program if you make changes in the application. A disadvantage to dynamic linking is that you have to ensure that users of your program have the link libraries installed on their computers.
    • CRT Source Code Installs the source code for the C++ run-time debug libraries. Having the source code readily available makes programming and debugging easier. You can refer to the code to see how other programmers handle a particular programming situation.
    • Single Threaded CRT Libraries Used when you choose static linking and single threading as build options.

    Each of the libraries has an optimized release version without debug symbols and a debug version with no optimizations, but with debug symbols. When you choose to include the source code, you can step into library functions during debugging sessions.

    Developers of desktop applications on the Win32 platform (that is, Windows 95, Windows 98, and Windows NT) will often want to take advantage of multithreading capabilities offered by these platforms. If you are developing programs that need to run on older 16-bit platforms, you will need to link to the single-threaded CRT libraries.

    MFC Library

    The MFC Library is a collection of C++ classes that provide a framework for programming on the Windows platform. Building on the work of expert Windows developers, you can quickly and easily generate applications, libraries, and software components. MFC makes rapid development available for all aspects of Windows programming, including the development of UIs, Internet development, component technology, and database access—all without sacrificing programming freedom and flexibility. MFC provides the AppWizard, a step-by-step visual tool that allows the developer to quickly and easily generate frameworks to set up a basic application structure; and to generate code to implement fundamental application behaviors.

    The VC++ MFC and Template Libraries option includes the following MFC libraries:

    • Static Libraries Installs the headers, libraries, and debug symbols for static linkage to MFC.
    • Shared Libraries Installs the headers, libraries, and debug symbols for dynamic linkage to shared MFC DLLs.
    • Static Libraries for Unicode Same as static libraries, except that the linkage is to the Unicode version of MFC. Unicode is a 16-bit character set supported by Windows NT that makes character sets of more than 65,000 characters available. You would use Unicode to develop international versions of your application that are required to support languages with large character sets such as Chinese. Note, too, that all internal strings used by Windows NT, such as user account names and device names, are Unicode strings, so you will need to install the Unicode libraries if you are planning to write programs that retrieve and manipulate these strings directly.
    • Shared Libraries for Unicode The dynamic linking, shared version of the MFC Unicode library.
    • Browser Database Installs the browser database for the debug versions of the MFC libraries. The browser allows you to view a graphical representation of the inheritance hierarchy of your classes and of the relationships between them. Makes jumping to MFC source code from within your code quick and easy. However, including browser information in your project does increase the compilation time and the executable program size.
    • Source Code One of the best ways to learn how to program with MFC is to look at the code and step through it using the debugger.

    ActiveX Template Library

    This option is in the same dialog box as the MS Foundation Class Libraries option. Choose MS ActiveX Template Library (ATL) to install the headers, libraries, and source files for ATL.

    ATL is a set of template-based C++ classes with which you can easily create Component Object Model (COM) objects. ATL simplifies the often-complicated process of COM development, but with less overhead than MFC. ATL's ability to generate small, fast components is especially useful if you are developing for an Internet environment. ATL has special support for fundamental COM features including stock implementations of key COM interfaces, and helper classes that simplify working with COM objects and data types. COM and ATL are covered in depth later in this book.

    Build Tools

    The Build Tools option installs the compiler, linker, NMAKE, and other tools used to build applications and components.

    Data Access

    The Data Access option is in the main selection dialog box, at the same level as the C++ options. These options include:

    • ADO, RDS, and OLE DB Providers OLE DB is a new low-level interface that introduces a universal data access paradigm. That is, OLE DB is not restricted to the Indexed Sequential Access Method (ISAM), the Microsoft Jet database, or even relational data sources, but is capable of dealing with any type of data regardless of its format or storage method. For practical purposes, this means that you can access data that resides in an Excel spreadsheet, in text files, or even on a mail server such as Exchange.
    • OLE DB is a set of interfaces that exposes data from a variety of sources using COM. OLE DB interfaces provide applications with uniform access to data stored in diverse information sources. These interfaces support the amount of DBMS functionality appropriate to the data source, enabling it to share its data.

      ADO enables you to write a client application to access and manipulate data in a data source through a provider. ADO is designed as an easy-to-use application level interface to OLE DB providers. ADO's primary benefits are ease of use, high speed, low memory overhead, and a small disk footprint.

      RDS client-side and server-side components work together to bring data over the Internet or over an Intranet to a Web page. These RDS components also allow updated information to be sent back across the network and merged into a database.

    • Microsoft ODBC Drivers Open Database Connectivity (ODBC) provides an API that different database vendors implement via ODBC drivers specific to a particular DBMS. Your program uses this API to call the ODBC Driver Manager, which passes the calls to the appropriate driver. The driver, in turn, interacts with the DBMS using Structured Query Language (SQL).
    • Jet Installable ISAM Drivers The Microsoft Jet database engine is a database management system that retrieves data from and stores data in user and system databases. The Microsoft Jet database engine can be thought of as a data manager component with which other data access systems, such as Microsoft Access and Microsoft Visual Basic, are built. The installable ISAM drivers allow you to access various ISAM data sources, such as the DBase III file format, using the Jet engine.
    • Remote Data Objects and Controls Remote Data Objects (RDO) is a thin object layer interface to the ODBC API. It is specifically designed to access remote ODBC relational data sources.
    • Data Environment The data environment selection adds a grid control, and supporting functionality, to permit design-time data manipulation.

    We suggest that you install the default Data Access options, but consider whether you would ever need to write applications that connect to an ISAM data source using the Jet engine, and look through the Microsoft ODBC Drivers options to see whether the preselected set is likely to meet your needs.

    Enterprise Tools

    The tools included with the Enterprise Edition of Visual Studio are as follows:

    • Application Performance Explorer (APE) Models your application design and tests the expected performance and interactions of a distributed architecture. You can save favorite design architectures and use them as the basis for new configurations and performance tests.
    • Repository Provides a common place to keep information about objects and relationships between objects. In doing so, it provides a standard way to describe object-oriented information used by software tools: Software tools use information composed of various classes of objects; objects expose interfaces; properties, methods, and collections compose interfaces; collections contain relationships to other interfaces; and therefore, collections relate objects to other objects. A software tool is modeled in the Repository through an information model. Each information model is stored in the Repository database as a Repository type library.
    • Visual Component Manager A tool with which to organize, find, and insert components into a Visual Studio project, addressing three requirements for storing and organizing components: publishing, finding, and reusing them. Using the Visual Component Manager, you can identify existing objects available for reuse.
    • Visual C++ Enterprise Tools Adds enhanced data tools support and support for SQL debugging.
    • Visual Modeler A tool for designing three-tier distributed applications using class and component diagrams. With Visual Modeler, you can visually design models of the classes and components your application needs, and then convert these models to Visual C++ code.
    • Visual Studio Analyzer A tool for evaluating, analyzing, and debugging the structure, performance, and interactions of a distributed application from an application perspective, rather than a component or code perspective. Visual Studio Analyzer uses an event-oriented model to record component interactions for analysis.

    General Tools

    General tools are included with all versions of Visual C++. We suggest that you install all of the following:

    • MFC Trace Utility Helps you debug windows programs. You can trace displays to a debugging output window or console, to messages about the internal operation of the MFC library, as well as to warnings and errors if something goes wrong in your application. Trace only works in debug versions of applications. Trace sets the trace flags in Afx.ini. These trace flags determine what message categories the application sends to the debugging window or console.
    • Spy++ A Win32-based utility that gives you a graphical view of the system's processes, threads, windows, and window messages.
    • Win32 SDK Tools Adds a handful of tools that are useful while developing and debugging applications. For instance, DDESpy allows you to monitor dynamic data exchange (DDE) activity in the operating system. PView (process viewer), another SDK tool, lets you examine and modify many characteristics of the processes and threads running on your system.
    • OLE/COM Object Viewer Displays all registered controls. The object viewer reads a control's type library and displays the control's interfaces, as well as registry and other pertinent information.
    • ActiveX Control Test Container Helps the control developer test and debug ActiveX controls. Test Container allows you to test the control's functionality by changing its properties, invoking its methods, and firing its events.
    • VC Error Lookup A simple dialog box application that looks up system and module error codes and displays the text of the error code.

    Visual SourceSafe 6.0

    On the main installation screen, you will find an option to install Visual SourceSafe 6.0 (VSS). VSS helps you manage your projects, regardless of the file type (text files, graphics files, binary files, sound files, or video files), by saving them to a database. If you need to share files between two or more projects, you can share them quickly and efficiently. When you add a file to VSS, the file is backed up on the database, made available to other people, and changes that have been made to the file are saved so you can recover an old version at any time. Members of your team can see the latest version of any file, make changes, and save a new version in the database.

    Lesson 3 in Chapter 2 teaches you how to implement a source-code control system using VSS, so you should ensure that it is installed. During installation, you might be asked to choose between support for the old or new VSS database formats. Generally you should select the newer format—you can upgrade existing VSS databases using the VSS utility DDCONV.EXE

    Completing the Installation

    After you have configured your installation by selecting the appropriate op- tions from the main and sub installation screens, you click the button labeled Continue to start installing the software. You will be prompted to reboot your computer to complete the installation. After the reboot, you will be prompted to install the version of the Microsoft Developers' Network (MSDN) library that comes with your copy of Visual C++. You should do this, as the MSDN library is the means by which online Help and documentation are provided for Visual C++.

    Lesson Summary

    Visual C++ provides a rich environment for the developer. This environment contains an essential set of tools and utilities to allow you to produce efficient, bug-free code. The libraries and frameworks offered in the environment allow you to create code and application structures for common programming situations, allowing you to concentrate your time and skills on the creation of unique solutions.

    The overview of the major installation options provided in this lesson serves as an introduction to many aspects of the Visual C++ development suite that we will cover in more depth throughout this training kit. These include:

    • Visual Studio and debugging tools
    • Microsoft Foundation Classes (MFC)
    • ATL
    • Data Access Technologies
    • Visual SourceSafe (VSS)


    Microsoft Press - Desktop Applications with Microsoft Visual C++ 6. 0. MCSD Training Kit
    Desktop Applications with Microsoft Visual C++ 6.0 MCSD Training Kit
    ISBN: 0735607958
    EAN: 2147483647
    Year: 1999
    Pages: 95

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net