首页  编辑  

Delphi6 新特性

Tags: /超级猛料/IDE.集成开发环境/相关文档/   Date Created:

Delphi6 New Features

What's new

Delphi 6 introduces new features and enhancements in the following areas:

    IDE

    Internet

    VCL

    RTL

    Compiler

    Com/Active X

Note  Some features may not be available in all versions of Delphi.

 

 

New IDE features

New menu

The New menu has changed. Currently it shows five types (Application, Form,

Frame, Data Module and Unit) along with 'other' which brings up the repository.

Packages in Project Manager

Now all open package projects will show up in the Project Manager view. These

package project reference nodes can be used to assist tracking the active

project as well as navigating to any open package, even when the Package is not

a member of the current project group.

Object Tree View

The tree view displays the object inspector's focus' owner component and its

children. For example, a button's owner is its form. The tree view is in lock

step with the object inspector so, as it changes focus the tree view reflects

the changes. All the capability of the data module designer is exposed. This

includes, but is not limited to, drag-n-drop support as well as the popup editor

menus. The tree view is dockable to the object inspector. Right-clicking will

display the same options that appeared in the Data Module Designer.

Before, when an object was not complete it was displayed with a red circle

around it. Now it will show a red checkmark.

Ghost icons represent components implicitly created for you behind the scenes.

For example, Default Session.

Visual code editor with loadable views

The code editor now supports package-loaded custom views. These views are

accessible via tabs located in the status bar. The only built-in view is the

standard Code view. All the rest of the views will come from a package.

The first new view is the components view and is only visible if the current

module has an associated DFM file. This view consists of a list view that

displays the components associated with the module's DFM. If the module's DFM is

a data module derivative this view replaces the data module view. The old view

will not be visible; any keys like F12 will simply activate this view instead.

If the module's DFM is a form/window derivative, this view is simply another way

to look at the DFM's components. Non-visual components are visible via this new

view.

The components view supports modes similar to the repository. You can list the

components by icon, simple list, or detailed list. In detail list mode the

columns can represent any RTTI property or some simple types (i.e. ClassName,

etc.). Columnar sorting is also supported. The selection is synchronized with

the object inspector and tree view. All standard menu items appear in the popup

menu along with additional items to allow you to choose which display mode to

use and to access the property/column selector.

Finally, the components view also allows you to perform limited filtering. You

can limit the items displayed to only non-visual components or display all

components.

Changes and additions to the Object Inspector

The instance list at the top now shows the type of the selected object. And when

the instance list is redundant, it can be hidden by right clicking and selecting

an instance.

The properties that reference an object are now a different color and may be

expanded without changing the selection.

The Object Inspector now supports expanding of component references inline. This

provides access to the properties of the referenced component without having to

select the component on the form. This has been added to support sub-components

and to increase usability.

