Professional Documents
Culture Documents
ON THE COVER
5 First Look 26 Dynamic Delphi
It’s Kylix! — Cary Jensen, Ph.D. ISAPI Development: Part III — Shiv Kumar
Cary Jensen unveils Borland’s “Delphi for Linux” product. Is it Linux’ Shiv Kumar completes his series by demonstrating how to efficiently
“killer app?” Only time will tell, but to date, there’s certainly no deliver graphics to a Web browser, including how to reduce their size
Linux-based IDE remotely as productive. and bandwidth requirements on the fly.
combit GmbH
Price: Full developer version including
unlimited run-time license, US$490; Visual
Basic-only or Delphi-only version, US$350.
Contact: sales@combit.net
Web Site: http://www.combit.net
It’s Kylix!
Borland Ships the First RAD Tool for Linux
S ince September of 1999, when Borland announced they would produce a version
of Delphi for the Linux operating system, Kylix (the project’s code name and
now its shipping name) has been one of the most anticipated products in Borland’s
history. Now the long wait is over. By the time you read this, Kylix will be available
to developers everywhere.
Originally, the Kylix project was reported to So what exactly is Kylix, and who is likely to use
include both Delphi for Linux and C++Builder it? This article will attempt to answer these ques-
for Linux. However, the latest word from Borland tions, and more. Note, however, that the following
marketing is that the name Kylix will apply to the descriptions are based on a pre-release version of
Pascal flavor of the product, with another name Kylix. Screen images and features of the shipping
being used for the one that uses C++. That ver- version of this product may differ.
sion, by the way, is scheduled to be released some
time later this year. Overview
To put it simply, Kylix is a version of Delphi that
runs on Linux. Anyone who might have worked
with a product that has been developed to run on
two or more operating systems might be a little
skeptical about this statement (remember Paradox
for DOS and Paradox for Windows), but in this
case, it’s true. Over the past half year I have partici-
pated in a number of conferences and seminars
where Delphi developers got a good look at pre-
release versions of Kylix. The most frequent com-
ment I’ve heard is a surprised “Hey, that’s Delphi!”
The Qt libraries, which were also used to program the KDE This unit name distinction is particularly beneficial when you
desktop, have several characteristics that make them a sound choice are writing a single-source application that makes use of CLX
for CLX. First, the Qt visual classes, called “widgets,” map very on Linux and the VCL on Windows. In short, using conditional
nicely to the visual controls subclassed by Delphi’s VCL. Specifi- defines you can instruct the compiler to use the units whose
cally, Qt widgets and Windows controls share a large number of classes are appropriate for the platform for which you’re compil-
similar properties. Likewise, they share a number of comparable ing. In fact, Kylix includes the conditional symbol LINUX, which
events, although these are implemented in Qt through signals and is automatically defined when you are compiling with Kylix. You
slots, using Qt nomenclature. As a result, many of the classes in typically use this symbol with the new MSWINDOWS symbol,
CLX are immediately recognizable to Delphi developers, thereby which is reportedly going to be automatically defined in Delphi
reducing the number of changes necessary to convert VCL applica- 6. The following is an example of how these conditional symbols
tions to CLX. can be used:
example, the integrated debugger in Kylix is almost indistinguishable which WebBroker permits developers to create Web server exten-
from that found in the Windows version. Likewise, Kylix includes sions, Kylix will immediately become one of the tools of choice for
nearly all of the configuration dialog boxes and windows supported creating dynamic, data-aware Web sites residing on Linux servers.
by Delphi 5 for configuring and examining both projects and the
development environment. For example, Figure 3 shows the Project Another group likely to be early adopters are those developers
Options dialog box, which you use to define the setting used for interested in building end-user applications for Linux desktop
compiling your applications. You display this dialog box by selecting workstations. Again, Kylix’s RAD tools and powerful support
Project | Options, just as you do in Delphi 5. for database development will make it a singularly attractive
choice for developers. Even those developers not requiring data-
Just as Delphi, Kylix will be available in multiple versions (see Figure 4). base access will benefit. Because of the ease with which you can
The initial release is expected to consist of two versions. As of press time, build GUI applications with Kylix, even mundane tasks such as
Borland was planning on naming these the Desktop Developer modifying Linux conf (configuration) files will be valid applica-
and Server Developer editions. The Desktop Developer edition will tions for Kylix development.
include tools for creating desktop applications, including database
applications. The Server Developer edition will include all of The problem with this second group of developers is that there is
the features of the Desktop Developer edition plus those for currently little need for desktop applications for Linux workstations.
creating Web server extensions, including Apache DSO extensions. Linux is used primarily for servers, and Microsoft continues to rule
A limited feature edition, called Kylix Open Edition, intended for GPL the desktop. One argument states that the lack of decent tools for
free software development only, is reportedly scheduled for release in building Linux desktop applications is to blame. Maybe so, but only
the second quarter. Please visit http://www.borland.com/kylix for the time will tell. Now that Kylix has shipped, we’re likely to see a steady
latest information. stream of new applications appear on the Linux desktop. If Kylix
itself is to be as big a hit as Borland expects, an increase in the
Who Will Use Kylix? adoption of Linux as a workstation platform must follow. ∆
The simple answer to this question is: Anyone who wants a powerful,
rapid application development (RAD) environment for building Linux
applications. This isn’t a very satisfying answer, however, because it
still leaves us wondering just who these developers are. The answer is
complicated, and you can bet that Borland is keenly aware of this. Cary Jensen is president of Jensen Data Systems, Inc., a Houston-based database
development company. Co-author of 17 books, including Oracle JDeveloper
There is one group of developers who are without a doubt going [Oracle Press, 1998], JBuilder Essentials [Osborne/McGraw-Hill, 1998], and
to be immediately interested in using Kylix. These are the Web Delphi in Depth [Osborne/McGraw-Hill, 1996], Cary is currently writing a Kylix
developers who want to be able to use Kylix’s substantial support for book to be published by Osborne/McGraw-Hill. He is a Contributing Editor of Delphi
database development to create Web server extensions for Apache. Informant Magazine, and an internationally respected trainer of Delphi and Java.
Delphi has always provided powerful support for database applica- For more information, visit http://www.jensendatasystems.com, or e-mail Cary at
tions, and Kylix continues this tradition. And given the ease with cjensen@compuserve.com.
By Charlie Calvert
I f the greatest fear of a Puritan is that somebody, somewhere, is having a good time,
then the greatest fear of a Windows programmer is that those people who are having
a good time are all using Linux. The purpose of this article is to determine just how
much fun Linux programmers are having, and whether any of us are smart enough to
figure out how to join them.
This is the first in a series of articles on Linux and pieces of software. Though not perfect, most of
Kylix. These articles are designed to get you up to these tools are at least as good as their commercial
speed on Kylix, the Linux operating system, and counterparts.
Linux culture.
Larger-than-life programmers with intriguing
Linux culture is considerably more interesting theories about the computer world often per-
than Windows culture. You have to be something form all this coding. Richard Stallman created
of a business fanatic to really care about the inter- an organization with the unlikely name of GNU,
nal politics of Microsoft. There just aren’t that dedicated to the absurd goal of creating free
many people who wake up wondering what Steve software. This is the kind of thing that college
Ballmer said on the previous day. When Microsoft sophomores try, only to give up on the project
creates a new technology, the only real excitement within six months. But Stallman started work
involves guessing what the marketing department more than 15 years ago, and his organization has
calls it today, and how long it will be until the changed the face of computing.
product finally works.
You would think Stallman is the overlord of the
On the other hand, the Linux world is full of Linux world; instead, he’s one of many figures. His
colorful characters, passionate debates, and daring friend, rival, and fellow eccentric Eric Raymond
technologies. The key figures in the Linux world often engages him in loud, passionate conflict. The
are often off on truly quixotic quests that have a friendly, reassuring, almost paternal voice of Linus
high enough probability of failure to keep us inter- Torvalds can also often be heard on the scene.
ested. In fact, it’s arguable that the whole enterprise
never should have worked. What do you mean?! All of these characters and technologies will
They corralled a group of volunteers and created an appear in this series of articles. I’ll begin with
operating system? Come on! We all know it takes the Linux desktop, which has special significance
big companies like Microsoft or IBM, and millions to Kylix programmers. Kylix is about creating
of dollars — in some cases over a billion — to GUI applications that run on the Linux desktop,
create an operating system. You can’t create one for so the logical place to begin this series is with
free. Sancho Panza could tell you that much. the desktop itself.
The somewhat disturbing facts, however, are that Understanding the Linux Desktop
Linux does exist, that it was created for free by This article explains the Linux desktop from a
volunteers, and that it actually works. The open programmer’s point of view. It’s aimed primarily
source movement has also created Web servers, at programmers new to Linux, or people who
editors, source repositories, and innumerable other have studied Linux only from a user’s, rather
The toolkit or widget set provides the controls that are placed on It’s important to understand that each of these layers can be replaced.
windows. Buttons and listboxes are examples of tools that are part None of them are part of the operating system, and they’re all
of the widget set. designed to conform to public standards. In short, there’s more than
The problem with this system is that the pipe is small. Sending large Conclusion
chunks of data, such as bitmaps, back and forth can be expensive. As a That’s all there’s room for in this article. The next article in this series will
result, it’s best to avoid sending large chunks of data through this pipe. show you how to create an X application in Kylix using the low-level Xlib
API. The programs I’ll show you won’t use QT, but will instead write
Big chunks of data such as large bitmaps are typically loaded by the low-level X code of the kind usually seen in a C program. ∆
client, and then sent to the X-server one time. The X-server then passes
back a handle to the resource. The resource stays on the X-server, and
you manipulate it through a handle that’s kept in a device context. This
scenario should be familiar to Windows programmers.
By Robert Leahey
Better UI Design
Part III: Persistent User Settings
I f it’s worth asking the user, it’s worth the program remembering. This is one of Alan
Cooper’s axioms of user interaction design, from his book, About Face: The Essentials of
User Interface Design [Hungry Minds, Inc., 1995].
For the last two months, this column has me want to scream. I’ve almost decided to write my
addressed some of the common problems of bad own, just to reclaim some productivity.
user interaction design. If the goal of user inter-
action design is to make the user more produc- The Find applet is a utility that I use probably
tive, then there are many problems we must two or three times a week. Imagine the frustration
overcome that can easily hinder achieving that of users who face this kind of incompetence all
goal. Last month we looked at the problem day, every day. How do we respond to coworkers
of excessive message dialogs and created some who can’t seem to remember how to do their tasks?
classes to address the issue. This month we What if an executive had to remind an assistant
examine the problem of lack of persistence of where to file a document every time the assistant
settings; in other words, the problem of pro- performed that simple task? Worse than these anal-
grams that don’t remember what their users have ogies, the lack of persistence shown by some soft-
done. Imbecilic programs such as this force work ware is tantamount to an employee who has to be
to be repeated — how does that promote pro- shown to his or her desk every morning.
ductivity? One need not look far to see an
example of the problem Thankfully, there are applications that display some
— the Window’s Find minor elements of awareness. Many programs’ File
applet shown in Figure 1 menus feature a recent files list, or retain the last
is a perfect example. position of their windows. However, in many cases,
this only brings to light more shortcomings: My
Since the applet’s debut wife and I have both done page layout, and we still
in Windows 95, I’ve have occasion to use our favorite page layout soft-
never used it without ware. It does remember some user preferences from
having to resize the session to session, but this feature usually serves to
window to a usable state. remind me that my wife and I use the application
In addition, the applica- in completely different ways. The single-minded
tion has no recollection nature of the settings persistence of our software
that 90 percent of the ends up being as bad as no persistence at all when
time I search some subset my wife uses the application after I have gotten
of the same limited set through with it. What we need is for the software
of directories; I must to remember both how I use it and how my wife
specify them every time. uses it.
Figure 1: 357x44? Are you kidding me? If the Find I actually go out of my
applet can’t remember how I left it, can’t it at least way to avoid using the So we have a challenge. We need to create a means
detect that I’m running my monitor at 1600x1200? utility, because it makes by which we can store and retrieve preferences and
Let’s begin our examination with the published members: The SettingExists method allows you to check for the existence of a
§ As noted before, AfterSettingsRetrieved is an event that fires when setting by name.
TbuiSettingsStorage has retrieved values from the registry. You
should implement an event handler for this event to update your The key methods of TbuiSettingsStorage are RetrieveSettings,
application settings when new values are available. StoreSettings, and StoreSetting. RetrieveSettings will cause
§ BeforeSettingsStored is an event that fires just before values are TbuiSettingsStorage to get the current value of all stored settings for
stored in the registry. If you implement an event handler for the current user. Likewise, StoreSettings will cause all settings to be
BeforeSettingsStored, you can abort the storage process by setting stored. The StoreSetting method allows you to force a single setting
aAllow to False. to be stored to the registry.
§ The OnSettingUpdated event fires any time one of
TbuiSettingsStorage’s owned TbuiCustomSetting objects’ value The remaining protected and private members can be examined in
is changed. You can implement this event if you want to take the source code, but the preceding overview should give you a good
special action when a specific setting is changed. idea of how to put this class to use.
Seems simple enough. Well, most of the work is done in Where Do We Go from Here?
TbuiCustomSettingList, so creating your own descendants will be This user setting persistence system is incomplete. Yes, it will store
rather painless. You can see the implementation in Listing Two our settings quite ably for us, giving our applications some long-
(on page 19). term memory, but it lacks real smarts. What this system needs is
Discernment, on the other hand, will figure out what your users
like by their actions. Every time I select Draw Table in Microsoft
Word, I’m thrown into Page Layout view, which I don’t like. Every
time that happens, I immediately switch back to Normal view.
I’d like it if the software were smart enough to see that I don’t
like that “feature” and would stop invoking it. Microsoft hasn’t
done that, but with a little effort — and these classes — you
could build your applications to detect things like that, adapt the
application’s behavior, and your users will be happy they bought
your software.
Conclusion
While this is the third and final installment of this series, the
series isn’t done. There’s always more we could talk about to
improve the user interaction design of our software. If you like
what you’ve read here, make sure you read Alan Cooper, Donald
Norman, and Edward R. Tufte (for suggested reading see the first
installment of this article series in the February 2001 issue of
Delphi Informant Magazine). If you’re really interested, push the
cause of interaction design. Build in better interaction from the
beginning of a project. Create a position on your team for an
Interaction Designer (look for a usability expert rather than a
programmer). Make better software. ∆
TbuiSettingsStorage = class(TComponent)
private End Listing One
FAfterSettingsRetrieved: TbuiNotifyEvent;
FBeforeSettingsStored: TbuiAllowActionEvent;
FCurrentUserIndex: Integer; Begin Listing Two — TbuiFontSetting implementation
FOnSettingUpdated: TbuiSettingUpdatedEvent;
const
FRegisteredSettingClasses: TClassList;
csFontName = 'FontName';
FRegistry: TRegistry;
csFontSize = 'FontSize';
FRegistryKey: string;
csFontBold = 'FontBold';
FSettings: TObjectList;
csFontItalic = 'FontItalic';
FUsers: TStrings;
csFontUnder = 'FontUnder';
procedure ClearSettings;
csFontColor = 'FontColor';
function GetRootKey: HKEY;
function GetSettingByName(const aName: string):
constructor TbuiFontSetting.Create;
TbuiCustomSetting;
begin
function GetSettings(const aName: string):
inherited Create;
TbuiCustomSetting;
AddValue(csFontName, Variant('Arial'));
function GetUsers(aIndex: Integer): string;
AddValue(csFontSize, Variant(10));
procedure RetrieveUsers;
AddValue(csFontBold, Variant(False));
procedure SetCurrentUserIndex(aValue: Integer);
AddValue(csFontItalic, Variant(False));
procedure SetRootKey(aValue: HKEY);
AddValue(csFontUnder, Variant(False));
procedure SetSettings(const aName: string;
AddValue(csFontColor, Variant(clBlack));
aValue: TbuiCustomSetting);
end;
procedure StoreUsers;
protected
procedure TbuiFontSetting.GetValues(aFont: TFont);
function CreateSettingByName(const aClassName: string):
begin
TbuiCustomSetting; virtual;
aFont.Name := string(Values[csFontName]);
procedure DoAfterSettingsRetrieved(Sender: TObject);
aFont.Size := Integer(Values[csFontSize]);
procedure DoBeforeSettingsStored(Sender: TObject;
aFont.Color := TColor(Values[csFontColor]);
var aAllow: Boolean);
if (Boolean(Values[csFontBold])) then
procedure DoOnSettingUpdated(
aFont.Style := aFont.Style + [fsBold];
aSetting: TbuiCustomSetting);
if (Boolean(Values[csFontItalic])) then
procedure PopulateSetting(aSetting: TbuiCustomSetting;
aFont.Style := aFont.Style + [fsItalic];
const aSettingName: string); virtual;
if (Boolean(Values[csFontUnder])) then
procedure SettingUpdatedEvent(
aFont.Style := aFont.Style + [fsUnderline];
aSetting: TbuiCustomSetting); virtual;
end;
public
constructor Create(AOwner: TComponent); override;
procedure TbuiFontSetting.SetFont(aFont: TFont);
destructor Destroy; override;
begin
function AddSetting(
Values[csFontName] := Variant(aFont.Name);
aSettingClass: TbuiCustomSettingClass;
Values[csFontSize] := Variant(aFont.Size);
const aSettingName: string): TbuiCustomSetting;
Values[csFontColor] := Variant(aFont.Color);
virtual;
if (fsBold in aFont.Style) then
procedure AddUser(const aUserName: string); virtual;
Values[csFontBold] := Variant(True)
procedure DeleteUser(aIndex: Integer); virtual;
else
procedure GetUserList(aList: TStrings); virtual;
Values[csFontBold] := Variant(False);
procedure RegisterSettingClass(
if (fsItalic in aFont.Style) then
aSettingClass: TbuiCustomSettingClass); virtual;
Values[csFontItalic] := Variant(True)
procedure RemoveUser(const aUserName: string); virtual;
else
procedure RetrieveSettings; virtual;
Values[csFontItalic] := Variant(False);
function SettingExists(const aSettingName: string):
if (fsUnderline in aFont.Style) then
Boolean; virtual;
Values[csFontUnder] := Variant(True)
procedure SetUserByName(const aName: string); virtual;
else
procedure StoreSetting(aSetting: TbuiCustomSetting);
Values[csFontUnder] := Variant(False);
virtual;
end;
procedure StoreSettings; virtual;
procedure UnregisterSettingClass( End Listing Two
aSettingClass: TbuiCustomSettingClass); virtual;
property CurrentUserIndex: Integer
read FCurrentUserIndex write SetCurrentUserIndex;
property RootKey: HKEY read GetRootKey write SetRootKey;
property Settings[const aName: string]: TbuiCustomSetting
read GetSettings write SetSettings;
property Users[aIndex: Integer]: string read GetUsers;
published
property AfterSettingsRetrieved: TbuiNotifyEvent
read FAfterSettingsRetrieved
write FAfterSettingsRetrieved;
property BeforeSettingsStored: TbuiAllowActionEvent
read FBeforeSettingsStored write FBeforeSettingsStored;
property OnSettingUpdated: TbuiSettingUpdatedEvent
read FOnSettingUpdated write FOnSettingUpdated;
property RegistryKey: string
By David Riggs
Decision 2001
Delphi Informant Magazine Readers Choice Awards
A benefit to all involved, this year marks the first aid of the Supreme Court, lobbyists, or manual
time we’ve conducted the Delphi Informant Mag- recounts.
azine readers choice balloting completely online.
There were no physical ballot boxes to “mis- Reflecting the spirit of its audience, the Delphi
place” or stuff (not that some of you didn’t try third-party market is ever changing, reacting to
— you know who you are). With the ease of myriad influences in the industry. This year’s ballot
voting quickly and conveniently on the Web, reflects those changes with new products and new
there was no electoral dysfunction, no premature categories. The result is an interesting mix of old
congratulations from any of the runners-up. and new, and exhibits an exciting dynamic that
Put simply, we know who won without the we’ve come to expect in the Delphi community.
DECISION 2 0 0 1
™
DECISION 2 0 0 1
™
Best Add-in
BEST ADD-IN
Replicating last year’s results, CodeRush PRODUCT COMPANY %
from Eagle Software attained top honors CodeRush Eagle Software 52
with 52 percent of the votes, while Multi- Multi-Edit American Cybernetics 17
Edit from American Cybernetics took Other 31
second with 17 percent. There seems to be Source: www.DelphiZine.com
a trend here.
DECISION 2 0 0 1
™
DECISION 2 0 0 1
™
BEST BOOK
PRODUCT COMPANY % BEST DATABASE CONNECTIVITY
Delphi in a Nutshell Ray Lischner, O’Reilly & Associates 43 PRODUCT COMPANY %
Delphi COM Eric Harmon, Macmillan 35 IB Objects Jason Wharton 27
Advanced Delphi Alex Fedorov and Natalia Elmanova, 18 ASTA ASTA Technology Group 20
Developer’s Guide Wordware Direct Oracle Access Component Set Allround Automations 13
Learn Object Pascal with Delphi Warren Rachele, Wordware 4 Other 40
Source: www.DelphiZine.com Source: www.DelphiZine.com
Blazing a trail for the second consecutive year, teeChartPro from Coming off a third-place finish last year, Advantage Database Server
Steema Software took top honors. A perennial favorite (they also from Extended Systems grabbed 28 percent of the votes to win top
won this category in 1999 when it was Best Charting/Imaging Tool), honors. Improving on last year’s fourth-place finish, and coming in
teeChartPro was again the runaway winner on 65 percent of the a close second with 25 percent of the votes, was DBISAM Database
ballots cast. Making a respectable second-place showing in its debut System from Elevate Software. The competition in this category is
on the ballot was ExpressOrgChart Suite from Developer Express stiff, so these two companies obviously did something right to post
with 16 percent of the votes. that much improvement.
DECISION 2 0 0 1
™
PRODUCT COMPANY %
BEST CHARTING/MAPPING TOOL Advantage Database Server Extended Systems 28
PRODUCT COMPANY % DBISAM Database System Elevate Software 25
teeChartPro Steema Software 65 FlashFiler TurboPower Software 23
ExpressOrgChart Suite Developer Express 16 Apollo Vista Software 11
Other 19 Other 13
Source: www.DelphiZine.com Source: www.DelphiZine.com
Leading the way by exhibiting consistency, Async Professional For the second consecutive year, top honors for best database
by TurboPower Software certainly is the communications tool to tool go to InfoPower from Woll2Woll Software. InfoPower
beat. Making a statement with a comfortable 56 percent of the decisively collected 49 percent of the votes in this competitive
votes, Async Professional wins this category for the third year run- category. An impressive second place goes to ballot newcomer,
ning (this is the second year on the ballot for this category in this ExpressDBTree Suite from Developer Express, which took 18
permutation; three years ago it was known as Best Connectivity percent of your votes.
Tool). With 28 percent of the votes, a surprise second place goes
to Indy by Chad Z. Hower. This newcomer is sending a message:
No lead is safe.
DECISION 2 0 0 1
™
DECISION 2 0 0 1
™
DECISION 2 0 0 1 DECISION 2 0 0 1
™ ™
Needing no assistance, HelpScribble from JGSoft collected 31 per- There are no secrets when it comes to your choice for best library:
cent of the votes to win this category for the third straight year. Also SysTools from TurboPower has won for the second consecutive
three-peating, in second place, was RoboHELP Office from eHelp, year. SysTools ran away with 53 percent of the votes, followed
with 23 percent of the votes. The consistent quality exhibited by by ExpressBars Suite from Developer Express, which garnered
these two products shows why they are your perennial favorites. 31 percent.
DECISION 2 0 0 1
™
PRODUCT COMPANY %
HelpScribble JGsoft 31 BEST LIBRARY
RoboHELP Office eHelp Corp. 23 PRODUCT COMPANY %
Help & Manual EC Software 14 SysTools TurboPower Software 53
ForeHelp ForeFront, Inc. 12 ExpressBars Suite Developer Express 31
Other 20 Other 16
Source: www.DelphiZine.com Source: www.DelphiZine.com
Not liking the view from behind, ImageLib Corporate Suite from This is the second year for this category on our ballot, and it marks
SkyLine Tools Imaging pulled up from a respectable second-place the first appearance for both the winner and runner-up. In a close
finish in last year’s balloting to capture this year’s top prize with contest, ModelMaker from ModelMaker used its 27 percent of the
33 percent of the votes. Improving on last year’s third-place finish, votes to edge the 22 percent attained by Rational Rose from Rational
LEADTOOLS Imaging Toolkit from LEAD Technologies got 29 Software. In a wide-open field, these newcomers made a strong show-
percent of the votes to grab second. This is a good example of two ing. Only the next year will determine if they have what it takes to
companies improving their products to better serve their clients. maintain the excellence they have achieved this year.
DECISION 2 0 0 1 DECISION 2 0 0 1
™ ™
DECISION 2 0 0 1
™
BEST UTILITY
DECISION 2 0 0 1
™
PRODUCT COMPANY %
BEST REPORTING TOOL OnGuard TurboPower Software 31
PRODUCT COMPANY % ASPack ASPack Software 24
ReportBuilder Digital Metaphors 57
VCLZip KpGb 13
ReportPrinter Pro Nevrona Designs 12
Other 32
FastReport Alexander Tzyganenko 12 Source: www.DelphiZine.com
Other 19
Source: www.DelphiZine.com
DECISION 2 0 0 1
™
DECISION 2 0 0 1
™
In one of the closest finishes on this year’s ballot, InfoCan Manage- In another category with many qualified and deserving entrants,
ment’s 22 percent of the popular vote narrowly edged Database RX Library from RxLib.com emerged as the leader of the pack,
Programmers Retreat’s 20 percent. This is a repeat performance for receiving 19 percent of the vote. Last year’s winner, Orpheus from
InfoCan being voted as your favorite training company. In fact, TurboPower Software, got 15 percent of the votes to take a close
they’ve won this category an unprecedented four times. Database second. This is an impressive debut for RX Library.
Programmers Retreat should be proud as well; they improved on their
third-place finish of a year ago.
DECISION 2 0 0 1
™
DECISION 2 0 0 1
™
DECISION 2 0 0 1
™
Best Accounting Package Best Database Engine Best Library Best VCL Component
Accounting for Delphi Advantage Database Server SysTools ExpressQuantumGrid
ColumbuSoft Extended Systems TurboPower Software Developer Express
Phone: (800) 692-2150 E-Mail: info@extendsys.com Phone: (800) 333-4160 E-Mail: info@devexpress.com
Web Site: http:// Web Site: http:// Web Site: http:// Web Site: http://
www.columbusoft.com www.extendsys.com/ads www.turbopower.com www.devexpress.com
Best Add-in Best Database Tool Best Modeling/CASE Tool Best VCL Component Set
CodeRush InfoPower ModelMaker RX Library
Eagle Software Woll2Woll Software ModelMaker RxLib.com
Phone: (888) 324-5363 Phone: (800) 965-2965 E-Mail: E-Mail: fkozh@iname.com
Web Site: http:// Web Site: http:// support@modelmaker.demon.nl Web Site: http://www.RxLib.com
www.eagle-software.com www.Woll2Woll.com Web Site: http://
www.modelmaker.demon.nl Best Web Development Tool
Best Book Best Globalization Tool Internet Professional
Delphi in a Nutshell MULTILIZER VCL Edition Best Reporting Tool TurboPower Software
By Ray Lischner MULTILIZER Ltd. ReportBuilder Phone: (800) 333-4160
O’Reilly & Associates E-Mail: info@multilizer.com Digital Metaphors Web Site: http://
Phone: (800) 775-7731 Web Site: http:// E-Mail: info@digital- www.turbopower.com
Web Site: http://www.oreilly.com www.multilizer.com metaphors.com
Web Site: http://www.Digital- Best Open Source Product
Best Charting/Mapping Tool Best Help-authoring Package Metaphors.com GExperts
teeChartPro HelpScribble GExperts.org
Steema Software JGSoft Best Testing/Debugging Tool E-Mail: eberry@gexperts.org
E-Mail: info@steema.com E-Mail: sales@jgsoft.com Sleuth QA Suite Web Site: http://
Web Site: http:// Web Site: http://www.jgsoft.com TurboPower Software www.GExperts.org
www.steema.com Phone: (800) 333-4160
Best Imaging Tool Web Site: http:// Best Freeware
Best Communications Tool ImageLib Corporate Suite www.turbopower.com Internet Component Suite
Async Professional SkyLine Tools Imaging Francois Piette
TurboPower Software Phone: (818) 346-4200 Best Training E-Mail:
Phone: (800) 333-4160 Web Site: http:// InfoCan Management francois.piette@pophost.eunet.be
Web Site: http:// www.imagelib.com Phone: (888) INFOCAN (463-6226) Web Site: http://users.swing.be/
www.turbopower.com Web Site: http:// francois.piette/indexuk.htm
Best Installation Package www.InfoCan.com
Best Database Connectivity InstallShield Express Product of the Year
IB Objects InstallShield Software Best Utility ReportBuilder
Jason Wharton Phone: (847) 240-9111 OnGuard Digital Metaphors
E-Mail: jwharton@ibobjects.com Web Site: http:// TurboPower Software E-Mail: info@digital-
Web Site: http:// www.InstallShield.com Phone: (800) 333-4160 metaphors.com
www.ibobjects.com Web Site: http:// Web Site: http://www.Digital-
www.turbopower.com Metaphors.com
By Shiv Kumar
ISAPI Development
Part III: Working with Graphics
L ast month, in Part II of this series, you learned how to store and access information
in a database table from within an ISAPI application. That data was text-only. This
month, you’ll learn how to access and display BLOb (Binary Large Object) data from
a database.
You’ll send images extracted from a database to a add a Query component to it, and change its
Web browser, and explore the QueryTableProducer name to qryData. Set its DatabaseName property
component (part of Delphi’s Web Broker technol- to DBDEMOS, its SQL property to SELECT * FROM
ogy) to help you publish database information on BIOLIFE, and its Active property to True. Place
the Web. HTML tags and frames will also be used. a QueryTableProducer component on the Web
In addition, because images tend to need a lot of Module, and set its Query property to qryData.
bandwidth to be displayed over the Internet, you’ll
find out how to reduce their size and bandwidth Double-click on the Web Module (or right-click it
requirements on the fly. and choose Action editor) and create a new action
item. Set the PathInfo property of this action item
It’s assumed that you’ve read the first two parts of to /data, the Name property to waData, the
this series in the February and March 2001 issues. Default property to True, and the Producer property
Many essential concepts were explained that won’t to QueryTableProducer1. Then drop a Session
be covered here. component on the Web Module and set its
AutoSessionName property to True. Finally, set
Sending Data the Output directory to C:\inetpub\scripts on
Delphi makes sending data really simple; you don’t the Directories/Conditionals page of the Project
need to write any code for this part. Start by creat- Options dialog box (or set it to the scripts folder of
ing a new ISAPI Web Server Application. Then your Web server). Your Object Inspector and Web
Module should look like Figure 1.
http://www.mydomain.com/scripts/
myserverextension.dll/data
Response.Content := QueryTableProducer1.Content;
Every request from the Web server causes your ISAPI application to
Figure 2: Output generated by the QueryTableProducer component.
spawn a new thread within which a new instance of the Web Module
is created. To allow for multiple simultaneous access to a database, use
a Session component and set its AutoSessionName property to True
so it generates a unique session name for every session (thread). This
isn’t required for CGI applications, because every request from the
Web server creates a new instance of your CGI application (simulat-
ing multiple simultaneous users, each using a separate instance of
your application). When using non-BDE datasets, you should use a
transaction component or something similar to perform the function
of the Session component.
Using QueryTableProducer To show the contents of the Notes field, you need to change the
First, set qryData’s Active property to True, and then double-click value of the CellData variable to the contents of that field. Before
on the QueryTableProducer1 component to view its Response writing any code, create the field objects for the qryData dataset
editor (or you can right-click on it and choose Response editor (see Figure 4). You aren’t required to instantiate field objects for
from the shortcut menu). The Response editor should look like things to work, but in this case you’ll create field objects only for
Figure 3. the fields in which you’re interested.
Before you can start manipulating fields, you need to first add all Now in the OnFormatCell event, write the code shown in Figure 5.
fields (similar to instantiating fields of a dataset). To do this, click
on the Add All Fields button in the Response editor. You can drag Re-compile your project and refresh your browser. (See the previ-
and drop, or use the up and down arrow buttons to reorder the ous articles for help with re-compiling.) Notice that the Notes
fields, and select each field in turn and set its properties listed in field now shows contents rather than the word “MEMO”.
the Object Inspector.
Viewing the Graphic Field
You can also set table properties using the Response editor. For this Having graphics appear with data is a bit trickier. The CellData
example, delete the following fields: Length(cm), Length_In, and parameter in the OnFormatCell event for the Graphic field needs
Common_Name. This should give you some extra space to show to be set by QueryTableProducer. If you change the value of the
You can write a procedure in your ISAPI application to extract the image procedure TWebModule1.QueryTableProducer1FormatCell(
from the table for a given record. This image then needs to be streamed Sender: TObject; CellRow, CellColumn: Integer;
to the browser. To get the browser to load the image, you simply set the var BgColor: THTMLBgColor; var Align: THTMLAlign;
var VAlign: THTMLVAlign;
src attribute of the <img> tag as an action item. The action will then have var CustomAttrs, CellData: string);
the responsibility of sending back the corresponding image. First, write begin
the code shown in Figure 6 to change CellData to an <img> tag. // Row 0 is the column header, so check for CellRow > 0.
if (CellRow > 0) and (CellColumn = 4) then
CellData := qryDataNotes.Value; // Memo Field data.
The result of the Format procedure and the value of the CellData
// Change the CellData from (GRAPHIC) to an <img> tag.
variable will be something like: if (CellRow > 0) and (CellColumn = 5) then
CellData := Format('<img src="%s/image?No=%s">',
<img src="/biolife.dll/image?No=90020"> [Request.ScriptName, qryDataSpeciesNo.AsString]);
end;
In this code, you extract the Species No value from the QueryFields Re-compile your application and refresh your browser. The Notes and
property of the Request object and assign it to the SpeciesNo parameter Graphic fields are shown along with the other fields.
hyperlinks, you should see that each species has its associated Species
No value in the status bar of the browser. Figure 10: OnFormatCell event handler of QueryTableProducer2.
Notice you referenced an action item with a PathInfo of /Details in created an action item with a PathInfo of /details. Create it now by
the code, which expects to see a parameter named No. If you click setting a new action item’s PathInfo property to /details and Name
on any of the hyperlinks now, you’ll get an error since you have not property to waDetails. Drop another Query component on the
procedure TWebModule1.WebModule1waMainAction(
Sender: TObject; Request: TWebRequest;
Response: TWebResponse; var Handled: Boolean);
begin
Response.Content := '<html>'#13#10 + '<head>'#13#10 +
'<title>Biolife ISAPI Project</title>'#13#10 +
'</head>'#13#10 + '<frameset cols="200,*" border="0">'
#13#10 +'<frame name="MenuFrame" src="' +
Request.ScriptName + '/names"' +
' marginwidth="10" marginheight="5" scrolling="auto"' +
' frameborder="no">'#13#10 +
'<frame name="DetailFrame" src="" marginwidth="10" ' +
'marginheight="10"' +
' scrolling="auto" frameborder="no">'#13#10 +
'</frameset>'#13#10 + '</html>';
end;
Figure 11: The Notes and Graphic fields using frames.
You’ll use this Query component to connect to the required record In Figure 12, the first line of code tells the browser that you want a
and get the value of the Notes field to be displayed in the browser. frameset split into columns. The first column is 200 pixels wide and the
In the OnAction event of the waDetails action item, write the second column is the remaining width. Within this frameset, you have
code shown in Listing Two (beginning on page 32). You’ll find two frames. The <frame> tag has a number of attributes. Of these, the
the full explanation of the code in the comments. Just as you did most important attributes are name and src. Each frame is a separate
previously, set the src attribute of the <img> tag to your waImage HTM file or URL. The src attribute of the <frame> tag tells the browser
action item (PathInfo of /image). This action item can extract the where to get the page, and it can be a valid URL to an actual HTM file
graphic and stream it out to the browser when given the Species or an action in an ISAPI/CGI application. The name attribute is used to
No value. Re-compile your application, refresh your browser, and identify the frame, and is case-sensitive. The name is generally used as the
click on a hyperlink to see both the Notes and Graphic fields. value for the target attribute of an anchor <a> tag, image map, or form. If
Notice that you have to click on the Back button of your browser you don’t specify a target attribute for an <a> tag, the linked page appears
to see the list of Common_Names again. in the same frame like it would in a browser window that’s not split into
multiple frames. Now that you’ve learned a little about frames, use them
You’ve done quite a bit to your application, but there’s more in your project to see how they work.
you can do to improve it. Before you do so, here’s a recap of
what you’ve learned so far. You’ve discovered how to use the The HTML for the frameset in Figure 12 can be a physical HTM file
QueryTableProducer component and the OnFormatCell event to on your hard drive or it can be generated by an action in your ISAPI.
change output, and how to extract an image from a database table To follow this example, take the second alternative. First, create a new
and stream it out to a Web browser. You’ve also found out how action item, set the PathInfo to /main, name it waMain, and set its
to create hyperlinks. default property to True. In the OnAction event of this action item,
write the code in Figure 13.
Extending the Application
The back and forth between Web pages can get quite tiring for As shown in Figure 13, waMain generates the frameset. The
visitors to your Web site. Frames give you the ability to split a MenuFrame’s src value points the browser to an action, PathInfo of
browser window into multiple windows, so you can have a list of /names, in your ISAPI, and it sends back an HTML page with a
hyperlinks on the left side of the browser and fields, like the Notes list of Common_Names that are hyperlinked. The DetailFrame’s
and Graphic fields, on the right side, as shown in Figure 11. src attribute has no value. This is intentional because you don’t
procedure TWebModule1.QueryTableProducer1FormatCell(
Sender: TObject; CellRow, CellColumn: Integer;
var BgColor: THTMLBgColor; var Align: THTMLAlign;
Figure 17: The ISAPI application with thumbnail images instead
var VAlign: THTMLVAlign;
of full-size images.
var CustomAttrs, CellData: string);
begin
// Row 0 is the column header, so check for CellRow > 0.
if (CellRow > 0) and (CellColumn = 4) then
CellData := qryDataNotes.Value; // Memo Field data.
You need to make a few changes to implement thumbnails in your
// Change the CellData from (GRAPHIC) to an <img> tag. project. However, please note that you’ll only implement thumbnails
if (CellRow > 0) and (CellColumn = 5) then for the waData action item. The URL will be: http://mypcname/
CellData := Format('<a href="%s/image?No=%s&Size=1">' + scripts/biolife.dll/data.
'<img src="%s/image?No=%s&Size=2" border="0"></a>',
[Request.ScriptName, qryDataSpeciesNo.AsString,
Request.ScriptName, qryDataSpeciesNo.AsString]); Make the required changes in the waImage action item’s OnAction
end; event by entering the code from Listing Three (on page 33). Notice
that before you assign the bitmap to the JPEG image, you reduce
Figure 16: Specifying the Size parameter. the image by a factor you extract from the QueryFields property of
the Request object:
really want to show anything in this frame at the onset, although
you do want to show the Notes and Graphic fields in this frame ReduceBitmap(smBitmap, Bitmap, StrToIntDef(
when you click on any of the hyperlinks on the left. Request.QueryFields.Values['Size'], 1));
Check the output of waMain. If you click on the hyperlinks now, Now, you need to specify the Size parameter by modifying the
you’ll notice that the Notes and Graphic fields are shown in the same QueryTableProducer1’s OnFormatCell event, as shown in Figure 16.
frame, the frame named MenuFrame. This isn’t what you want. You’d (Keep in mind there’s no problem if the Size parameter doesn’t exist
like the Notes and Graphic fields to be shown in the DetailFrame. in Delphi 4 and 5 because the ReduceBitmap procedure uses a default
To get your ISAPI application to do this, you need to set the parameter; Delphi 3 doesn’t support default parameters.)
target attribute’s value for each of the hyperlinks to DetailFrame by
modifying the OnFormatCell event of QueryTableProducer2 to the The <img> tag’s src attribute sends two parameters, No and Size. Size
code shown in Figure 14. has a value of two; the image will be half its full size. The <img> tag
is surrounded by an <a> tag, so you’ll get a full-sized image when
Basically, you’re just changing the format string from: an image is clicked. The <a> tag’s href attribute sends two parameters
as well, because it calls the same action, /image, which expects two
<a href="%s/Details?No=%s">%s</a> parameters. But in this case, Size has a value of one, meaning full
size. The result of the Format function shown in Figure 16 should
to be something like:
C ould your application use a solid component that offers powerful features for
analyzing, reporting, and graphing data? The Excel Automation server components
in Delphi 5 let you directly manipulate Excel to export data, insert formulas, and draw
graphs to create new views of your application’s data.
Delphi 5 wraps Office 97 and Office 2000 in a to the DBDEMOS tables installed with Delphi.
set of components that greatly facilitate Automa- Although this application was created with the Excel
tion. Using the components might appear difficult 97 components, it also runs under Excel 2000.
at first because they aren’t documented. Their use is
straightforward however, and the Excel object model Working with Automation Objects
is well documented. Using any Automation server Automation is a technology that enables one appli-
requires a basic understanding of the two topics: cation (the controller) to directly manipulate the
§ Automation and how to use Automation objects of another application (the server). In other
objects in Delphi. words, a Delphi application can control Excel
§ The object model of the Automation server — to perform everything that can be accomplished
Excel, in this case. through the user interface. This is possible because
Excel is truly object-oriented. All content and
The demonstration application accompanying this functionality in Excel is defined through objects,
article (available for download; see end of article for which are exposed through COM interfaces so
details) uses Excel to create a report and chart of other applications can manipulate them. (A more
monthly sales (see Figure 1). It requires a BDE alias detailed discussion of Automation appeared in the
“Word Control: Part I” article in the September
2000 issue.)
ExcelApplication1.Workbooks.Add(
The ExcelWorkbook object can connect directly to the return value OleVariant(xlWBATWorksheet), 0);
of the Add method because the Excel import files were modified to
rename references to the workbook to ExcelWorkbook. However, some Use the EmptyParam variable to represent unused or default param-
properties and methods return references to objects that must be cast eters that are OleVariants:
The Excel Object Model Figure 4: Looping through a query, and writing into worksheet
The next step is to get into the Excel object model. To successfully columns.
use the Excel components, it’s important to understand how Excel’s
content and functionality are defined in the object. The Excel object saved workbook. An earlier example uses the Workbooks object to create
model is documented in the Microsoft Excel Objects help file vbaxl8.hlp a new workbook and connect to it. Existing workbooks that are open in
(or vbaxl9.chm for Office 2000), which is on the Office CD, but Excel can be accessed by name, index, or the ActiveWorkbook property,
not installed by default. To install it, run the Microsoft Office Setup like this:
program, and select Add/Remove components. Select Help for Visual Basic
under the Help options (or under the Office Tools option in Office 2000). ExcelWorkbook1.ConnectTo(ExcelApplication1.ActiveWorkbook);
Please note the help file is not current with the type library, so the This example opens an existing workbook and connects to it:
parameters described in the help file aren’t always accurate. The actual
declarations can be found in the imported files (Excel97.pas and ExcelWorkbook1.ConnectTo(ExcelApplication1.Workbooks.Open(
Excel2000.pas), or use the Code completion (Cm) and Code 'c:\code\excel\book1.xls', EmptyParam, EmptyParam,
EmptyParam, EmptyParam, EmptyParam, EmptyParam,
parameters (CVm) features to show the expected parameters.
EmptyParam, EmptyParam, EmptyParam, EmptyParam,
Figure 3 shows the difference between the help file and the Code EmptyParam, EmptyParam, 0));
parameters output.
All of the Office applications follow common naming conventions You can access worksheets in the same manner. The example above
and standards. The Application object is the top-level object and shows how to connect to the first worksheet by index. This example
provides a reference to the application itself. Objects are often acces- connects to a worksheet by name:
sible only through other objects in a parent-child relationship, and
child objects can have children of their own. Another convention is ExcelWorksheet1.ConnectTo(
the use of Collection objects that contain a set of related objects. The ExcelWorkbook1.Sheets['sheet1'] as _Worksheet);
name of the Collection object is the plural of the object the collection
contains. For example, the WorkSheets collection contains WorkSheet With a reference to a worksheet, data can be entered in the cells.
objects. Most collections provide a Count property and Item and Add
methods to navigate and select specific objects. Entering Data and Formulas
There are a variety of ways to move data from a Delphi application to
In Excel, documents are called workbooks. A workbook is a collection Excel. If the data can be accessed using ODBC, the ExcelQueryTable
of worksheets and sheets. Each worksheet contains cells that are used to component is best for loading data directly into a worksheet. Excel
store and identify data and formulas in a workbook. Each cell can have can also directly open comma-delimited files, so a Delphi application
associated formatting such as fonts, colors, and layout options. The Range might write the data to a file, and then open it with Excel. However,
object is used to identify a cell or range of cells in a contiguous block. smaller amounts of data can be written directly to each cell. The
example in Figure 4, taken from the demonstration application, loops
The overall structure of the object model resembles the user interface, through a query, and writes the sale date in the first column and the
so performing an action programmatically usually requires the same amount in the second column.
steps as in the user interface. For example, to insert text into a cell,
first open Excel, and then use the existing workbook or create a new Formulas can also be entered in the same manner. The following
one. Next, use an existing worksheet, or create a new one. Finally, example places a formula at the bottom of the second column to
select a cell, and enter text. total all sales:
These steps can be accomplished using just the ExcelApplication ExcelWorksheet1.Cells.Item[iRow + 2,2] :=
component, but it would require making calls to objects several '=SUM(B1:B' + IntToStr(iRow) + ')';
levels deep. It’s much easier to use the other components along
with the ExcelApplication object. For example, to perform the same Working with Charts
actions programmatically, drop ExcelApplication, ExcelWorkbook, and Use the ExcelChart object to create or access a chart in a work-
ExcelWorksheet components on the form, and connect each of them book. The chart can be either an embedded chart in an existing
as described in the following section. sheet, or a separate chart sheet. The following example uses the
Sheets object to create a chart worksheet:
Using Workbooks and Worksheets
There are several ways to connect to a workbook: access a workbook ExcelChart1.ConnectTo(ExcelWorkbook1.Sheets.Add(EmptyParam,
that’s currently open, create a new workbook, or open a previously EmptyParam, 1, Variant(xlChart), 0) as _Chart)
var
oRange: Variant;
begin
// Define a range for the source of data.
oRange := ExcelWorksheet1.Range['A1', 'B13'];
// Use the ChartWizard method.
ExcelChart1.ChartWizard(
oChartRange, // Source.
Variant(xl3DColumn), // Gallery.
4, // Format.
Variant(xlRows), // PlotBy.
0, // CategoryLabels.
1, // SeriesLabels.
True, // HasLegend.
'Monthly Sales', // Title.
'Month', // CategoryTitle.
EmptyParam, // ValueTitle.
EmptyParam, // ExtraTitle.
0); // LCID.
end;
Figure 6: Use TExcelChart to create a graph. Here, the
ChartWizard method is used to chart monthly sales.
There are dozens of properties that can be set to create a chart, but the spreadsheets and charts to be saved as interactive Web pages), and
minimum required properties can be set using the ChartWizard method, Web page scripting. All of the new features are well-documented
as shown in Figure 5. The first parameter of this method is the range in the Excel VBA help file.
that contains the source data for the chart. This requires creating a range
object as a variant and defining its values. The first column of the range Conclusion
contains the names of the months, and the second column has the total This article covers some basics of Automation and presents the
sales amount for that month. The PlotBy property is set to xlRows, and Excel object model. However, there are many other topics for
SeriesLabels is set to one because the data is labeled in one column. This which space doesn’t permit a discussion. For example, Object
method creates the chart in the chart sheet shown in Figure 6. Linking and Embedding (OLE) allows Delphi applications to
contain Excel objects. (The demonstration application copies the
The ExcelChart object has plenty of events that allow the develop- chart shown in Figure 6 into Delphi.) A more detailed discussion
ment of truly interactive charts. The demonstration application also of OLE 2 was presented in “Automating Word: Part II,” which
provides an example of embedding a chart in an existing worksheet. appeared in the October 2000 issue. ∆
Using Excel 2000 The sample application referenced in this article are available on the
By default, the server components included with Delphi are for Office Delphi Informant Magazine Complete Works CD located in INFORM\
97. However, code written with these components will also run on 2001\APR\DI200104RG.
Office 2000 because Microsoft provided backward compatibility, and
the servers point to the same class ID. Therefore, unless the application
specifically requires Excel 2000, the 97 components should work fine
under 2000. However, to take advantage of the new features in Excel
2000, the Excel 2000 server components must be installed. Since the
97 and 2000 classes use the same names, they can’t both be installed Ron Gray is a software developer specializing in business database applications.
at the same time. First, select Install Package from the Component menu He’s written numerous articles using different languages and is the author of
in Delphi and remove the Office 97 components (DclAxServer50.bpl). LookUp Manager, a collection of components for visually managing lookup codes
Next, add the package Dcloffice2k50.bpl in the /bin directory to and abbreviations in applications. He can be reached at rgray@compuserve.com.
register the Office 2000 components.
Steven McPherson lives in Atlanta with his wife, Kelly, and daughter, Sarah. He’s a
The Excel 2000 object model includes many changes, which show programmer for an Atlanta-based insurance adjusting company. He started writing
in the size of the imported type library: 4,915KB as compared code as a hobby five years ago and has turned it into his full-time career. He has
to 1,830KB for Excel97.pas. Primary additions include direct experience with Visual Basic and Delphi, and is currently learning Java. Steven can
support of ADO (which is the preferred data access method in be reached at smcpherson2002@yahoo.com.
Excel 2000), the Office 2000 Web components (which allows
W ise for Windows Installer 3.0 is the latest version of Wise Solutions, Inc.’s installation
tool for Windows Installer. If you’ve used other Wise installation products, you’ll feel
right at home with Wise for Windows Installer 3.0. If not, you’re in for a surprise.
When you start Wise for Windows Installer for the to move easily through the six major steps of creat-
first time you’re presented with the New Installation ing your installation. However, unlike most Win-
File dialog box (see Figure 1). This is the same dows experts or wizards that require you to move
dialog box you’ll see if you choose File | New. Here from step to step by clicking Next and Previous
you can choose to start a new empty project; start buttons, the Wise UI lets you see all the buttons
with an empty merge module; create a new trans- concurrently so you can jump to any step simply
form; import a Wise script that was created with by clicking the appropriate button.
Wise InstallMaster, InstallBuilder, or InstallManager;
import a VB project; run the Application Watch Each button contains a list of functions you can
wizard; or run the SetupCapture wizard. Also, a pair perform as part of that step. For example, in step
of radio buttons let you choose whether you want one you can create or edit features, add files to
to create a standard Windows Installer file or a Wise features, define which features are included in each
project file. I can’t think of a reason not to create a installation type, and add any merge modules that
Wise project file since the project files are smaller and need to be run as part of your installation. You
allow you to create multiple product releases from a have two choices when you click a button. You can
single project. A standard Windows Installer MSI file click the right side of the button and automatically
is automatically created when you compile a release. go to the first function in the list for that step or
you can place the mouse cursor over one of the
Exploring the Installation Expert functions listed so it appears underlined, click, and
You’ll see the main Wise Installation Expert jump directly to the screen for that function. To
screen shown in Figure 2 when you start a new the right of each of the functions listed inside the
empty project. One of the unique things about button is a small recessed square. The square will
Wise products is that appear darkened if you have made any changes.
the Installation Expert This lets you see at a glance where you have
doesn’t use the standard customized the installation and allows you to go
Windows user interface. directly to that function or feature.
Wise had the courage
and the talent to create Another impressive aspect of the Wise Installation
a unique UI that’s more Expert is its power. The problem with experts or
powerful and easier to wizards in most programs that let you perform
use than had they tried complex tasks is that they let you perform only
to mimic something one small part of the task in each wizard, or the
more familiar that wasn’t wizard only lets you build the shell of whatever
specifically designed for you are doing and you must do a lot of customiza-
creating software instal- tion outside the wizard to finish the job. As you’ll
lations. The heart of the see, this is not the case with the Wise Installation
expert’s UI is the row of Expert. For the most part, it allows you to do the
buttons, numbered one whole job from within the expert.
through six, at the top
of the screen (Figure 3 Building an Installation
provides a closer look). To give you a better understanding of what it’s like
Figure 1: The New Installation File dialog box. These buttons allow you to work with the Installation Expert, let’s take a
Wise for Windows Installer 3.0 is the best installation tool I have seen for building
Windows Installer setups. The Installation Expert is a superior marriage of power
and ease of use. In most cases, you’ll be able to build all but the most complex
installations without ever leaving the expert. If you need to build installations
using Windows installer you can’t go wrong with Wise for Windows Installer 3.0.
The fifth step is where you define the releases for your application.
Every installation must have at least one release, but you can have
as many as you wish. For example, if you have a professional ver- Using the Setup Editor
sion of your application that includes all features and a standard The Setup Editor, shown in Figure 6, provides a completely different
version that includes only some of the features, you need to define view of your installation, as well as the ability to edit the Windows
two releases. Other reasons for multiple releases include support Installer database tables directly. This screen is divided into three panes.
for multiple languages and different distribution media. When
you define a release, you also decide whether to create only an The left pane contains six tabs that correspond to the types of informa-
MSI file or to create an EXE that will install Windows installer if tion with which you can work. A different tree view appears for each tab.
it isn’t already on the target computer. Selecting the Build option The upper-right pane displays the detailed values for the selected item in
enables the Release combo box near the upper-right corner of the the left pane. For example, if you select the Product tab, the left pane
screen. Here you select each release, then choose the features that contains Launch Conditions, Properties, and Summary. Select Properties to
will be included. The Media option lets you set the properties of display all the properties and their values in the upper-right pane. The
the distribution media for each release, and the Languages option lower-right pane contains help about the selected item in the left pane.
lets you choose the languages for each release. Wise for Windows
Installer ships with five built-in languages; the optional language Properties and Summary information have already been described.
pack offers an additional 20. Selecting Launch Conditions lets you create conditions that must be
true for the installation to run. For example, you could require that
Step six is where you finish, and includes options for project informa- the user be logged on as Administrator to install your application.
tion, summary information, upgrades, code signing, and Windows Wise for Windows Installer makes creating launch conditions easy
2000. The Project option lets you enter the name, version number, by providing a Condition Builder, which lets you build conditional
and manufacturer information. You can also change the default instal- expressions by making point-and-click choices from lists.
lation directory here. The Summary option allows you to enter all the
information you want users to see when they right-click the setup file The Features and Dialogs tabs let you define your features and
in Windows Explorer and choose Properties. Using the Upgrades option, control which dialog boxes are displayed during installation. You can
you can enter information about previous versions of your product that create your own custom dialog boxes or customize any of the built-in
this installation will upgrade. If the previous installation doesn’t exist, dialog boxes using the dialog editor. The Actions tab lets you edit
this installation will not work. The Code Signing option allows you to existing actions or add custom actions. While it’s not likely that you’ll
create a code-signed installation file. Finally, the Windows 2000 option need to change any existing actions, there are times when you will
lets you set how your application is displayed in the Windows 2000 and want to add custom actions. Custom actions let you run an EXE
Windows Me Add/Remove Programs Control Panel applet. or call DLL functions as part of your installation. You can even
run VBScript or JScript files. The Tables tab lets you edit Windows
When you’ve finished creating your installation, use the Compile, Test, Installer database tables directly and is for those who are intimately
Debug, Run, and Distribute buttons at the bottom-right (again, see familiar with the Windows Installer SDK.
Figure 5) to test, debug, and distribute your installation. The Compile
button creates your setup file, which will either be an EXE or MSI What’s New?
file (depending on the options you chose). The Test button allows If you’ve used version 2 of Wise for Windows Installer, here’s a sum-
you to run your installation and see exactly what the end user will mary of the new features in version 3. Editing Windows Installer
see without making any changes to your system. The Debug button database tables is now easier. You can add new rows to any table;
opens the debugger for Windows Installer, which lets you single-step show or hide empty tables; search the entire database for validation
through your installation, set breakpoints, and examine values. The errors; or search and replace strings in the entire database, a single
Run button runs the installation and installs the software on your table, or a single column. You can also add your own tables to the
system. In addition to distributing your application to removable Windows Installer database to store data used by custom actions.
media or a network share, the Distribute button also lets you distribute Support for undo, redo, cut, copy, and paste has been added to
your setup via FTP. the Setup Editor. The Previous Version and Installation Types options
Documentation
The documentation for Wise for Windows Installer 3.0 is extensive
and excellent. The product ships with a Getting Started Guide in both
hard copy and PDF formats. The guide steps you through installing
the product and has chapters that introduce you to Windows Installer
and provide a tour of Wise for Windows Installer and the basics
of creating setups. In addition, the 544-page Reference Manual is
included in PDF format. Coupled with the extensive online help,
these manuals should provide answers to all your questions.
Versions
Wise for Windows installer is available in Standard and Professional edi-
tions. In addition to the features in the Standard edition, the Professional
edition includes the debugger, macro editor, transform creation wizard,
the ability to create patches, automation support, and the ability to create
custom actions from Wise Installation System 8.0 or higher scripts.
Conclusion
Wise for Windows Installer 3.0 is the best installation tool I have
seen for building Windows Installer setups. The Installation Expert
is a superior marriage of power and ease of use. You’ll be able to
build all but the most complex installations without ever leaving
the expert. However, if you need to create more sophisticated
setups, the Setup Editor provides absolute power by letting you
edit every table in the Windows Installer database. Even in the
Setup Editor, Wise for Windows Installer is easier to use than other
products I’ve seen — thanks to the well-organized tabs and tree
view and the help pane that provides detailed information about
the area of your setup in which you are working. If you need to
build installations using Windows Installer, you can’t go wrong with
Wise for Windows Installer 3.0. ∆
Bill Todd is president of The Database Group, Inc., a database consulting and
development firm based near Phoenix. He is co-author of four database program-
ming books, author of more than 60 articles, a contributing editor to Delphi
Informant Magazine, and a member of Team Borland, providing technical support
on Borland Internet newsgroups. He is a frequent speaker at Borland Developer
Conferences in the US and Europe. Bill is also a nationally-known trainer, and has
taught Delphi programming classes across the country and overseas. Bill can be
reached at billtodd_az@qwest.net.
I n the July 1998 issue of Delphi Informant Magazine I wrote a column entitled “Quality First: A Challenge to RAD?”
in which I concluded there was no inherent conflict between rapid development and a quality-centered approach to
writing software. I ended that column stating that “by keeping us focused on robustness and fixing errors early [the
Quality First Model] increases our productivity and makes RAD workable.” In examining a new book by Steve McConnell,
I found my view vindicated. Furthermore, the approach to programming articulated by Bertrand Meyer (IEEE’s Computer
Magazine, May 1997) in his Quality First Model seems even more timely today. Therefore, I concluded it was time to
write more about this important topic.
In this two-part column, we’ll discuss three books that help us As the book continues, it considers larger issues of software devel-
understand why and how to put more quality in our development opment, examining the entire profession while providing insight-
projects, and share some of the insights included in those sources. ful analysis and suggestions about its future. Among the topics
These books include two by McConnell: his new book, After the discussed are programming as a profession and the personality
Gold Rush [Microsoft Press, 1999], and his classic, Code Complete traits and training of programmers. In this column, we’ll concen-
[Microsoft Press, 1993]; and an early entry in the Software Qual- trate on what McConnell says concerning quality software (which
ity Institute Series entitled Constructing Superior Software [Mac- he discussed from a different viewpoint in Code Complete).
millan Technical Publishing, 1999, Paul C. Clements, ed.]. After
a capsule review of each of the sources, I’ll share what the authors McConnell’s first work, Code Complete, has become a recognized
have to say about quality in the beginning, quality in the middle, classic in programming literature. Considering the wealth of excel-
and quality at the end. lent information and advice within its pages, this work could
justifiably be titled The Coder’s Bible. While the focus is on writing
This month, we’ll discuss the sources in detail and explore quality good code, other aspects of the development cycle are discussed.
in the beginning. Next month, we’ll delve further and discuss Of course, parts of the book are now dated, because it was written
quality in the middle and quality at the end. There is one theme before the great revolution in design patterns and modeling that
that should resonate throughout: Regardless of one’s particular emerged in the mid-1990s. Still, much of the advice is as relevant
role in software development — independent developer, program- today as when it was written. One aspect I especially like is that
ming team member, team leader, quality assurance specialist, or the coding examples are not just in C/C++; many are in Pascal. If
project manager — these are issues about which we should all be you’ve never read it, you need to.
concerned. Why? Because by engaging them we can learn to work
smarter, as opposed to simply working harder. For managing software projects, Constructing Superior Software is
particularly practical. Each of the three sections focuses on a
The sources. In his latest work, After the Gold Rush, McConnell uses different general theme: Part One, “Quality Systems,” lays the
the analogy of the 1849 California Gold Rush to demonstrate some foundation for creating an effective environment in which to
of the pitfalls for entrepreneurial developers in emerging technologies. create software, with strong arguments for emphasis on reliability
In software “gold rushes” there are opportunities for a handful of and a user-centered development strategy. Part Two, “Quality
bright, hard-working, and — yes — lucky developers to become Design,” discusses software architecture in general, explaining how
extraordinarily successful. Of course you immediately think of a to develop a well-documented, rational design, then plan the
certain Mogul of Redmond. However, McConnell makes it clear why implementation of that design using a component-based approach.
this is such an exception. He spends a good deal of time attacking the Part Three, “Quality Projects,” covers the essential topics of creat-
“code-and-fix” approach favored by hero programmers who prefer to ing and managing software teams, applying measurement to soft-
dive head first into ferocious coding without any benefit of planning ware development, and selecting tools. Part One will be most
or design. He warns against the deceptively impressive initial progress helpful to managers; the last two parts speak more directly to
sometimes found with this approach, calling it “fool’s gold,” because developers. McConnell provides strong arguments as to why you
it can produce a plethora of defects that eventually place us in what should manage software projects intelligently; Constructing Superior
he calls the “Tar Pit.” I’ll have more to say about these issues later. Software explains how.