Copyright: Copyright © Borland International Inc


Contents

Welcome to the Borland PowerPack for DOS information help file.

High-level feature overview

The need for the PowerPack

Key features and benefits

In-depth overview

System requirements

Pricing and availability

Copyright.


High-level feature overview

The Borland PowerPack for DOS provides several important features for DOS developers:

NEW  Royalty free 16- and 32-bit DOS Extenders

NEW  More application memory

NEW  Faster application performance

NEW  Code reuse through DOS DLLs

NEW  16- and 32-bit Borland Graphics Interface libraries

NEW  Support for the newest super vga video cards

NEW  16- and 32-bit Turbo Vision libraries

NEW  Data validation classes

NEW  Outline viewer object


The need for the PowerPack

In addition to developing for graphical environments such as Windows and OS/2, most programmers continue to develop and maintain DOS applications as well.  The reason is simple.  DOS has by far the largest installed base of any operating system, and will continue to sell well into the foreseeable future.  In fact, recent surveys have indicated that one out of every five personal computers sold this year will be installed with DOS only.  Clearly, DOS will continue to represent a substantial market opportunity for some time to come.

Despite its tremendous success, DOS has some serious limitations.  Most notable is the fact that DOS relies on the 16-bit segmented memory architecture used by the Intel 8086 microprocessor.  Newer microprocessors such as the 80386 and 80486 must emulate this architecture to run DOS.  The 8086 architecture limits the range of addressable memory to 1MB.  Even worse, by default DOS applications can access only the first 640K bytes of this memory.  The remaining 384K is used by the system for video memory, the BIOS, and as ROM for expansion cards.  Although the majority of personal computers sold today contain four or more megabytes of RAM memory, this additional memory is unable to be addressed without substantial effort.  As DOS applications increase in complexity, developers are finding the memory limitations of DOS to be unacceptable.

The best solution to this problem is a DOS Extender.  A DOS Extender utilizes the advanced features of 80286 and newer microprocessors to allow transparent access to all machine memory.  An application that manipulates a pointer to memory need not worry whether this memory was allocated above the 1MB limit or below it.  Further, a DOS Extender still allows access to DOS and BIOS calls, interrupt handlers, and other low-level techniques common in today's software.

