Previous Page TOC Next Page



Appendix C


Microsoft Visual C++ 4.1 and 4.2


Microsoft Visual C++ 4.x is a fully integrated development environment. This environment is also known as Microsoft Developer Studio (MDS). MDS provides a set of tools to complete your application in one place. These tools include text editor, resource editor, compiler, linker, debugger, and so on. This appendix provides an overview of the new features, tools, and ActiveX programming support within Versions 4.1 and 4.2.

Microsoft Visual C++ 4.1


Visual C++ 4.1 is a powerful and intuitive development environment that enables you to develop applications faster and better. It provides many reusable classes and wizards to help the software development. For example, Microsoft Foundation Classes (MFC), Controls Wizards, AppWizards, and Class Wizards.

An Integrated Environment That Simplifies the Project Cycle


Visual C++ 4.1 contains a fully integrated environment with the support of Source Control, Debugging, Info View, Class View, and File View. It also integrates the following packages:

Visual C++ 4.1 has additional support for Windows 95 applications, OLE control containers, new common dialog boxes, and even World Wide Web access within the Developer Studio by choosing the Web Favorites command from the Help menu. The following sections discuss the detailed information on the new classes provided by MFC 4.1 and its samples.

The Microsoft Foundation Class Library is an application framework (often called framework) for writing applications for Microsoft Windows and other platforms that support the Win32 API. The framework is implemented as a group of C++ classes, many of which represent common objects such as windows, documents, views. and so on. MFC 4.1 provides many new classes. such as CHttpFilter to extend the functionalities of the Internet Information Server. These classes are named in the following list.

New MFC Classes


MFC has added five new classes, which are named in the following list, that encapsulate the functionalities provided by the ISAPI. By using these classes, you can create .DLLs to enhance the capabilities of the ISAPI-compliant Web server.

Besides the ISAPI-related classes, classes supporting registry, Data Access Objects (DAO), and other functionalities are added. The following list is just an example of these classes.


New Samples


Version 4.1 has added many new MFC samples that show you how to perform the following tasks:

The following section will list the ActiveX technology support within Version 4.x. Actually, most of these features are provided by Version 2.x except ISAPI Extensions.

Component Object Model Support


Version 4.1 supports Component Object Model (COM) extensively. If you would like your application to have COM support, one thing you must do is make sure that the project has OLE automation and OLE control enabled by clicking the OLE Automation and OLE Control check box shown in Figure C.1.

Figure C.1. Application with support of OLE automation and OLE control.

For more information on how to create an application that supports COM object, please refer to Chapter 3, "Creating COM Objects."

OLE Controls


OLE controls are very easy to create in Version 4.x. In Version 2.x, you have to install a separate control development package. In Version 4.x, the Control Wizard is built-in. You can select File|New, and then choose the Project Workspace in the New dialog box. You can see the Control Wizard in Figure C.2.

Figure C.2. Project Workspace: Wizard Type.

The OLE Control Wizard creates the OLE control framework for you. Then you can use Class Wizard to add custom methods, properties, and events. For more information on how to create OLE controls by using MFC, please refer to Chapter 5, "OLE Controls."

OLE Automation Server


You can use MFC to create an OLE automation server by using the OLE Control Wizard. The only thing you need to do is override IsInvokeAllowed() in your main control class.

OLE Control Container


Version 4.1 also supports Control Container. You can use the AppWizard to create the control container, which supports one or more controls.

ISAPI Extensions


Version 4.1 provides an ISAPI Extension Wizard to simplify the creation of the ISAPI DLLs. You can choose the ISAPI Extension Wizard to project workspace as shown in Figure C.3.

Figure C.3. ISAPI Extension Wizard in the Project Workspace.

For more information on how to use Version 4.x to create an ISAPI DLL, please refer to Chapter 14, "ISAPI Server Applications," and Chapter 15, "ISAPI Filter Objects."

Microsoft Visual C++ 4.2


Version 4.2 offered a lot of environment enhancements in addition to those found in Version 4.1. These enhancement are given here:

Besides the environment enhancement, Version 4.2 supports the additional ActiveX programming as discussed in the next section.

ActiveX Programming Support


In Visual C++ 4.2, the following features are supported by MFC:

To demonstrate the new features delivered by Version 4.2, the following new samples are contained under the sample directory.

New Samples


These new samples illustrate the use of several new MFC and Internet related features:


Microsoft Visual C++ 4.x and Active Template Library


ATL stands for Active Template Library (ATL). It is a software package that assists developers in creating COM objects. ATL is also known as OLE COM AppWizard.

ATL is not built in Version 4.2. A copy of ATL can be found on the Microsoft Web http://www.microsoft.com/visualc/v42/atl/. After you download a copy of the ATL, you can install ATL by using the command pkunzip -d atl.zip. The include header file and lib will automatically be copied to the c:\msdev directory, and a template will be added to the Visual C++ Workspace. When you launch the Microsoft Visual C++ 4.x, you will see OLE COM AppWizard added in the Project Workspace shown in Figure C.4.

Figure C.4. OLE COM AppWizard.

Note


VC 4.2 does not have new features related to ATL. It also does not have a copy of ATL 1.x or any other version.

The choice of your development platform is very important. I recommend that you choose Microsoft Visual C++ 4.2 rather than VC 4.1 because Version 4.2 provides a great deal of functionality that will greatly reduce the time involved in developing the same application under Version 4.1.

Previous Page Page Top TOC Next Page