The instance list at the top of the object inspector is now optional (see the

OI's popup menu).

Component references can now be expanded inline, similar to how TFont works.

Additionally they show up on the events page and then show the events of the

referred component.

The instance list now displays the class types in the dropdown.

The Instance list box has a hint that shows the contents in case the box is too

small to show everything.

The drop down lists (instance and property value) collapse when the arrow is

clicked on a second time.

The tabs have been moved around so that the left most edge is shown all the

time.

 

Code Insight           Code completion now works in the interface section of a

unit

  Displays inherited virtual methods, interface methods and properties

  Supports multi-select and adds all selected items

  Also supports filtering and automatically removes the text used to filter the

list

  Supports WM_xxx, CM_xxx and CN_xxx message methods based on like named

constants from all units in the uses clause

Code Completion

  The popup window is now sizable

  The list now filters based on what has been typed in the editor

  Colors have been added to help distinguish different items

  Abstract methods appear in red and have the word "abstract" appear after the

declaration

  Item declarations appear more like Pascal than previously

  If the typed text matches an item exactly then that item is selected

  If the item is a procedure/function with parameters a "(" is included and a

code parameter hint is displayed immediately

Directories Dialog

  The directories dialog for editing items such as Library Path now displays

invalid paths in gray.

  There is now a button to remove all invalid paths.

Back

New internet features

Apache Web Server application

WebBroker now supports Apache in addition to ISAPI, WinCGI, and CGI.

The COM WebBroker application provides a convenient environment for developing

WebBroker applications.

Test Server

TestSvr enables you to monitor HTTP requests and responses and develop WebBroker

applications without installing a commercial web server.

 

Back

New VCL features

TValueListEditor

The TValueListEditor is a custom grid used for editing TStrings that contain

key/value pairs. Operation is similar to the object inspector. It can be

associated at design time with a component such as TDatabase that contains a

published TStrings property (params) by setting the Component and

ComponentProperty properties.

TXMLDocument

TXMLDocument is a component used for programming XML documents. It takes care of

getting an instance of a IDOMDocument interface and loading and saving xml

files. After setting the filename property and setting Active to true, use the

DOMDocument property to access the contents of the file.

TIPAddress Component

TIPAddress is a new Windows Common Control wrapper for IPAddress class. This

control is used for editing IP Addresses.

TLabeledEdit Component

TLabeledEdit is an addition to the ExtCtrls.pas unit and demonstrates using

sub-components. It is an Edit control that has a label attached to it. The Label

appears as a property of the control.

TPageSetupDialog Component

TPageSetupDialog is an addition to the existing supported common dialogs and is

the preferred dialog for printer setup under Windows 2000, although this dialog

works on WinNT/98 as well. This component provides the ability to paint the page

representation on the dialog itself.

Sub-component demo

Components can now own other components which creates sub-components. For

example, a component can have a property which is a component reference which

can be either internal (a sub-component) or external (a normal component

reference). If the reference is internal then the sub-component is not owned by

the form but by the component on the form. This means that components can now

publish the properties of the sub-component and they will be streamed correctly.

Additionally, the object inspector has been modified to allow you to view the

properties of component references inline (i.e. the Font property). To create a

component that has a sub-component requires a call to

TComponent.SetSubComponent.

Publishable interface properties

Interface properties (properties whose type is an interface) can now be

published if and only if the implementor of the property is a streamable

component.

This means you can now see properties that take an interface in the Object

Inspector, which will provide a drop-down list of components that support the

interface.

New actions

The following actions have been added to VCL:

File Actions

    TFileOpen

    TFileSaveAs

    TFilePrintSetup

    TFileExit

    TShellExecute - ShellExecutes a command

Search Actions

    TSearchFind

    TSearchReplace

    TSearchFindNext

Rich Edit actions

    TRichEditBold

    TRichEditItalic

    TRichEditUnderline

Tab actions

    TPreviousTab

    TNextTab

    TLastTab

Dialog actions

    TColorSelect

    TFontEdit

    TOpenPicture

    TSavePicture

    TPageSetup

Misc. actions

    TBrowseURL

Improved features include:

TCustomAction-Now has a GroupIndex property which allows Actions to work

together as a group the same way GroupIndex works for speedbuttons. Set

GroupIndex to determine how the action behaves when clicked. When GroupIndex is

0, the button behaves independently of all other actions in the ActionList

containing the action. When the user clicks such an action it's Checked property

is not changed. When GroupIndex is greater than 0, setting the action's checked

property to true causes all other actions with the same GroupIndex to be

unchecked.

TImage-A Proportional property has been added which maintains the aspect ratio

of the image regardless of the size of the TImage control.

Controls (TEdit, TMemo, TListBox, TListView, TTreeView, TMaskEdit, TDBEdit

TDBMemo, TDBListBox)-Most of the VCL controls now publish the following Bevel

properties:

  BevelEdges

BevelInner

  BevelOuter

  BevelKind

  BevelWidth

MS-Office style menus

A system of menusmenus that mimics Microsoft Office 2000 style menus has been

implemented. The menus are easy to create, customize and maintain.

Shell Controls

There are three new components that replace DirectoryListBox, FileListBox, and

DriveComboBox, respectively. They are:

  ShellTreeView-This displays a hierarchical view of the file system.

  ShellListView-This provides details on single objects in the file system.

  ShellComboBox-This drops down a list of locations. (not possible to type into

it yet)

Note: Shell controls do not work on Windows 95.

Unit additions

Classes.pas

An assign procedure7okfkm has been added to TList that not only copies but also

allows for primitive set operations.

AddObject override has been added to TStringList that correctly implements

dupIgnore.

Controls.pas

ClientToParent and ParentToClient have been added so you can map your pixels to

one of the parents or children. They work very similarly to ClientToScreen and

ScreenToClient.

ComCtrls.pas

TTreeView-CreateTreeNodes has been added.

Generalized the creation of nodes and made an event so that simple tree users

won't have to create a descendent just to override the node class. Also AddNode

has been changed so you can now pass in the node (of whatever class) you want

added.

Added CreateWndRestores which allows you to say that CreateWnd doesn't need to

restore things.

Added MultiSelectIDH7t6x2v with four properties and eight methods.

TListView-CreateListItems has been added, which matches TTreeView's

CreateTreeNodes.

TStatusBar-The size grip now appears even if the status panel is not directly

parented by its form. As long as the lower right corner of the status bar is in

the lower right corner of the form then the size grip will appear.

Contnrs.pas

Last and First have been added to TObjectList, TComponentList and TClassList.

These are typecast functions.

TNamedObjectList, TNamedComponentList and TNamedClassList have been added. These

are binary sorted lists that work similarly to TStringList.

TStack, TQueue, TObjectStack and TObjectQueue's Push is now a function that

simply returns the item pushed on to the stack. Think of it as a Push/Peek. This

is very useful when pushing things that are created when pushed.

Forms.pas

AutoDragDocking support has been added. This allows you to turn off auto-docking

for your application. Additionally a flag has been added to Delphi's options

dialog that allows you to set this property.

Graphics.pas

TFontRecall, TPenRecall and TBrushRecall have been added. These allow quick

saving off and restoring of fonts, pens and brushes. They descend from TRecall

(from Classes) which works with TPersistent classes in general.

The system colors have been have sorted to make things easier to find.

Four colors have been added to the standard sixteen:

clMoneyGreen

clSkyBlue

clCream

clMedGray

Masks.pas

EditMask and Text now use custom types so their property editors are more

useful.

Printer.pas

Added procedure MetaPrint(APopulate: TMetaPopulateProc; const AHeaderCaption:

string; APrintHeader, APrintBorders, APrintToSingle: Boolean; AProgress:

TMetaProgressProc; AFont: TFont);

This function wraps the printing of data to a meta file. It handles multi-page

printing as well as caption and border printing. Support for progress updating

(via a call back) and custom font are also included.

TypInfo.pas

It is now safe to call GetPropInfo with an object that does not have any RTTI

information. It simply returns a nil.

FreeAndNilProperties has been added. This will take any RTTI enabled object and

free and nil out each of its object properties. Note that it will also clear any

objects this object may have property references to, so nil those out first.

Database

Modifications have been made to accommodate the new object treeview.

More try..finally(s) have been added.

VCL-DB-New Native DB/Midas framework

The connection between the client dataset and the unidirectional dataset is

provided by a dataset provider. Multi-tier Distributed Application Services

Suite (MIDAS). MIDAS defines the mechanism by which provider components package

database information into transportable data packets (which can be used by

client datasets) and apply updates received in delta packets (which client

datasets create) back to a database server.

DBExpress is a set of lightweight database drivers that provide fast access to

SQL database servers. For each supported database, DBExpress provides a driver

that adapts the server-specific software to a set of uniform DBExpress

interfaces. When you deploy your application, you need only include a single DLL

(the server-specific driver) with the application files you build.

Driver File name

 

InterBase driver DBEXPINT.DLL

DB2 Driver DBEXPDB2.DLL

MySQL driver DBEXPMYS.DLL

Each DBExpress connection is encapsulated by a component. TSQLConnection

provides all the information necessary to establish a database connection using

DBExpress, and is designed to work with unidirectional dataset components. A

single SQL connection component can be shared by multiple unidirectional

datasets, or the datasets can each use their own connection.

Unidirectional datasets provide the mechanism by which an application reads data

from an SQL database table. Unidirectional datasets send an SQL command to the

database server, and if the command returns a set of records, obtain a

unidirectional cursor for accessing those records. They do not buffer data in

memory, which makes them faster and less resource-intensive than other types of

dataset. However, because there are no buffered records, unidirectional datasets

are also less flexible than other datasets. Many of the capabilities introduced

by TDataSet are either unimplemented in unidirectional datasets, or cause them

to raise exceptions.

Despite the limitations, unidirectional datasets are a powerful way to access

data. They are fast, and very simple to use and deploy.

The main components of DBExpress include:

  A modified version of TDataset

  TSQLConnection, a wrapper around a DBExpress driver

  TSQLDataset, a unidirectional dataset

  TSQLQuery, TSQLStoredProc, and TSQLTable, which are compatible with existing

elements if you want to port an application

 

Menus

The goal

The main idea is to create a set of classes/components that implement menus

which are easier to create, customize and maintain than the current set of

controls (TMainMenu, TToolbar etc). Additionally, this new system mimic

Microsoft Office 2000 style menus as closely as possible.

The problems

Delphi makes it possible to implement a UI using buttons and menus however, it

is difficult to keep all of these various UI elements in sync. Therefore,

actions were invented to help solve this problem. Now it is possible to point

various controls at an action which manipulates the state of all the controls

attached to it. While this is a marked improvement it is still quite tedious to

create a complicated UI using these components. An example of creating an

application like this is as follows:

1.Drop down an action list

2.Drop down an image list

3.Connect the image list to the action list

4.Drop a TMainMenu

5.Connect the main menu to the image list

6.Build a menu hierarchy connecting each item to an action

At this point, the above steps are repeated for each new menu necessary for the

application. This mechanism as the following drawbacks:

  Actions do not maintain any "layout" information meaning they don't have any

knowledge of where or in what order they should appear in the UI

  Menus and toolbars are very time consuming to setup each requiring the same

number of steps necessary to connect a single item

  Layout information in a main menu cannot be reused to setup a similar set of

toolbars and vise versa

  Customizing both design-time and run-time appearance is very tedious

  Streaming customizations to UI elements has to be done manually

A solution

One way to solve this problem is to develop a mechanism which allows you to

specify layout information and a set of controls which can "render" this

information as UI elements.

In this solution, the following have been developed:

  A mechanism for storing layout (ordering) information for actions

  A set of controls capable of rendering actions (items) on screen (similar to

speedbuttons)

  A set of containers for the above controls (Bands) used to present a

collection of associated items

Since Actions do not maintain any "layout" (either appearance or positional)

information a data structure capable of storing this data is needed. To

accomplish this, a component with a collection property to hold this data called

TBandManager was created.

The Band (Layout) Manager

The Band Manager contains all of the layout information necessary to create

menus. Layout information includes:

  Order of appearance

  Reference to an Action which includes Caption, ShortCut, Visible etc.

  Color

  Background

Additionally, the Band Manager maintains usage data allowing you to hide

infrequently used items of the UI making for a cleaner more effective UI using a

process called aging.

Bands and Band Items

Bands are specialized containers (like TPanel) that render a group of items on

screen in the order specified in the Band Manager. The items themselves are

components (similar to TSpeedButton) created by the Band and appear consistent

with the look and function of the Band (ie. main menu or a toolbar). The layout

of the items in the container is managed automatically and specified by the Band

Manager and the orientation of the Band itself.

Band Manager

The Band Manager is essentially a database of layout and usage information for

all menus within an application. It:

  Specifies the order of items as they should appear in the UI

  Acts as a "database" of usage/customization information

Bands:

  Dockable/sizable windowed controls

  Contain Band Item controls

  Provide methods to find/manipulate contained items

  Allow wrapping of items within their client region

  Persist size/location and dock state

  Support hiding least recently used band items

  Support vertical and horizontal orientation

Menu Bands:

  Provide top-level (main) menu functionality

      Checked menu items

      Grouped menu items

  Provide popup menu functionality

  Support hiding of least recently used items with an option to expand the menu

to view all items (as in Office 2000)

  Support window animations as in Office 2000/W2K (Random, Unfold, Slide)

  Support standard menu sounds

  Support for delayed popup menus

 

 

TList.Assign

Syntax

TList.Assign(ListA: TList; Operation: TListAssignOp = laCopy; ListB: TList =

nil);

Description

By default this copies the contents of a list onto another list, but optionally

a particular operation can be requested. The additional operations are basically

set operations and work similarly to the boolean/set operations of similar

names.

A third syntax is available that takes two lists. In that case the operation is

performed between the specified lists (but their contents are left untouched)

and the result is copied to the instance list. It is the equivalent to the

following code:

Assign(ListA, laCopy);

Assign(ListB, Operation);

Operations

Item Description

 

LaCopy dest becomes a copy of the source (same as a normal assign), dest's

original content is forgotten

LaAnd intersection of the two lists

LaOr union of the two lists

LaXor only those not in both lists

LaSrcUnique only those unique to source (same as laAnd followed by laXor, but

faster)

LaDestUnique only those unique to dest (same as laOr followed by laXor, but

faster)

 

 

TTreeView.MultiSelect

Properties

Access                 Syntax                 Description

 

R/W MultiSelect: Boolean; Turns on/off multi-select

R/W MultiSelectStyle: TMultiSelectStyle; Specifies how multi-select should work.

msControlSelect-Additive selecting is allowed

msShiftSelect-Range selecting is allowed

msVisibleOnly-Only visible nodes can be selected

msSiblingOnly-Only siblings to the primary node can be selected

R SelectionCount: Integer; How many nodes are selected

R Selections[Index: Integer]: TTreeNode Access to the individually selected

nodes

Methods

Public

Select(Node: TTreeNode; ShiftState: TShiftState = []);

This procedure allows you to programmatically select a node and have selection

happen just like the user had clicked on the node.

Public

Subselect(Node: TTreeNode; Validate: Boolean = False);

Allows additive/subtractive sub selection. Optionally you can ask for validation

to happen (which will slow things down a bit).

Public

ClearSelection(KeepPrimary: Boolean = False);

Clears the selections. Optionally you can request that the primary selection be

left selected.

Public

Select(const Nodes: array of TTreeNode);

Selects the first node as the primary selection and then sub-selects the rest.

Public

Select(Nodes: TList)

Same as above but takes a TList of Nodes.

Public

Deselect(Node: TTreeNode)

Deselects a selected node, does nothing if the node is not selected.

Protected

ValidateSelection;

Asks the current selections to validated against the msVisibleOnly and

msSiblingOnly flags.

Protected

InvalidateSelectionsRects;

Requests the selected nodes visual render to be invalidated and in turn redrawn.

Note: if you control-select a selected item, while multi-select is true, that

item becomes unselected visually. While it is also removed from the selections

array, the treeview selected property will be still set to the item. So in this

corner case the selected item is not really selected. This won't cause a problem

in existing code but if you are going to use the new multi-select feature of

treeview, you need to use the selections array, not the simpler selected

property.

Back

New RTL units and features

Some functions have been moved from other units into System, while many System

functions have moved to the new Variants unit.

ConvUtils.pas

A collectionIndl52jth of conversion functions and constants has been added.

DateUtils.pas

A collection.hbixa of date and time functions has been added.

Math.pas

Const has been added to the extended parameters to speed things up. There are

also new constants and functionsm91q9.

StrUtils.pas

This new unit will contain future string functions instead of adding them to

SysUtils.pas.

SysUtils.pas

  Added BoolToStr and StrToBool

  Added FloatToCurr, MinCurrency and MaxCurrency

  Added FloatToDateTime, MinDateTime, and MaxDateTime

Variants.pas and VarUtils.pas

All of the variant/safe array code has been moved from System and now occupies

two new units: Variants.pasC2feahu and VarUtils.pasID_3hz91o.

The operating system dependent code has been isolated into VarUtils.pas and it

also contains generic versions of everything needed by Variants.pas. You have to

be careful using the generic code because it is not exactly like the Windows

code and if you mix Windows calls and generic code you will run into problems.

Use Variants.pas on Windows, use VarUtils.pas on other platforms.

If you want to use variants, you will have to include the Variants unit to your

uses clause.

VarIsEmpty now does a simple test against varEmpty, to see if a variant is clear

(nothing of use defined in it) and you will now need to use the VarIsClear

function.

Custom variant data handler

You can now define custom data types for variants.This introduces operator

overloading while the type is assigned to the variant. To create a new variant

type, descend from the class, TCustomVariantType5h18z0, and instantiate your new

variant type.

For an example, see Complex NumbersInd9yqn1g found in Variants.pas. This unit

implements complex mathematic support via custom variants. It supports the

following variant operations: addition, subtraction, multiplication, division

(not integer division) and negation. It also handles conversion to and from:

SmallInt, Integer, Single, Double, Currency, Date, Boolean, Byte, OleStr and

String. Any of the float/ordinal conversion will lose any imaginary portion of

the complex value.

XMLDOM unit

The XMLDOM.pas unit contains a vendor-independent set of interfaces that

represent the W3C Level 2 XML DOM specification. With this unit you can use the

DOM to manipulate XML documents in a platform-independent manner. Included with

this field test is a unit which exposes the Microsoft DOM via the MSXMLDOM.pas

unit. This unit must also be included in the uses clause of your project. The

TXMLDocument component described in the New VCL section uses the XMLDOM unit,

and is the recommended way of working with the DOM.

 

 

New ConvUtils.pas functions and constants

Distance duMicromicrons, duAngstrom, duMillimicrons, duMicrons, duMillimeters,

duCentimeters, duDecimeters, duMeters, duDekameters, duHectometers,

duKilometers, duMegameters, duGigameters, duInches, duFeet, duYards, duMiles,

duNauticalMiles, duAstromicalUnits, duLightYears, duParsecs, duCubits,

duFathoms, duFurlongs, duHands, duPaces, duRods, duChains, duLinks, duPicas,

duPoints

Velocity Good for any distance unit and any time unit (see DateUtils.pas)

Mass/Weight muNanograms, muMicrograms, muMilligrams, muCentigrams, muDecigrams,

muGrams, muDekagrams, muHectograms, muKilograms, muMetricTon, muDrams, muGrains,

muLongTon, muShortTon, muOunces, muPounds, muStones

Temperature tuCelsius, tuKelvin, tuFahrenheit, tuRankine, tuReaumur

Area auSquareMillimeters, auSquareCentimeters, auSquareDecimeters,

auSquareMeters, auSquareDekameters, auSquareHectometers, auSquareKilometers,

auSquareInches, auSquareFeet, auSquareYards, auSquareMiles, auAcres, auCentares,

auAres, auHectares, auSquareRods

Volume vuCubicMillimeters, vuCubicCentimeters, vuCubicDecimeters, vuCubicMeters,

vuCubicDekameters, vuCubicHectometers, vuCubicKilometers, vuCubicInches,

vuCubicFeet, vuCubicYards, vuCubicMiles, vuMilliliter, vuCentiliter,

vuDeciliter, vuLiter, vuDekaliter, vuHectoliter, vuKiloliter, vuAcreFeet,

vuAcreInches, vuCords, vuCordFeet, vuDecisteres, vuDekasteres, vuSteres,

vuTeaspoons, vuTablespoons, vuOunces, vuCups, vuPints, vuQuarts, vuGallons

Unit Interface

{ Distance conversion function and types }

type

  TDistanceUnits = (duMicromicrons, duAngstrom, duMillimicrons,

                    duMicrons, duMillimeters, duCentimeters,

                    duDecimeters, duMeters, duDekameters,

                    duHectometers, duKilometers, duMegameters,

                    duGigameters, duInches, duFeet, duYards, duMiles,

                    duNauticalMiles, duAstromicalUnits, duLightYears,

                    duParsecs, duCubits, duFathoms, duFurlongs,

                    duHands, duPaces, duRods, duChains, duLinks,

                    duPicas, duPoints);

const

  BaseDistanceUnit = duMeters;

function ConvertDistance(AFrom, ATo: TDistanceUnits;

  const AValue: Double): Double;

{ Velocity conversion function and types }

function ConvertVelocity(AFrom: TDistanceUnits; AFromTime: TTimeUnits;

  ATo: TDistanceUnits; AToTime: TTimeUnits; const AValue: Double): Double;

{ Mass/Weight conversion function and types }

type

  TMassUnits = (muNanograms, muMicrograms, muMilligrams,

                muCentigrams, muDecigrams, muGrams, muDekagrams,

                muHectograms, muKilograms, muMetricTon, muDrams,

                muGrains, muLongTon, muShortTon, muOunces, muPounds,

                muStones);

const

  BaseMassUnit = muGrams;

function ConvertMass(AFrom, ATo: TMassUnits; const AValue: Double): Double;

{ Temperature conversion function and types }

type

  TTemperatureUnits = (tuCelsius, tuKelvin, tuFahrenheit, tuRankine,

tuReaumur);

const

  BaseTemperatureUnit = tuCelsius;

function ConvertTemperature(AFrom, ATo: TTemperatureUnits; const AValue:

Double): Double;

{ Area conversion function and types }

type

  TAreaUnits = (auSquareMillimeters, auSquareCentimeters,

                auSquareDecimeters, auSquareMeters,

                auSquareDekameters, auSquareHectometers,

                auSquareKilometers, auSquareInches, auSquareFeet,

                auSquareYards, auSquareMiles, auAcres, auCentares,

                auAres, auHectares, auSquareRods);

const

  BaseAreaUnit = auSquareMeters;

function ConvertArea(AFrom, ATo: TAreaUnits; const AValue: Double): Double;

{ Volume conversion function and types }

type

  TVolumeUnits = (vuCubicMillimeters, vuCubicCentimeters,

                  vuCubicDecimeters, vuCubicMeters,

                  vuCubicDekameters, vuCubicHectometers,

                  vuCubicKilometers, vuCubicInches, vuCubicFeet,

                  vuCubicYards, vuCubicMiles, vuMilliliter,

                  vuCentiliter, vuDeciliter, vuLiter, vuDekaliter,

                  vuHectoliter, vuKiloliter, vuAcreFeet,

                  vuAcreInches, vuCords, vuCordFeet, vuDecisteres,

                  vuDekasteres, vuSteres, vuTeaspoons, vuTablespoons,

                  vuOunces, vuCups, vuPints, vuQuarts, vuGallons);

{ the last 7 unit factors are adjustable, see below }

const

  BaseVolumeUnit = vuKiloLiter;

function ConvertVolume(AFrom, ATo: TVolumeUnits; const AValue: Double): Double;

{ TVolumnFactors record contains the English/American unit conversion

 factors. Initially the volume conversion functions use American

 fluid units but you can change all the factors if you need something

 different. Remember these factors are designed to convert the

 specific unit to a kiloliter not a liter.

 UseAmericanFluidVolumeFactors and UseBritishImperialVolumeFactors

 Will set up the volume factors for you but if needed you can call

 UseSpecificVolumnFactors which will copy your conversion factors out

 of the given structure to the one used by ConvertVolume. }

type

  TVolumeFactors = record

    Teaspoons, Tablespoons, Ounces, Cups, Pints, Quarts, Gallons:

    Double;

  end;

const

  AmericanFluidVolumeFactors: TVolumeFactors = (

    Teaspoons:   4.92892E-6; Tablespoons: 1.47868E-5;

    Ounces:      2.95735E-5; Cups:        2.36588E-4;

    Pints:       4.73177E-4; Quarts:      9.46353E-4;

    Gallons:     3.78541E-3);

ImperialFluidVolumeFactors: TVolumeFactors = (

    Teaspoons:   4.92892E-6; Tablespoons: 1.47868E-5;

    Ounces:      2.84131E-5; Cups:        2.84122E-4;

    Pints:       5.68245E-4; Quarts:      1.13649E-3;

        Gallons:     4.54609E-3);

procedure UseAmericanFluidVolumeFactors;

procedure UseBritishImperialVolumeFactors;

procedure UseSpecificVolumeFactors(const AUnits: TVolumeFactors);

{ These two functions are used by ConvertTemperature internally but

 are rather useful in their own right. }

function FahrenheitToCelsius(const AValue: Double): Double;

function CelsiusToFahrenheit(const AValue: Double): Double;

{ Constants (and their derivatives) used in this unit }

const

  MetersPerLightSecond = 299792558;

  MetersPerInch = 0.0254;

  MetersPerFoot = MetersPerInch * 12;

  MetersPerYard = MetersPerFoot * 3;

  MetersPerMile = MetersPerFoot * 5280;

  MetersPerNauticalMiles = 1852;

  MetersPerAstromicalUnit = 1.4959787E+11;

  MetersPerLightYear = ApproxDaysPerYear * SecsPerDay *

    MetersPerLightSecond;

  MetersPerParsec = MetersPerAstromicalUnit * 206264.8062471; // 60 *

    60 * (180 / Pi)

  MetersPerCubit = 0.4572;

  MetersPerFathom = MetersPerFoot * 6;

  MetersPerFurlong = MetersPerYard * 220;

  MetersPerHand = MetersPerInch * 4;

  MetersPerPace = MetersPerInch * 30;

  MetersPerRod = MetersPerFoot * 16.5;

  MetersPerChain = MetersPerRod * 4;

  MetersPerLink = MetersPerChain / 100;

  MetersPerPoint = MetersPerInch * 0.01384;

  MetersPerPica = MetersPerPoint * 12;

  SquareMetersPerSquareInch = MetersPerInch * MetersPerInch;

  SquareMetersPerSquareFoot = MetersPerFoot * MetersPerFoot;

  SquareMetersPerSquareYard = MetersPerYard * MetersPerYard;

  SquareMetersPerSquareMile = MetersPerMile * MetersPerMile;

  SquareMetersPerAcre = SquareMetersPerSquareYard * 4840;

  SquareMetersPerSquareRod = MetersPerRod * MetersPerRod;

  CubicMetersPerCubicInch = MetersPerInch * MetersPerInch *

    MetersPerInch;

  CubicMetersPerCubicFoot = MetersPerFoot * MetersPerFoot *

    MetersPerFoot;

  CubicMetersPerCubicYard = MetersPerYard * MetersPerYard *

    MetersPerYard;

  CubicMetersPerCubicMile = MetersPerMile * MetersPerMile *

    MetersPerMile;

  CubicMetersPerAcreFoot = SquareMetersPerAcre * MetersPerFoot;

  CubicMetersPerAcreInch = SquareMetersPerAcre * MetersPerInch;

  CubicMetersPerCord = CubicMetersPerCubicFoot * 128;

  CubicMetersPerCordFoot = CubicMetersPerCubicFoot * 16;

  // avoirdupois units

  GramsPerDram = 1.7718451953125;

  GramsPerGrain = 0.06479891;

  GramsPerLongTon = 1016046.9088;

  GramsPerShortTon = 907184.74;

  GramsPerOunces = 28.349523125;

  GramsPerPounds = 453.59237;

  GramsPerStones = 6350.29318;

created with Help to RTF file format converter

 

 

New DateUtils.pas functions

Unit Interface

Time conversion function and types:

type

TTimeUnits = (tuMilliSeconds, tuSeconds, tuMinutes, tuHours, tuDays, tuWeeks,

tuFortnights, tuMonths, tuYears, tuDecades, tuCenturies, tuMillenia);

const

BaseTimeUnit = tuDays;

function ConvertTime(AFrom: TTimeUnits; ATo: TTimeUnits; const AValue: Double):

Double;

Constants used in this unit:

const

(Average days per month/year over a normal 4 year period, see below.)

ApproxDaysPerYear = 365.25;

ApproxDaysPerMonth = 30.4375;

The above are used internally because they are more accurate for the next

century or so but after that you will want to switch to these values.

They are average days per month/year over a 400 year period.

ApproxDaysPerYear = 365.2425;

ApproxDaysPerMonth = 30.436875;

Note that the second month (February) should have 29 days during a leap year.

Remember to add a day when doing month/day calculations.

DaysPerMonth: array[1..12] of Integer = (31, 28, 31, 30,

                                        31, 30, 31, 31,

                                        30, 31, 30, 31);

DaysPerWeek = 7;

DaysPerFortnight = DaysPerWeek * 2;

ApproxDaysPerDecade = ApproxDaysPerYear * 10.0;

ApproxDaysPerCentury = ApproxDaysPerYear * 100.0;

ApproxDaysPerMillenium = ApproxDaysPerYear * 1000.0;

//===================================================================

function DateOf(const AValue: TDateTime): TDateTime;

function TimeOf(const AValue: TDateTime): TDateTime;

//==================================================================

function IsInLeapYear(const AValue: TDateTime): Boolean;

function IsPM(const AValue: TDateTime): Boolean;

function DaysInYear(const AValue: TDateTime): Integer;

function DaysInAYear(const AYear: Integer): Integer;

function DaysInMonth(const AValue: TDateTime): Integer;

function DaysInAMonth(const AYear, AMonth: Integer): Integer;

//==================================================================

function YearOf(const AValue: TDateTime): Integer;

function MonthOf(const AValue: TDateTime): Integer;

function WeekOf(const AValue: TDateTime): Integer;

function DayOf(const AValue: TDateTime): Integer;

function HourOf(const AValue: TDateTime): Integer;

function MinuteOf(const AValue: TDateTime): Integer;

function SecondOf(const AValue: TDateTime): Integer;

function MilliSecondOf(const AValue: TDateTime): Integer;

//==================================================================

function StartOfYear(const AValue: TDateTime): TDateTime;

function EndOfYear(const AValue: TDateTime): TDateTime;

function StartOfMonth(const AValue: TDateTime): TDateTime;

function EndOfMonth(const AValue: TDateTime): TDateTime;

function StartOfWeek(const AValue: TDateTime): TDateTime;

function EndOfWeek(const AValue: TDateTime): TDateTime;

function StartOfDay(const AValue: TDateTime): TDateTime;

function EndOfDay(const AValue: TDateTime): TDateTime;

//==================================================================

function MonthOfYear(const AValue: TDateTime): Integer;

function WeekOfYear(const AValue: TDateTime): Integer;

function DayOfYear(const AValue: TDateTime): Integer;

function HourOfYear(const AValue: TDateTime): Integer;

function MinuteOfYear(const AValue: TDateTime): Integer;

function SecondOfYear(const AValue: TDateTime): Integer;

function MilliSecondOfYear(const AValue: TDateTime): Int64;

//=================================================================

function WeekOfMonth(const AValue: TDateTime): Integer;

function DayOfMonth(const AValue: TDateTime): Integer;

function HourOfMonth(const AValue: TDateTime): Integer;

function MinuteOfMonth(const AValue: TDateTime): Integer;

function SecondOfMonth(const AValue: TDateTime): Integer;

function MilliSecondOfMonth(const AValue: TDateTime): Int64;

//=================================================================

//function DayOfWeek(const AValue: TDateTime): Integer; IS FOUND IN SYSUTILS

function HourOfWeek(const AValue: TDateTime): Integer;

function MinuteOfWeek(const AValue: TDateTime): Integer;

function SecondOfWeek(const AValue: TDateTime): Integer;

function MilliSecondOfWeek(const AValue: TDateTime): Integer;

//=================================================================

function HourOfDay(const AValue: TDateTime): Integer;

function MinuteOfDay(const AValue: TDateTime): Integer;

function SecondOfDay(const AValue: TDateTime): Integer;

function MilliSecondOfDay(const AValue: TDateTime): Integer;

//=================================================================

function MinuteOfHour(const AValue: TDateTime): Integer;

function SecondOfHour(const AValue: TDateTime): Integer;

function MilliSecondOfHour(const AValue: TDateTime): Integer;

//=================================================================

function SecondOfMinute(const AValue: TDateTime): Integer;

function MilliSecondOfMinute(const AValue: TDateTime): Integer;

//=================================================================

function MilliSecondOfSecond(const AValue: TDateTime): Integer;

//=================================================================

function WithinPastYears(const ANow, AThen: TDateTime; const AYears: Integer):

Boolean;

function WithinPastMonths(const ANow, AThen: TDateTime; const AMonths: Integer):

Boolean;

function WithinPastWeeks(const ANow, AThen: TDateTime; const AWeeks: Integer):

Boolean;

function WithinPastDays(const ANow, AThen: TDateTime; const ADays: Integer):

Boolean;

function WithinPastHours(const ANow, AThen: TDateTime; const AHours: Int64):

Boolean;

function WithinPastMinutes(const ANow, AThen: TDateTime; const AMinutes: Int64):

Boolean;

function WithinPastSeconds(const ANow, AThen: TDateTime; const ASeconds: Int64):

Boolean;

function WithinPastMilliSeconds(const ANow, AThen: TDateTime; const

AMilliSeconds: Int64): Boolean;

//=================================================================

function YearsBetween(const ANow, AThen: TDateTime): Integer;

function MonthsBetween(const ANow, AThen: TDateTime): Integer;

function WeeksBetween(const ANow, AThen: TDateTime): Integer;

function DaysBetween(const ANow, AThen: TDateTime): Integer;

function HoursBetween(const ANow, AThen: TDateTime): Int64;

function MinutesBetween(const ANow, AThen: TDateTime): Int64;

function SecondsBetween(const ANow, AThen: TDateTime): Int64;

function MilliSecondsBetween(const ANow, AThen: TDateTime): Int64;

//=================================================================

// YearSpan and MonthSpan are approximates, not exact but close

function YearSpan(const ANow, AThen: TDateTime): Double;

function MonthSpan(const ANow, AThen: TDateTime): Double;

function WeekSpan(const ANow, AThen: TDateTime): Double;

function DaySpan(const ANow, AThen: TDateTime): Double;

function HourSpan(const ANow, AThen: TDateTime): Double;

function MinuteSpan(const ANow, AThen: TDateTime): Double;

function SecondSpan(const ANow, AThen: TDateTime): Double;

function MilliSecondSpan(const ANow, AThen: TDateTime): Double;

//================================================================

function EncodeDateTime(const AYear, AMonth, ADay, AHour, AMinute, ASecond,

AMilliSecond: Integer): TDateTime;

function RecodeDateYear(const AValue: TDateTime; const AYear: Integer):

TDateTime;

function RecodeDateMonth(const AValue: TDateTime; const AMonth: Integer):

TDateTime;

function RecodeDateDay(const AValue: TDateTime; const ADay: Integer): TDateTime;

function RecodeDateHour(const AValue: TDateTime; const AHour: Integer):

TDateTime;

function RecodeDateMinute(const AValue: TDateTime; const AMinute: Integer):

TDateTime;

function RecodeDateSecond(const AValue: TDateTime; const ASecond: Integer):

TDateTime;

function RecodeDateMilliSecond(const AValue: TDateTime;

const AMilliSecond: Integer): TDateTime;

//==================================================================

function SpanOfNowAndThen(const ANow, AThen: TDateTime): TDateTime;

function IsNullDateTime(const AValue: TDateTime): Boolean;

function NullDateTime: TDateTime;

 

 

New Math.pas functions and constants

New constants

 

NaN Not a number

Infinity Positive infinity

NegInfinity Negative infinity

New trig functions

 

Secant 1 / Cos(X)

Cosecant 1 / Sin(X)

Cot short for Cotan(gent)

Sec short for Secant

Csc short for Cosecant

CotH Hyperbolic Cotangent

SecH Hyperbolic Secant

CscH Hyperbolic Cosecant

ArcCot Inverse Cotanget

ArcSec Inverse Secant

ArcCsc Inverse Cosecant

ArcCotH Inverse Hyperbolic Cotangent

ArcSecH Inverse Hyperbolic Secant

ArcCscH Inverse Hyperbolic Cosecant

Other functions

 

IfThen defined for Integer, Int64 and Double

IsNaN is the value passed in actually equal to NaN

IsInfinite is the value passed in actually equal to Infinity

Sign returns -1, 0 or 1 depending on the sign of the passed in value, defined

for Integer, Int64 and Double

RandomRange similar to Random but allows a range (Min >= Result < Max) instead

of simply being (0>=Result  Dynamic Arrays }

procedure DynArrayToVariant(var V: Variant; const DynArray: Pointer; TypeInfo:

Pointer);

procedure DynArrayFromVariant(var DynArray: Pointer; const V: Variant; TypeInfo:

Pointer);

{ Global constants }

function Unassigned: Variant; // Unassigned standard constant

function Null: Variant; // Null standard constant

function EmptyParam: OleVariant; // passed as an optional parameter on a dual

interface.

 

 

VarUtils.pas

function VariantInit(var V: TVarData): HRESULT; stdcall;

function VariantClear(var V: TVarData): HRESULT; stdcall;

function VariantCopy(var Dest: TVarData; const Source: TVarData): HRESULT;

stdcall;

function VariantCopyInd(var Dest: TVarData; const Source: TVarData): HRESULT;

stdcall;

function VariantChangeTypeEx(var Dest: TVarData; const Source: TVarData; LCID:

Integer;

  Flags: Word; VarType: Word): HRESULT; stdcall;

function SafeArrayCreate(VarType, DimCount: Integer; const Bounds:

TVarArrayBoundArray): PVarArray; stdcall;

function SafeArrayAllocDescriptor(DimCount: Integer; out VarArray: PVarArray):

HRESULT; stdcall;

function SafeArrayAllocData(VarArray: PVarArray): HRESULT; stdcall;

function SafeArrayDestroy(VarArray: PVarArray): HRESULT; stdcall;

function SafeArrayDestroyDescriptor(VarArray: PVarArray): HRESULT; stdcall;

function SafeArrayDestroyData(VarArray: PVarArray): HRESULT; stdcall;

function SafeArrayRedim(VarArray: PVarArray; const NewBound: TVarArrayBound):

HRESULT; stdcall;

function SafeArrayCopy(SourceArray: PVarArray; out TargetArray: PVarArray):

HRESULT; stdcall;

function SafeArrayCopyData(SourceArray, TargetArray: PVarArray): HRESULT;

stdcall;

function SafeArrayGetLBound(VarArray: PVarArray; Dim: Integer; out LBound:

Integer): HRESULT; stdcall;

function SafeArrayGetUBound(VarArray: PVarArray; Dim: Integer; out UBound:

Integer): HRESULT; stdcall;

function SafeArrayGetDim(VarArray: PVarArray): Integer; stdcall;

function SafeArrayAccessData(VarArray: PVarArray; out Data: Pointer): HRESULT;

stdcall;

function SafeArrayUnaccessData(VarArray: PVarArray): HRESULT; stdcall;

function SafeArrayLock(VarArray: PVarArray): HRESULT; stdcall;

function SafeArrayUnlock(VarArray: PVarArray): HRESULT; stdcall;

function SafeArrayGetElement(VarArray: PVarArray; Indices: PVarArrayCoorArray;

 out Data: Pointer): HRESULT; stdcall;

function SafeArrayPutElement(VarArray: PVarArray; Indices: PVarArrayCoorArray;

 const Data: Pointer): HRESULT; stdcall;

function SafeArrayPtrOfIndex(VarArray: PVarArray; Indices: PVarArrayCoorArray;

 var Address: Pointer): HRESULT; stdcall;

function SafeArrayGetElemSize(VarArray: PVarArray): LongWord; stdcall;

 

 

TCustomVariantType

TCustomVariantType = class(TObject)

protected

 function CustomVariantTypeFor(const VarType: Word; out CustomVariantType:

TCustomVariantType): Boolean; overload;

 function CustomVariantTypeFor(const V: TVarData; out CustomVariantType:

TCustomVariantType): Boolean; overload;

function LeftPromotion(const V: TVarData; const Operator: Integer; out

RequiredVarType: TVarType): Boolean; virtual;

 function RightPromotion(const V: TVarData; const Operator: Integer; out

RequiredVarType: TVarType): Boolean; virtual;

function DispInvoke(var Dest: TVarData; const Source: TVarData; CallDesc:

PCallDesc; Params: Pointer): HRESULT; virtual;

function SimplisticClear(var V: TVarData): HRESULT;

 function SimplisticCopy(var Dest: TVarData; const Source: TVarData): HRESULT;

property State: TVarDataState read FState;

 procedure VarDataInit(var Dest: TVarData);

 procedure VarDataClear(var Dest: TVarData);

 procedure VarDataCopy(var Dest: TVarData; const Source: TVarData);

 procedure VarDataCopyNoInd(var Dest: TVarData; const Source: TVarData);

 procedure VarDataCast(var Dest: TVarData; const Source: TVarData);

 procedure VarDataCastTo(var Dest: TVarData; const Source: TVarData; const

VarType: TVarType);

function VarDataIsByRef(const V: TVarData): Boolean;

 function VarDataIsArray(const V: TVarData): Boolean;

 function VarDataSimpleType(const V: TVarData): TVarType;

public

 constructor Create; overload;

 constructor Create(RequestedVarType: Word); overload;

 destructor Destroy; override;

 property VarType: TVarType read FVarType;

function Clear(var V: TVarData): HRESULT; virtual; abstract;

 function IsClear(var V: TVarData): Boolean; virtual;

 function Copy(var Dest: TVarData; const Source: TVarData; const Indirect:

Boolean): HRESULT; virtual; abstract;

 function Cast(var Dest: TVarData; const Source: TVarData): HRESULT; virtual;

 function CastTo(var Dest: TVarData; const Source: TVarData; const VarType:

TVarType): HRESULT; virtual; abstract;

 function CastOle(var Dest: TVarData; const Source: TVarData; const VarType:

TVarType): HRESULT; virtual;

 function FindBestType(const Right: TVarData; const Operator: Integer):

TVarType; virtual;

function BinaryOp(var Left: TVarData; const Right: TVarData; const Operator:

Integer): HRESULT; virtual;

 function UnaryOp(var Right: TVarData; const Operator: Integer): HRESULT;

virtual;

 function CompareOp(const Left, Right: TVarData; var Relationship:

TVarCompareResult): HRESULT; virtual;

function GetProperty(var Dest: TVarData; const Source, Name: TVarData; const

Params: array of TVarData): HRESULT; virtual;

 function SetProperty(const Source, Name, Value: TVarData; const Params: array

of TVarData): HRESULT; virtual;

 function Invoke(var Dest: TVarData; const Source, Name: TVarData; const

Params: array of TVarData): HRESULT; virtual;

function DataToBytes(const Source: TVarData; var Address: Pointer; var Size:

Cardinal): HRESULT; virtual;

 function DataFromBytes(var Dest: TVarData; const Address: Pointer; const Size:

Cardinal): HRESULT; virtual;

end;

 

 

Complex Numbers

{ Complex variant creation utils }

function VarComplexCreate: Variant; overload;

function VarComplexCreate(const AReal: Double): Variant; overload;

function VarComplexCreate(const AReal, AImaginary: Double): Variant; overload;

procedure VarComplexCreate(var aDest: Variant; const AReal, AImaginary: Double);

overload;

function VarIsComplex(const aValue: Variant): Boolean;

function VarAsComplex(const aValue: Variant): Variant;

function VarComplexSimplify(const aValue: Variant): Variant;

{ Complex variant support }

function VarComplexAbsSqr(const aValue: Variant): Double;

function VarComplexAbs(const aValue: Variant): Double;

function VarComplexAngle(const aValue: Variant): Double;

function VarComplexConjugate(const aValue: Variant): Variant;

function VarComplexInverse(const aValue: Variant): Variant;

function VarComplexExp(const aValue: Variant): Variant;

function VarComplexLn(const aValue: Variant): Variant;

function VarComplexSqr(const aValue: Variant): Variant;

function VarComplexSqrt(const aValue: Variant): Variant;

function VarComplexTimesPosI(const aValue: Variant): Variant;

function VarComplexTimesNegI(const aValue: Variant): Variant;

function VarComplexPower(const aValue, aPower: Variant): Variant;

{ Complex variant trig support }

function VarComplexCos(const aValue: Variant): Variant;

function VarComplexSin(const aValue: Variant): Variant;

function VarComplexTan(const aValue: Variant): Variant;

function VarComplexCot(const aValue: Variant): Variant;

function VarComplexSec(const aValue: Variant): Variant;

function VarComplexCsc(const aValue: Variant): Variant;

function VarComplexArcCos(const aValue: Variant): Variant;

function VarComplexArcSin(const aValue: Variant): Variant;

function VarComplexArcTan(const aValue: Variant): Variant;

function VarComplexArcCot(const aValue: Variant): Variant;

function VarComplexArcSec(const aValue: Variant): Variant;

function VarComplexArcCsc(const aValue: Variant): Variant;

function VarComplexCosH(const aValue: Variant): Variant;

function VarComplexSinH(const aValue: Variant): Variant;

function VarComplexTanH(const aValue: Variant): Variant;

function VarComplexCotH(const aValue: Variant): Variant;

function VarComplexSecH(const aValue: Variant): Variant;

function VarComplexCscH(const aValue: Variant): Variant;

function VarComplexArcCosH(const aValue: Variant): Variant;

function VarComplexArcSinH(const aValue: Variant): Variant;

function VarComplexArcTanH(const aValue: Variant): Variant;

function VarComplexArcCotH(const aValue: Variant): Variant;

function VarComplexArcSecH(const aValue: Variant): Variant;

function VarComplexArcCscH(const aValue: Variant): Variant;

Back

 

New compiler features

$IFDEF enhancement

New $IF directive with constant expression evaluation. For example:

{$IF Defined(WIN32) and (SomeConst > 12.0) }

...

{$ENDIF}

Pascal constant identifiers can be evaluated in $IF directives. Existence of a

conditional define symbol ($IFDEF) can be tested with the Defined() intrinsic

function, and existence of a Pascal constant identifier symbol can be tested

with the Declared() intrinsic function.

For example:

{$IF  Defined(WIN32) and Declared(MyConst)}

...

{$ENDIF}

New Built-in Assembler

The product now has a completely new built-in assembler with:

  New directives, VMTOFFSET and DMTOFFSET

  New instruction support: MMX, SIMD, Pentium Pro

  New support for DQ (define quadword data) and DT (define ten byte data)

pseudo-opcodes.

 

Back

New COM/Active X features

Registration/installation of COM configuration attributes

You can now set COM+ attributes to new COM objects.

Event Object Wizard

A new COM+ event wizard lets you create COM+ event objects. (You must still add

code manually to fire events or client code to respond to events.)

Implementing existing interfaces (Professional and Enterprise editions)

You can now use the COM object wizard to generate a server object for an

arbitrary interface that is in a type library registered on your system.

Previously, that wizard always implemented a newly created interface (descending

from IUnknown). Now, the COM object wizard also lets you select an interface

from any registered type library. The COM object wizard creates the type library

information for a CoClass to implement that interface, as well as an

implementation class with skeletal methods for you to fill in to complete the

implementation. The implementation class inherits an implementation of IUnknown

and IDispatch methods.

Transaction Objects (MTS Wizard replacement)

Transactional objects can now be created using the Professional edition.

Previously, MTS support was limited to the Enterprise edition.

Dual MTS/COM+ support for transactional objects

The MTS object wizard has been replaced by a transactional object wizard, which

creates objects that can be used with either COM+ or MTS.

 

 

 

Additional new Internet features

Apache configuration

WebBroker supports Apache version 1.3.9 and later.

To run the CgiServer demo, create a script directory named "scripts" that points

to the physical directory in which the CGI executable is located. To do this,

add the following line to the httpd.conf file:

 ScriptAlias /scripts/ "//httpd/cgi-bin/"

where  is the full path to the directory in which Apache is

installed. Do not omit the trailing slash.

Next, verify that the physical directory has the ExecCGI option set to allow

execution of programs; httpd.conf should contain lines similar to the following:

 

    AllowOverride None

    Options ExecCGI

   Order allow,deny

   Allow from all

 

To run the Apache Application:

1  Copy the ApServer.dll to the apache modules directory

2  Add the following lines to the Apache configuration file (http.conf):

 # Loads the application module.

 LoadModule apserver_module modules/apserver.dll

 # Defines handler for the "scripts" alias

 

 SetHandler webbroker-apserver

 

For other problems, check the Apache error_log file.

TTCPClient and TTCPServer

TcpClient and TcpServer implement the TCP/IP SOCK_STREAM socket type. In this

field test, the server uses a single thread to sequentially dispatch incoming

connections and avoid blocking the main thread; the release version will

implement multiple threads for this purpose.

 

created with Help to RTF file format converter

 

 

New DBExpress features

DBExpress provides lightweight, native SQL drivers (SQL Objects). This field

test includes new drivers for InterBase and MySQL.

  The InterBase driver has been tested with InterBase version 5.6, which is

included on the field test CD. (For information about InterBase 6.0, see

http://www.interbase.com.)

  The MySQL driver has been tested with MySQL version 3.22.32.

The new drivers use TSQLConnection to manage database connections.

When you install, two registry settings are used from

HKEY_CURRENT_USER\SOFTWARE\BORLAND\DBEXPRESS:

    Driver Registry File (the drivers.ini)

    Connection Registry File (the connections.ini)

Before working with these drivers, you will need to set up the connections.ini

file so that it contains valid settings for the database you are using. You can

accomplish this from the TSQLConnection property editor: Drop a TSQLConnection

object from the DBExpress page, double click on it, and then change the

connection properties as required. For example, if you are using InterBase, the

[IBLocal] section must contain a path to a .gdb file to which you have write

access, a valid user name, and a valid password. You can test the connection by

hitting the connect icon, or by setting Connected to True.

New dataset components include TSQLDataSet, TSQLStoredProc, and TSQLQuery. These

are unidirectional, read-only components that provide fast access to large

amounts of data but don't allow buffering or updating. For buffering and

read-write functionality, use a local client dataset.

Known issues and problems with SqlExpress components

  InterBase ARRAY type is not supported.

  With InterBase 6.0 basic data access works. But none of the InterBase 6.0

features are surfaced in the InterBase driver.

  MySQL driver parameter binding of

CHAR[M] BINARY and VARCHAR[M] > BINARY

is not supported.

  The DB2 driver is not yet supported.

 

                       

  Long VARCHAR fields (greater than 8K) are supported by DBExpress. However,

there is a known problem using VARCHAR fields with MIDAS.

 

 

Compatibility issues

Provider, client dataset events affected by VCL hierarchy change

The introduction of TCustomClientDataSet requires changes to event handlers in

Delphi 5 and earlier code.

Six events in five types are affected by the change to DBCLIENT.PAS. They are:

     Type Event/change

     TResolverErrorEvent Affects the provider's OnUpDateError event.

     TBeforeUpdateRecordEvent Affects the provider's BeforeUpdateRecord event.

     TAfterUpdateRecordEvent Affects the provider's AfterUpdateRecord event.

     TProviderDataEvent Affects the provider's OnGetData and OnUpdateData

     events.

     TReconcileErrorEvent Affects the client dataset's OnReconcileError event

In event handlers using the events noted above, you must replace TClientDataSet

with TCustomClientDataSet.