The Borland PowerPack for DOS contains a powerful set of development tools and libraries for the DOS developer.  Included are both a 16-bit and a 32-bit DOS Extender which allow programmers to break through the 640K barrier.  The 32-bit extender is for use with 80386 or better microprocessors and allows access of up to 4GB of machine memory.  The 16-bit extender is for use the 80286 or better microprocessors and allows access of up to 16MB of machine memory.  As an added benefit, both extenders enable dynamic link libraries (DLL's) to be shared between DOS and Windows.  Applications written using the DOS Extenders included in the PowerPack will work with any DPMI server that provides.9 DPMI services or better. Also included in the product are 16- and 32-bit versions of the popular Borland Graphics Interface (BGI) library.  This library provides a complete set of functions for creating high performance graphics applications.  In addition, the Borland PowerPack for DOS includes 16 and 32-bit versions of the Turbo Vision 2.0 application framework for creating event-driven text mode interfaces for DOS applications.


Key Features and Benefits

The Borland PowerPack for DOS makes it easy to unlock the power of today's microprocessors.  With both 16- and 32-bit DOS Extenders, the lightning fast BGI graphics library, and the Turbo Vision application framework, the Borland PowerPack for DOS provides all of the necessary tools for creating sophisticated DOS applications.

16- and 32-bit DOS Extenders

Borland Graphics Interface

Turbo Vision 2.0


16 and 32-bit DOS Extenders
16- and 32-bit DOS Extenders

More DOS memory.  Applications built using the Borland PowerPack for DOS break through the 640K memory barrier.  The 32-bit DOS Extender not only increases the amount of addressable memory to 4GB, but makes applications easier to develop by providing a flat address space. Applications written with the 32-bit DOS Extender also show a dramatic increase in performance since they run in a native 32-bit environment. The 16-bit DOS Extender allows applications to access up to 16MB of machine memory.

Royalty free distribution.  The extenders included in the Borland PowerPack for DOS are completely royalty free.  There are no licensing or distribution fees.  Now every developer can take advantage of DOS Extender technology.

Increased code reuse through DOS DLLs.  The DLL technology found in the Borland PowerPack for DOS allows developers to share DLLs between DOS and Windows without recompiling.  DLL's written using the 16-bit DOS Extender can be shared with Windows 3.1, while DLLs written using the 32-bit DOS Extender can be shared with Windows NT and Chicago.

Seamless integration into the Borland C++ 4.0 IDE.  The Borland PowerPack for DOS integrates directly into the Borland C++ 4.0 environment, so there's no switching between different tools. Using the TargetExpert, a developer can select from between Windows, Windows NT, DOS real mode, and DOS 16- or DOS 32-bit protected mode development with a click of the mouse. Screen shot of the TargetExpert.

16- and 32-bit DOS Extenders in depth


Borland Graphics Interface

16- and 32-bit libraries.   The Borland PowerPack for DOS includes 16 and 32-bit graphics libraries.  This allows programmers to add charts, graphics, and animation to their protected mode applications.

Extended graphics driver support.  The new 32-bit BGI library supports more video cards and resolutions.  Supported video cards include TSENG, PARADISE, VIDEO7, TRIDENT, and all S3 cards.  The 32-bit BGI library can operate in resolutions as high as 1280x1024.

High Performance.  The BGI libraries included in the Borland PowerPack for DOS were written in assembly language to provide superior performance. Applications that use the 32-bit graphics libraries will typically perform twice as fast as those that use the 16-bit graphics libraries.

The Borland Graphics Interface in depth


Turbo Vision 2.0

16- and 32-bit libraries. Turbo Vision 2.0 works in real mode and both 16-and 32-bit protected mode.  This gives Turbo Vision 2.0 applications megabytes of memory to work with.

Data validation classes.  Using the validator objects makes it easy to add data validation to any existing or new Turbo Vision applications. Validator objects are connected to edit control objects to validate the information a user types into an edit control.  For example, you can add a use a validator to create an edit control that will only accept numeric input.

Outline viewer object.  The new outline viewer object presents data in a hierarchical format, allowing users to incorporate sophisticated outline displays in their applications. Outline Viewer Screen Shot.

Turbo Vision 2.0 in Depth


Technical Overview
In Depth Overview

16 and 32-bit DOS Extenders in depth

Borland Graphics Interface in depth

Turbo Vision 2.0 in depth


16 and 32-bit DOS Extenders In Depth
16- and 32-bit DOS Extenders in Depth

By allowing programmers to break through the 640K barrier, DOS Extenders help unlock the power of todays microprocessors.  And with the flat memory model provided by Borland's 32-bit extender, DOS programming becomes easier than ever before. No longer do programmers have to worry about near and far pointers or segment arithmetic.  Plus, developers get the benefit of true 32-bit performance.

Compiling for protected mode

Compatibility

DOS DLLs


BGI DLLs

Protected mode BGI support follows a slightly different model from the real mode graphics library included in Borland C++ 4.0.  The 16- and 32-bit graphics libraries included in the Borland PowerPack are implemented as DOS DLLs.  The 16- and 32-bit BGI DLLs are called BGI16.DLL and BGI32.DLL, respectively.  Instead of linking with GRAPHICS.LIB, you  must link with BGI16.LIB or BGI32.LIB, the

import libraries for 16-bit and 32-bit applications.


Compiling for protected mode

Whether compiling from the command line, or using the Borland C++ 4.0 Integrated Development Environment (IDE), creating DOS extended applications is easy.  You can easily recompile most existing real mode applications to take advantage of Borland's DOS Extenders.

When using the IDE, simply use the TargetExpert to select DOS 16-bit or 32-bit DPMI targeting.  With a click of the mouse you can choose between building a DOS extended application or a DOS DLL.

New command line switches

Breaking the 640K barrier


New command line switches

Borland's command line compilers feature new switches to target DOS extended applications.  For BCC.EXE these switches are:

     -WX        	DPMI16 EXE

     -WXD      	DPMI16 DLL, all functions exported

     -WXDE     	DPMI16 DLL, explicit functions exported

and for BCC32.EXE these switches are:

     -WX       	DPMI32 EXE, all functions exported

     -WXD      	DPMI32 DLL, all functions exported

     -WXDE     	DPMI32 DLL, explicit functions exported


Breaking the 640K barrier

Programmers will experience a dramatic increase in the memory available for code and data when using DOS Extenders.

The following program helps illustrate the additional memory available to a DOS Extended application:

#include <iostream.h>

#include <except.h>

const BLOCK_SIZE = 4096;

#pragma warn -aus

int main( void )

{

long totalRam = 0;

char* p;

try

{

for( ;; )

{

p = new char[BLOCK_SIZE];

totalRam += BLOCK_SIZE;

}

}

catch( xalloc)

{

     cout << "Total memory allocated is " << totalRam <<

end;

}

return( 0 );

}

When compiled for real mode, the above program displays the following:

Total memory allocated is 417792

This occurs even though the computer contains over 12 MB of RAM memory.  When running in real mode, applications must work within the 640K memory barrier.

When compiled for extended mode, the same program displays the following:

Total memory allocated is 13012992

If run from a DOS box in Windows, this program would be able to make use of virtual memory allowing access to more memory that is physically available.


Compatibility

Applications created using Borland's DOS Extenders are compatible with a number of operating environments. Programs written using the 16-bit DOS Extender run unmodified under DOS, Windows NT, Windows 3.1 DOS boxes, Windows 3.11 DOS boxes and OS/2 2.x DOS boxes. Programs written using the 32-bit DOS Extender in general run under DOS, Windows NT, Windows 3.1 DOS boxes, and OS/2 2.x DOS boxes. Applications which use interrupts or IO instructions, or expect to have direct access to video/DOS memory will generally fail to run under NT.

The 16- and 32-bit extenders support emulation of the non visual Windows and Win32 APIs, respectively. An import record is provided for those APIs which are emulated, so use of unimplemented functions will result in link time errors.  If you need to use an API function which is not implemented by the extenders, you can hook unresolved APIs and provide resolution for them at run time.  To do this, you need to implement and export a hook function as follows:

FARPROC WINAPI _export

BorlandUnresolvedEntryHook (LPCSTR modName,

  BOOL	byOrdinal,

  LPCSTR entry);

 The first parameter is the name of the module for the function, for example, "KERNEL".  The second parameter tells whether the third parameter is a string or an ordinal value.  If it is FALSE, then the third parameter is a string naming the unresolved entry, for example, "GETATOMNAME".  Your hook function should determine if it is has an implementation for this entry.  If it does, it should hand back a pointer to the function.  This will be used by the loader to resolve the references in the image.


DOS DLLs

The DLL technology found in the Borland PowerPack for DOS allows developers to share DLLs between DOS and Windows without recompiling.

Developers can create DOS DLLs callable from both DOS and Windows, or can take advantage of using Windows DLLs from DOS.  This includes many of the commercially available Windows DLLs, such as the Borland Paradox Engine.  As long as a Windows DLL doesn't make calls to Windows user interface or graphics functions, it can be used from DOS.  DLLs written using the 16-bit DOS Extender can be shared with Windows 3.x, while DLLs written using the 32-bit DOS Extender can be shared with Windows NT and Chicago.

DOS DLL Architecture Diagram


Borland Graphics Interface in depth

The Borland PowerPack for DOS includes high performance 16- and 32-bit versions of the Borland Graphics Interface (BGI) library.  The BGI library provides over 70 graphics functions, ranging from high-level calls (such as setviewport, bar3d, and drawpoly) to bit-oriented functions (such as getimage and putimage).  The graphics library supports numerous fill and line styles, and provides several text fonts that you can size, justify, and orient horizontally or vertically.

BGI DLLs

Graphics Performance


Graphics Performance

The performance of the BGI libraries included in the Borland PowerPack for DOS has been greatly enhanced.  Each of the routines is written in hand optimized assembly language to provide fast execution.  In particular, the performance of the 32-bit graphics library is particularly fast.

The following program demonstrates the speed of the 32-bit graphics library. This program draws 1000 random polygons on the screen, and then displays the number of seconds required to perform that task.  The real mode version takes 7 seconds on a 80486 66MHz machine, while the 32-bit version takes only 3 seconds on the same machine.  While this program tests only a small portion of the graphics support in the drivers and graphics engine, the results are indicative of the overall speed provided by the 32-bit library.

#include <dos.h>

#include <stdio.h>

#include <stdlib.h>

#include <time.h>

#include <graphics.h>

#include <_defs.h>

struct PTS {

  int x, y;

};

int    GraphDriver;

int    GraphMode;

int    MaxX, MaxY;

int    MaxColors;

int    ErrorCode;

void Initialize(void);

void PolyDemo(void);

//      Begin main function

int main()

{

  time_t t1, t2;

  Initialize();

  t1 = time(NULL);

  PolyDemo();

  t2 = time(NULL);

  closegraph();

  printf( "Time is %ld seconds", t2-t1);

  return(0);

}

//      INITIALIZE: Initializes the graphics system

void Initialize(void)

{

 	//  GraphDriver = DETECT;

   	GraphDriver = VGA;

    initgraph( &GraphDriver, &GraphMode, "d:\\bc4.0\\bgi" );

    ErrorCode = graphresult();

    if( ErrorCode != grOk )

    {

       printf("Graphics Error: %s\n",grapherrormsg(ErrorCode));

       exit( 1 );

}

  }

  MaxColors = getmaxcolor( ) + 1;

  MaxX = getmaxx();

  MaxY = getmaxy();

}

//   POLYDEMO: Display a random pattern of polygons on the

screen

#define MaxPts          6

void PolyDemo(void)

{

    struct PTS poly[ MaxPts ];

    int color;

    int i, nTimes;

    for(nTimes = 0; nTimes < 1000; nTimes++)

    {

       color = 1 + random( MaxColors-1 );

       setfillstyle( random(10), color );

       setcolor( color );

       for( i=0 ; i<(MaxPts-1) ; i++ ){

          poly[i].x = random( MaxX );

          poly[i].y = random( MaxY );

       }

       poly[i].x = poly[0].x;

       poly[i].y = poly[1].y;

       fillpoly( MaxPts, (int _FAR *)poly );

    }

}


Turbo Vision 2.0 in depth

Turbo Vision is Borland's application framework for DOS.  It encapsulates the behavior of a text-mode application that conforms to the IBM Common User Access (CUA) user interface specification.  With Turbo Vision, you can inherit an application that has pull-down menus, overlapping windows, dialog boxes, and mouse support.  Turbo Vision gives the DOS developer a head start in creating great looking text-mode applications. A screen shot of a Turbo Vision 2.0 application.

Turbo Vision includes a class hierarchy that supports event handling, user interface management, and data management.  Turbo Vision includes over 100 classes, including classes that allow developers to easily incorporate objects such as calculators, calendars, edit windows, file open and directory navigation dialog boxes, and a clock in their applications.

Turbo Vision 2.0 now includes classes for data validation, a multi-state checkbox, and an outline viewer that presents a hierarchical view of data.

Turbo Vision's Extensible Architecture

Turbo Vision's Windowing User Interface

Turbo Vision' High-level Objects

Turbo Vision's Hypertext-help


Turbo Vision's Extensible Architecture
Turbo Vision classes define a CUA application as a set of abstract classes that provide a general structure for implementing an interface.  The result is a large body of ready-to-use, high-quality code that can be inherited directly by your application.


Windowing User Interface
Turbo Vision provides support for windows and mouse operations, in an event-driven environment.  The user is relieved of the task of writing code to define window behavior, manage windowing objects such as menus and dialog boxes, and read user input.


High-level Objects
Objects such as an editor, a calendar, a calculator, a clock, as well as standard dialog boxes for opening files and browsing directories, and a color palette are included in Turbo Vision.  This allows users to incorporate these features easily in application programs.


Turbo Vision's Hypertext help
Programmers can build applications with context-sensitive, hypertext-based help.


System Requirements

A complete installation of the current version of Borland PowerPack for DOS requires 5 Mb of hard disk space. The Borland PowerPack for DOS requires a minimal installation of Borland C++ 4.0.


Pricing and Availability

The Borland PowerPack for DOS is priced at $99.95 and is expected to be available at the end of June 1994.

To order the Borland PowerPack for DOS in the US, call 1-800-645-4559.

Borland Corporate Headquarters: 100 Borland Way, Scotts Valley, California 95066-3249, (408) 431-1000

Australia 02-911 1000, Belgium 02-4610 448, Canada 416-229-6000, Denmark 42-27 64 55, France 1-34 65 60 00, Germany 06103 7680, Hong Kong 540 4380, Italy 2-26 91 51, Japan 03-5350 9370, Korea 02-551 2795, Latin America Headquarters  (408) 431-1074, Malaysia 03-230-2618, Netherlands 020-540 54 00, New Zealand (09) 360-0231, Singapore 65-339-8122, Spain 34-1-650 72 50, Sweden 08-799 20 00, Taiwan 2-718-6627, United Kingdom 0734 320022


Outline View Screen Shot


A screen shot of a Turbo Vision 2.0 application


Screen shot of the TargetExpert


DOS DLL Architecture Diagram


Copyright
BORLAND INTERNATIONAL, INC.   1 BORLAND WAY
P.O. BOX 660001, SCOTTS VALLEY, CA 95067-0001

Copyright 1994 by Borland International, Inc.  All rights reserved.  All Borland products are trademarks or registered trademarks of Borland International, Inc.  Other brand and product names are trademarks or registered trademarks of their respective holders